Anchorage API reference
    Preparing search index...

    Function purgeExpiredScheduleTriggers

    • Schedule-trigger TTL cleanup: deletes terminal trigger-history rows from mastra_schedule_triggers once their actualFireAt is older than the TTL, at the storage layer so alarm maintenance reaps them without a live tick — the same posture as the other purges (raw D1 binding, failure-isolated duty).

      actualFireAt is stored as INTEGER ms-epoch (core types ScheduleTrigger.actualFireAt as number, unlike the ISO-TEXT timestamp columns the other domains use), so the comparison is a NUMERIC < against a numeric cutoff — a correct timestamp comparison over integers. A missing table reads as zero (schedules may never have fired). Scheduling stays with the caller. Deferred rows are live dispatch/reconciliation state and are never TTL-purged; their eventual settlement also finalizes any pending schedule deletion.

      Returns Promise<number>