Kestra Plugin FreshnessTrigger

Kestra Plugin FreshnessTrigger

Certified

Trigger on Kestra asset freshness

Polls Kestra EE data assets and fires an execution when an asset has not been updated within the configured maximum staleness.

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

Data Quality Monitoring: Ensure your daily ETL pipelines run successfully by monitoring when critical tables were last updated.

yaml
id: stale_data_alert
namespace: company.monitoring

triggers:
  - id: check_trips_freshness
    type: io.kestra.plugin.kestra.ee.assets.FreshnessTrigger
    assetId: trips
    namespace: company.team
    maxStaleness: PT26H  # Allow 2 extra hours buffer
    checkInterval: PT1H

tasks:
  - id: send_alert
    type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {
        "text": "⚠️ Asset `{{ trigger.assets[0].id }}` is stale. Last updated: {{ trigger.assets[0].lastUpdated }}"
      }

SLA Enforcement: Contractual SLAs require mart tables to be updated every 4 hours during business hours.

yaml
id: sla_enforcement
namespace: company.data

triggers:
  - id: mart_freshness_check
    type: io.kestra.plugin.kestra.ee.assets.FreshnessTrigger
    assetType: io.kestra.plugin.ee.assets.Table
    namespace: company.data
    metadataQuery:
      - field: model_layer
        type: EQUAL_TO
        value: mart
    maxStaleness: PT4H
    checkInterval: PT30M

tasks:
  - id: trigger_refresh
    type: io.kestra.plugin.core.flow.Subflow
    namespace: company.data
    flowId: refresh_mart_tables
    inputs:
      table_id: "{{ trigger.assets[0].id }}"

Multi-Region Freshness Monitoring: Monitor production assets across multiple regions, excluding archived or test assets, focusing on critical items.

yaml
id: multi_region_freshness
namespace: company.monitoring

triggers:
 - id: regional_freshness_check
   type: io.kestra.plugin.kestra.ee.assets.FreshnessTrigger
   assetType: io.kestra.plugin.ee.assets.Table
   maxStaleness: PT12H
   checkInterval: PT1H
   metadataQuery:
     - field: environment
       type: EQUAL_TO
       value: prod
     - field: config.region
       type: IS_ONE_OF
       value: [us-east-1, us-west-2, eu-west-1]
     - field: status
       type: IS_NOT_ONE_OF
       value: [archived, test]
     - field: description
       type: CONTAINS
       value: critical

tasks:
 - id: alert_stale_regional_assets
   type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
   url: "{{ secret('OPS_WEBHOOK') }}"
   payload: |
     {
       "text": "⚠️ Regional asset `{{ trigger.assets[0].id }}` in {{ trigger.assets[0].metadata['config.region'] }} is stale"
     }
Properties

Maximum allowed time since last update (e.g., PT24H, P1D)

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Asset id to monitor

Asset type to filter by

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
  • Set kestra.tasks.sdk.authentication.url to also default the Kestra API endpoint (see kestraUrl above) The Enterprise edition also provides setting a default configuration at the Namespace or Tenant level by an administrator. Set to false to also opt out of the default URL, and to call a Kestra API that requires no authentication when no credentials are set either.
passwordstring

Password for HTTP Basic auth

usernamestring

Username for HTTP Basic auth

DefaultPT1H
Formatduration

How often the trigger should check for stale assets. Default is 1 hour

Override Kestra API endpoint

URL used for calls to the Kestra API. When null, falls back to the url configured alongside the default SDK authentication (Namespace or Tenant level, Enterprise edition), then renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.

Metadata field queries to filter assets by

Definitions
fieldstring
typestring
Possible Values
EQUAL_TONOT_EQUAL_TO
valuestring

Namespace to filter assets by

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Override target tenant

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

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

List of stale assets

Definitions
checkTimestring
Formatdate-time
descriptionstring
displayNamestring
idstring
Validation RegExp^[a-zA-Z0-9][a-zA-Z0-9._:-]*
Min length1
Max length150
metadataobject
namespacestring
Validation RegExp^[a-z0-9][a-z0-9._-]*
Min length1
Max length150
staleDurationstring
Formatduration
typestring
Min length1