Options for DBA.prune().

interface PruneOptions {
    appId: string;
    attributes?: boolean;
    connection: ProviderConfig;
    engineStreams?: boolean;
    engineStreamsExpire?: string;
    entities?: string[];
    expire?: string;
    jobs?: boolean;
    keepHmark?: boolean;
    pruneTransient?: boolean;
    streams?: boolean;
    workerStreams?: boolean;
    workerStreamsExpire?: string;
}

Properties

appId: string

The application identifier (Postgres schema name).

attributes?: boolean

If true, strips execution-artifact attributes from completed, un-pruned jobs. Preserves jdata (return data), udata (searchable data), and jmark (timeline/event history for workflow execution export). See keepHmark for hmark.

false
connection: ProviderConfig

Postgres connection configuration. Uses the same format as all other HotMesh services.

{
class: Postgres,
options: { connectionString: 'postgresql://usr:pwd@localhost:5432/db' }
}
engineStreams?: boolean

Override for engine_streams cleanup. When set, takes precedence over streams for the engine table. Engine streams contain internal routing messages and can be pruned aggressively.

undefined (falls back to streams)

engineStreamsExpire?: string

Retention override for engine_streams. When set, uses this interval instead of the global expire for engine stream cleanup.

undefined (falls back to expire)

'24 hours'
entities?: string[]

Entity allowlist. When provided, only jobs whose entity column matches one of these values are eligible for pruning/stripping. Jobs with entity IS NULL are excluded unless pruneTransient is also true.

undefined (all entities)
expire?: string

Retention period for expired rows. Rows with expired_at older than this interval are hard-deleted. Uses Postgres interval syntax.

'7 days'
'7 days', '24 hours', '30 minutes'
jobs?: boolean

If true, hard-deletes expired jobs older than the retention window. FK CASCADE on jobs_attributes automatically removes associated attribute rows. When entities is set, only matching jobs are deleted.

true
keepHmark?: boolean

If true, hmark attributes are preserved during stripping (along with jdata, udata, and jmark). If false, hmark rows are stripped.

false
pruneTransient?: boolean

If true, hard-deletes expired jobs where entity IS NULL (transient workflow runs). Must also satisfy the retention window (expire).

false
streams?: boolean

If true, hard-deletes expired stream messages older than the retention window from both engine_streams and worker_streams. Use engineStreams / workerStreams for independent control.

true
workerStreams?: boolean

Override for worker_streams cleanup. When set, takes precedence over streams for the worker table. Worker streams contain workflow input arguments and activity payloads needed by the exporter — use a longer retention to preserve export fidelity.

undefined (falls back to streams)

workerStreamsExpire?: string

Retention override for worker_streams. When set, uses this interval instead of the global expire for worker stream cleanup.

undefined (falls back to expire)

'90 days'