Skip to content

feat: add workflow_runs table retention/cleanup #18

Description

@SokratisVidros

Description

There is no mechanism to purge old terminal workflow runs (completed/failed/cancelled) from the workflow_runs table. In a long-running deployment, this table grows unbounded.

pg-boss has its own archive/maintenance for jobs, but workflow_runs is an independent table managed by the engine.

Suggested approach

Add a configurable retention policy, e.g.:

  • A retentionDays option in WorkflowEngineOptions
  • A periodic cleanup that deletes terminal runs older than the retention period
  • Optionally, an engine.purgeRuns() method for manual cleanup

Location

src/engine.ts, src/db/queries.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions