Skip to main content

Workflow Retention Policies

If you are using Conductor, you can configure workflow history retention policies for your application from the Retention Policy page of the DBOS Console. These settings let you configure how long workflow history is retained in your application's system database. This is useful for managing the database disk usage of workflow history.

Retention policies only delete the history of completed workflows (workflows with status SUCCESS, ERROR, CANCELLED, or MAX_RECOVERY_ATTEMPTS_EXCEEDED); workflows that are still running, enqueued, delayed, or suspended are never deleted. Deleting a workflow's history also deletes its steps, inputs, outputs, messages, events, and streams, as well as any objects it owns in external storage. Retention runs in the background and deletes history in batches.

If your application archives workflows (see also TypeScript), retention deletes only workflows that have been archived, keeping each workflow until the archiver has copied it. This holds only when retention runs in a process configured with the archive, so configure it in every process of your application.

If multiple applications share a system database, retention policies apply to the entire system database, including workflows owned by other applications. The most restrictive policy configured by any of these applications therefore applies to all of them, so we recommend configuring the same retention policies for every application that shares a system database. If any of these applications archives workflows, configure every one of them with an archive, or retention they run can delete workflows that haven't been archived yet. The global timeout applies only to workflows owned by the application for which it is configured.

Retention Page

Time Threshold​

If a time threshold is set, workflow history is only retained for X hours after a workflow completes. History of workflows that completed more than X hours ago is automatically deleted. Time-based retention is disabled by default.

Rows Threshold​

If the rows threshold is set, history is only retained for the X most recently completed workflows. History of older completed workflows is automatically deleted. Rows-based retention is disabled by default. You can set both a rows threshold and a time threshold.

Global Timeout​

If a global timeout is set, any workflow that has not completed X hours after it was created (started or enqueued) is automatically cancelled. By default, the global timeout is disabled.