Developers/Workflow/User Invitation Flow
From wiki.storlye.com
Why user_invitations.invited_user_id exists
- The invitation starts without a target account, so invited_user_id is NULL at creation time.
- After signup starts, backend binds the invitation to the real created account by setting invited_user_id.
- During signup confirmation, backend uses email plus invited_user_id to attach the pending user connection safely.
- This avoids ambiguity when emails are reused/resubmitted and preserves invitation audit traceability.