All Docs
FeaturesDepositClearUpdated March 14, 2026

Deposit Released Without Archive Watchdog

Deposit Released Without Archive Watchdog

Overview

The Deposit Released Without Archive Watchdog is a scheduled reconciliation workflow that runs daily at 04:00 UTC. It identifies deposit releases that have been finalised but whose tenancy archive never reached a complete state, then alerts org admins so the issue can be investigated and resolved before it becomes a compliance problem.


Trigger

PropertyValue
Schedule0 4 * * * (daily, 04:00 UTC)
TypeReconciliation
Version0.1.327

Logic

Step 1 — Identify stale released deposits

The workflow queries the depositReleases table for records that meet both conditions:

status = 'released'
AND releasedAt < CURRENT_DATE - INTERVAL '10 days'

The 10-day window provides a reasonable buffer for archive jobs that may be slow to complete under normal circumstances, while still catching genuinely stuck cases.

Step 2 — Check the corresponding archive

For each matching depositRelease, the workflow looks up the associated record in tenancyArchives and evaluates its status:

Archive statusOutcome
complete✅ No action taken
pending🚨 Alert fired
error🚨 Alert fired
Not found🚨 Alert fired

Step 3 — Alert and notify

When a problematic archive is detected, the workflow takes two actions:

  1. Admin alert — All org admins (sourced from orgMembers) are notified.
  2. Notification record — A stuck-archive notification is inserted into the notifications table, associated with the affected tenancy.

Entities

EntityAccessPurpose
depositReleasesReadFind released deposits older than 10 days
tenancyArchivesReadVerify archive completion status
tenanciesReadProvide tenancy context for alerts
notificationsWriteInsert stuck-archive notification records
orgMembersReadIdentify org admins to alert

What Admins Should Do

When you receive a stuck-archive alert, you should:

  1. Identify the affected tenancy — The notification will reference the tenancy and deposit release in question.
  2. Check the archive job status — Review the tenancyArchives record for an error message or stuck pending state.
  3. Re-trigger the archive if needed — If the archive job failed, it can be re-queued manually or via the admin interface once the root cause is resolved.
  4. Confirm resolution — The alert will clear once the tenancyArchives record reaches status = 'complete'.

Background

Deposit releases and tenancy archiving are closely coupled processes, but they run independently. A deposit can be marked released before its archive job completes — or the archive job may fail silently after the deposit is released. Without active monitoring, these partially-closed tenancies can accumulate undetected.

This watchdog ensures that no tenancy remains in a limbo state for more than 10 days after its deposit is released, supporting both operational hygiene and compliance with the Renters' Rights Act.