Purge executions, logs, metrics, and storage files.
This task can be used to purge flow executions data for all flows, for a specific namespace, or for a specific flow.
type: "io.kestra.plugin.core.execution.purgeexecutions"Purge all flow execution data for flows that ended more than one month ago.
id: "purgeexecutions"
type: "io.kestra.plugin.core.execution.purgeexecutions"
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
states:
- KILLED
- FAILED
- WARNING
- SUCCESSThe date before which data should be purged.
All data of flows executed before this date will be purged.
100The size of the bulk delete
For performance, deletion is made by batch of by default 100 executions/logs/metrics.
The flow ID to be purged
You need to provide the namespace properties 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.
trueFlag specifying whether to purge executions
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.
trueFlag specifying whether to purge execution's metrics.
trueFlag specifying whether to purge execution's files from the Kestra's internal storage
The date after which data should be purged
All data of flows executed after this date will be purged.
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDThe state of the executions to be purged
If not set, executions for any states will be purged.
0The count of deleted executions
0The count of deleted logs
0The count of deleted metrics
0The count of deleted storage files