All Docs
FeaturesDepositClearUpdated March 14, 2026

Deposit Release Acknowledged Auto-Transition

Deposit Release Acknowledged Auto-Transition

Introduced in v0.1.322

This workflow automates the final step in the deposit release acknowledgement process. Once every required party has acknowledged a proposed release, the system automatically advances the release to acknowledged status — no manual intervention required.


Overview

When a deposit release is proposed, each relevant party receives an acknowledgement request recorded as a depositReleaseAcknowledgement record with status = 'pending'. This workflow monitors those records and transitions the parent depositRelease to acknowledged as soon as all parties have responded.


Triggers

The workflow runs under two conditions:

TriggerDescription
Event-drivenFires immediately when a deposit/release.ack.responded event is received (i.e. a party submits their acknowledgement in real time).
Nightly sweepRuns on a cron schedule at 03:00 UTC every day (0 3 * * *) to catch any releases where all acknowledgements may already be complete but the transition was not yet applied.

Workflow Logic

1. Receive releaseId (from event payload or sweep query)
2. Fetch all depositReleaseAcknowledgements WHERE releaseId = :releaseId
3. IF any record has status = 'pending'
     → Exit. No state change.
4. IF ALL records have status = 'acknowledged'
     → UPDATE depositReleases SET status = 'acknowledged' WHERE id = :releaseId
     → EMIT event: deposit/release.acknowledged
     → INSERT notifications for org admins (success)
     → INSERT auditLog entry

State Transition

depositReleases.status

  proposed
     │
     │  (all acknowledgements received)
     ▼
  acknowledged

The transition only occurs when every depositReleaseAcknowledgement record linked to the releaseId carries status = 'acknowledged'. A single outstanding 'pending' record blocks the transition.


Side Effects

When the transition fires, the following actions occur atomically:

1. Status Update

The depositReleases record for the given releaseId is updated:

status: 'proposed' → 'acknowledged'

2. Downstream Event

The deposit/release.acknowledged event is emitted, allowing other workflows or integrations to react to the completed acknowledgement.

3. Notifications

Success notifications are inserted into the notifications table for all org admins (orgMembers with admin roles) associated with the release's organisation.

4. Audit Log

An entry is written to auditLog recording:

  • The releaseId that transitioned
  • The old and new status values
  • The timestamp of the transition
  • The trigger source (event or nightly sweep)

Affected Entities

EntityOperation
depositReleasesUPDATE — status field
depositReleaseAcknowledgementsSELECT — read all records for a releaseId
notificationsINSERT — success notifications for org admins
auditLogINSERT — transition record
orgMembersSELECT — identify org admins to notify

Notes

  • The nightly sweep at 03:00 UTC acts as a safety net. In normal operation, the event-driven path handles transitions in real time.
  • If a depositRelease is already in acknowledged status when the workflow runs, no duplicate writes occur.
  • Notifications are scoped to org admins only; individual tenants and landlords are not directly notified via this workflow (downstream events may trigger separate notifications).