Kestra Plugin PurgeAssets

Kestra Plugin PurgeAssets

Certified

Purges assets from the catalog based on retention policies

By default, the task purges assets, asset usage events (execution view), and asset lineage events (for asset exporters) matching the filters. You can configure it to only purge specific types of records. Asset lineage event purging currently does not support filtering by asset ID, type or metadata. Asset usage event purging currently does not support filtering by asset type or metadata.

yaml
type: io.kestra.plugin.kestra.ee.assets.PurgeAssets

Purge old staging tables

yaml
id: purge_staging_assets
namespace: company.data

tasks:
  - id: cleanup_staging
    type: io.kestra.plugin.kestra.ee.assets.PurgeAssets
    namespace: company.data
    assetType:
      - io.kestra.plugin.ee.assets.Table
    metadata:
      model_layer: staging
    endDate: "{{ now() | dateAdd(-90, 'DAYS') }}"

Scheduled retention policy

yaml
id: asset_retention_policy
namespace: company.infra

triggers:
  - id: monthly_cleanup
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "0 0 1 * *"

tasks:
  - id: purge_old_vms
    type: io.kestra.plugin.kestra.ee.assets.PurgeAssets
    assetType:
      - io.kestra.plugin.ee.assets.VM
    endDate: "{{ now() | dateAdd(-180, 'DAYS') }}"
Properties

Purge assets created or updated before this date (ISO 8601)

Filter assets by id

SubTypestring

Filter by asset types

Select API authentication

Use either an API token or HTTP Basic (username/password); do not provide both.

Definitions
apiTokenstring

API token for bearer auth

autobooleanstring
Defaulttrue

Automatically retrieve credentials from Kestra's configuration if available

The default configuration can be configured globally inside the Kestra configuration file:

  • Set kestra.tasks.sdk.authentication.api-token to use an API token
  • Set kestra.tasks.sdk.authentication.username and kestra.tasks.sdk.authentication.password for HTTP basic authentication The Enterprise edition also provides setting a default configuration at the Namespace of Tenant level by an administrator.
passwordstring

Password for HTTP Basic auth

usernamestring

Username for HTTP Basic auth

Override Kestra API endpoint

URL used for calls to the Kestra API. When null, renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.

Metadata filters

Definitions
fieldstring
typestring
Possible Values
EQUAL_TONOT_EQUAL_TO
valuestring

Filter assets by namespace

Exact match or prefix with .*

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

Defaulttrue

Whether to purge asset lineage events (for asset exporters) matching the filters

Defaulttrue

Whether to purge asset usage events (execution view) matching the filters

Defaulttrue

Whether to purge assets matching the filters

Override target tenant

Tenant identifier applied to API calls; defaults to the current execution tenant.

Number of asset lineages purged

Number of asset usages purged

Number of assets purged