Group Workflows

ArchiveGroupWorkflow

Planned — not yet live.

Scans for groups that have been inactive beyond the configured cooldown period and archives them automatically.

Trigger: Scheduled cron (daily); reads group.coolDownPeriodForArchivingGroup from settings/global

Activities:

  1. findInactiveGroups — query groups where no rides have been created within the cooldown period and archivedAt is null
  2. archiveGroup — set archivedAt to the current timestamp on each inactive group
  3. notifyGroupMembers — send push notifications to all members of each archived group

Retry policy: maximumAttempts: 3, initialInterval: 30s, backoffCoefficient: 2

Timeout: workflowRunTimeout: 30m, activityStartToCloseTimeout: 60s


DeleteGroupWorkflow

Planned — not yet live.

Cleans up all member records and sends notifications after an owner initiates group deletion. Triggered when DELETE /groups/{groupId} sets deletedAt on the group document.

Trigger: deletedAt field set on groups/{groupId} (via DELETE /groups/{groupId} endpoint)

Activities:

  1. removeAllMembers — delete all documents in groups/{groupId}/members/ and the corresponding users/{userId}/groups/{groupId} records for each member
  2. cancelPendingRequests — delete all documents in groups/{groupId}/requests/
  3. notifyRemovedMembers — send push notifications to all removed members informing them the group was deleted
  4. detachGroupRides — update all rides with groupId = {groupId} to set groupId: null and type: "private", making them standalone private rides
  5. deleteGroupDocument — hard-delete the groups/{groupId} document and all remaining subcollections

Retry policy: maximumAttempts: 3, initialInterval: 30s, backoffCoefficient: 2

Timeout: workflowRunTimeout: 15m, activityStartToCloseTimeout: 60s