PurgeExecutions PurgeExecutions

yaml
type: "io.kestra.plugin.core.execution.PurgeExecutions"

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 that ended more than one month ago.

yaml
id: "purge_executions"
type: "io.kestra.plugin.core.execution.PurgeExecutions"
endDate: "{{ now() | dateAdd(-1, 'MONTHS') }}"
states: 
 - KILLED
 - FAILED
 - WARNING
 - SUCCESS

Properties

endDate

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The maximum date to be purged.

All data of flows executed before this date will be purged.

flowId

  • Type: string
  • Dynamic: ✔️
  • Required:

The flow ID to be purged.

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

namespace

  • Type: string
  • Dynamic: ✔️
  • Required:

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.

purgeExecution

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether to purge executions.

purgeLog

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether to purge execution's 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 logs as it will purge logs in bulk, and will also purge logs not tied to an execution like trigger logs.

purgeMetric

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether to purge execution's metrics.

purgeStorage

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether to purge execution's files from the Kestra's internal storage.

startDate

  • Type: string
  • Dynamic: ✔️
  • Required:

The minimum date to be purged.

All data of flows executed after this date will be purged.

states

  • Type: array
  • SubType: string
  • Dynamic:
  • Required:

The state of the executions to be purged.

If not set, executions for any states will be purged.

Outputs

executionsCount

  • Type: integer
  • Required:
  • Default: 0

The count of deleted executions.

logsCount

  • Type: integer
  • Required:
  • Default: 0

The count of deleted logs.

metricsCount

  • Type: integer
  • Required:
  • Default: 0

The count of deleted metrics.

storagesCount

  • Type: integer
  • Required:
  • Default: 0

The count of deleted storage files.

Definitions

Was this page helpful?