
Core Plugins and tasks PurgeExecutions
CertifiedPurge executions, logs, metrics, and storage files.
Core Plugins and tasks PurgeExecutions
Purge executions, logs, metrics, and storage files.
Deletes historical execution data by namespace/flow, bounded by startDate/endDate, and optionally filtered by states. Each category can be toggled (purgeExecution, purgeLog, purgeMetric, purgeStorage).
Respects Namespace authorization checks (there must be purge rights on the target namespace); default batch size is 100. Irreversible — use carefully in production.
type: io.kestra.plugin.core.execution.PurgeExecutionsExamples
Purge all flow execution data for flows that ended more than one month ago.
id: purgeexecutions
type: io.kestra.plugin.core.execution.PurgeExecutions
id: purge_exections
namespace: system
tasks:
- id: purge
type: io.kestra.plugin.core.execution.PurgeExecutions
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
states:
- KILLED
- FAILED
- WARNING
- SUCCESS
Properties
endDate *Requiredstring
The date before which data should be purged.
All data of flows executed before this date will be purged.
batchSize integerstring
100The size of the bulk delete
For performance, deletion is made by batch of by default 100 executions/logs/metrics.
flowId string
The flow ID to be purged
You need to provide the namespace properties if you want to purge a flow.
namespace string
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.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
purgeExecution booleanstring
trueFlag specifying whether to purge executions
purgeLog booleanstring
trueFlag specifying whether to purge execution logs
This will only purge logs from executions, not from triggers, and it will do it execution by execution.
The io.kestra.plugin.core.log.PurgeLogs task is a better fit to purge, as it will purge logs in bulk and will also purge logs not tied to an execution like trigger logs.
purgeMetric booleanstring
trueFlag specifying whether to purge execution's metrics.
purgeStorage booleanstring
trueFlag specifying whether to purge execution's files from the Kestra's internal storage
startDate string
The date after which data should be purged
All data of flows executed after this date will be purged.
states array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDThe state of the executions to be purged
If not set, executions for any states will be purged.
Outputs
executionsCount integer
0The count of deleted executions
logsCount integer
0The count of deleted logs
metricsCount integer
0The count of deleted metrics
storagesCount integer
0The count of deleted storage files