
Core Plugins and tasks PurgeStorage
CertifiedPurge execution files from the internal storage by last-modified date.
Core Plugins and tasks PurgeStorage
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.
type: io.kestra.plugin.core.storage.PurgeStorageExamples
Delete execution storage files older than 7 days for a namespace.
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
endDate *Requiredstring
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.
dryRun booleanstring
trueIf true, only report what would be deleted without deleting anything.
flowId string
The flow ID to be purged.
Requires namespace to also be set.
namespace string
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.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
startDate string
Only purge files last modified after this date.
Outputs
deletedFilesCount integer
0Number of storage objects deleted (always 0 when dryRun is true).
purgedCount integer
0Number of executions with at least one file in the date window (preserved when dryRun is true).
scannedCount integer
0Number of execution storage subtrees scanned.
Metrics
deleted.files counter
Number of storage objects deleted (always 0 when dryRun is true).
purged counter
Number of execution storage subtrees matched (preview when dryRun is true).
scanned counter
Number of execution storage subtrees scanned.