Core Plugins and tasks PurgeFlows

Core Plugins and tasks PurgeFlows

Certified

Purge old flow revisions.

Deletes old flow revisions using a purge behavior (default keeps 1 latest revision), with optional namespace prefix and flow ID filters.

The latest revision of each flow is always kept.

yaml
type: io.kestra.plugin.core.flow.PurgeFlows

Purge old flow revisions for a namespace tree.

yaml
id: purge_flow_revisions
namespace: system

tasks:
  - id: purge_flows
    type: io.kestra.plugin.core.flow.PurgeFlows
    namespace: company
    behavior:
      keepAmount: 2
Properties
Default{"keepAmount":1}

Purge behavior

Defines how old flow revisions are purged.

Definitions
beforestring

The date before which revisions should be purged.

Must be an ISO-8601 instant, for example 2026-01-01T00: 00: 00Z. Using this filter will never delete the latest revision or the latest non-draft revision of a flow to avoid accidental flow deletion.

keepAmountinteger
Minimum>= 1

How many revisions should be kept for each matching flow.

The latest revision and the latest non-draft revision are always kept.

The flow ID whose old revisions should be purged

You need to provide the namespace property if you want to purge a flow.

Namespace whose flows need to be purged, or namespace of the flow that needs to be purged

If flowId isn't provided, this is a namespace prefix, else the namespace of the flow.

The number of purged flow revisions