User Workflows
Planned:
DeleteUserDataWorkflow— permanently removes all data for a user after the 7-day grace period.
SendVerificationEmailActivity
Planned — not yet live.
Type: Single activity dispatched directly from the API — no multi-step workflow needed.
Trigger: Enqueued by:
POST /user/:id/altwhen a validemailfield is providedPOST /user/:id/verify-email(resend)
Steps:
- Query
verificationTokensfor an existing unused, non-expired token foruserId+type: "email"— reuse the existing token if found (resend path, same link is re-sent) - Otherwise: generate a 64-char nanoid token; write to
verificationTokens/{token}withtype: "email",value: <email>,expiresAt: now + 72h,usedAt: null - Send email via Resend with the verification link
https://95octane.com/verify-email?token=<token>
Retry policy:
maximumAttempts: 3, initialInterval: 30s, backoffCoefficient: 2
Timeout: activityStartToCloseTimeout: 30s
DeleteUserDataWorkflow
Planned — not yet live. The current
DELETE /user/:idendpoint setsstatus: "deleted"and revokes Firebase Auth sessions. This workflow handles permanent removal after the grace period.
Trigger: 7 days after a user document's status is set to "deleted"
(keyed on deletedAt)
Activities:
deleteUserRides— delete all rides where the user is the creatorremoveUserFromRidesAndGroups— remove the user's membership records from all rides and groups where they are an admin or memberdeleteUserVerificationTokens— delete allverificationTokensdocs whereuserIdmatches (both used and unused, as each doc contains PII in thevaluefield)deleteUserBuddyData— delete allbuddyRequestsdocs on both sides (sender and recipient) and allbuddiesdocs for this userdeleteUserDocument— delete the user's Firestore document and all subcollections
Retry policy:
maximumAttempts: 3, initialInterval: 30s, backoffCoefficient: 2
Timeout: workflowRunTimeout: 10m, activityStartToCloseTimeout: 60s