Purge
type: "io.kestra.core.tasks.storages.Purge"
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.
Examples
Purge all flow execution data for flows ended more than one month ago.
id: "purge"
type: "io.kestra.core.tasks.storages.Purge"
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
states:
- KILLED
- FAILED
- WARNING
- SUCCESS
Properties
endDate
- Type: string
- Dynamic: ✔️
- Required: ❌
The max date to purge
All data of flows executed before this date will be purged.
flowId
- Type: string
- Dynamic: ✔️
- Required: ❌
The flow id to purge
You need to provide the namespace
properties if you want to purge a flow.
namespace
- Type: string
- Dynamic: ✔️
- Required: ❌
Namespace to purge or namespace for a flow
If flowId
isn't provided, this is a namespace prefix, else the namespace of the flow.
purgeExecution
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
true
Purge executions from the repository.
purgeLog
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
true
Purge logs from the repository.
purgeMetric
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
true
Purge metrics from the repository.
purgeStorage
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
true
Purge files from the internal storage.
states
- Type: array
- SubType: string
- Dynamic: ❌
- Required: ❌
The state of the execution that can be purged.
Outputs
executionsCount
- Type: integer
- Default:
0
The count of executions deleted
logsCount
- Type: integer
- Default:
0
The count of logs deleted
storagesCount
- Type: integer
- Default:
0
The count of storage deleted