Anchorage API reference
    Preparing search index...

    Interface PurgeExpiredRunsOptions

    interface PurgeExpiredRunsOptions {
        artifactStore?: TenantArtifactPurger;
        limit?: number;
        now?: () => number;
        tablePrefix?: string;
        ttlMs: number;
    }
    Index

    Properties

    artifactStore?: TenantArtifactPurger

    When set, each purged run's R2 artifacts are deleted WITH its snapshot row. Hosts that store artifacts must pass the same store purgeTenant gets: the snapshot row is the only enumerable record of a run's artifact keys (R2 keys lead with workflowId — there is no run-level listing without it), so a retention purge without this pairing strands the run's artifacts beyond even purgeTenant's reach.

    limit?: number

    Runs processed per call. Artifact-paired path: default 100 — the cron's subrequest-budget guard, same batching as the demo-tenant reaper. Each run costs ~2+N subrequests (R2 list, per-artifact deletes, its row's DELETE), so an UNBOUNDED first backlog would blow the Workers per-invocation cap mid-pass and log an error every firing until it drained; size this to your plan's budget instead. Row-only path: default 1000 — one LIMIT-batched DELETE statement per firing, bounding D1 per-query cost instead of subrequests. Both paths use the shrinking eligible set as the cursor — the next firing resumes at the survivors.

    now?: () => number

    Clock override for tests.

    tablePrefix?: string

    Must match createD1Storage's tablePrefix.

    ttlMs: number

    workflowOutputTTL: runs untouched for longer than this are eligible.