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

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
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