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
Description
There is no mechanism to purge old terminal workflow runs (completed/failed/cancelled) from the
workflow_runstable. In a long-running deployment, this table grows unbounded.pg-boss has its own archive/maintenance for jobs, but
workflow_runsis an independent table managed by the engine.Suggested approach
Add a configurable retention policy, e.g.:
retentionDaysoption inWorkflowEngineOptionsengine.purgeRuns()method for manual cleanupLocation
src/engine.ts,src/db/queries.ts