Core Plugins and tasks PurgeStorage

Core Plugins and tasks PurgeStorage

Certified

Purge execution files from the internal storage by last-modified date.

Irreversible. Always start with dryRun: true and review the counters before re-running with dryRun: false.

When using per-namespace dedicated storage (EE), this task must be configured for each namespace to be able to clean the dedicated storage.

Deletes execution files whose last-modified timestamp falls between startDate and endDate. The primary use case is reclaiming files left behind by flows that no longer exist — files that PurgeExecutions cannot reach because there is no execution record to delete.

namespace matching is recursive: namespace: io.kestra also purges sub-namespaces such as io.kestra.team. Omit namespace to purge across every namespace under the tenant. A sub-namespace configured with its own dedicated storage is not reached by recursion — target it explicitly.

Set endDate to (or before) your PurgeExecutions retention window so that only files belonging to already-purged executions are deleted.

yaml
type: io.kestra.plugin.core.storage.PurgeStorage

Delete execution storage files older than 7 days for a namespace.

yaml
id: purge_storage
namespace: system

tasks:
  - id: purge
    type: io.kestra.plugin.core.storage.PurgeStorage
    namespace: company.team
    endDate: "{{ now() | dateAdd(-7, 'DAYS') }}"
    dryRun: false
Properties

Only purge files last modified before this date.

Set this to (or before) your PurgeExecutions retention window so only files of already-purged executions are deleted.

Defaulttrue

If true, only report what would be deleted without deleting anything.

The flow ID to be purged.

Requires namespace to also be set.

Namespace whose execution storage files should be purged.

Recursive: sub-namespaces are also purged (e.g. io.kestra reaches io.kestra.team), except sub-namespaces with their own dedicated storage, which must be targeted explicitly. Omit to purge across every namespace under the tenant.

Reference (ref) of the pluginDefaults to apply to this task.

Only purge files last modified after this date.

Default0

Number of storage objects deleted (always 0 when dryRun is true).

Default0

Number of executions with at least one file in the date window (preserved when dryRun is true).

Default0

Number of execution storage subtrees scanned.

Number of storage objects deleted (always 0 when dryRun is true).

Number of execution storage subtrees matched (preview when dryRun is true).

Number of execution storage subtrees scanned.