Anchorage API reference
    Preparing search index...
    • Data-retention purge: deletes TERMINAL runs (success/failed/tripwire/ canceled/bailed/skipped and cleanup-complete cancelled/timed_out) whose updatedAt is older than the TTL from mastra_workflow_snapshot — and, when artifactStore is wired, each purged run's R2 artifacts with its row, plus (when their tables are wired) the run's ownership row and its spent start reservation, each in the SAME transaction as the snapshot delete. Live runs (running/suspended/waiting/ pending/paused) are never touched — expiring a suspended run would kill a pending approval. A missing snapshot table reads as zero purgeable runs (Mastra creates it lazily with the first persisted run). TTL enforcement is a storage-layer property, so it lives here; alarm scheduling stays with the caller. Returns the number of deleted rows.

      Returns Promise<number>