FreshnessTrigger
FreshnessTrigger
yaml
type: io.kestra.plugin.kestra.ee.assets.FreshnessTriggerExamples
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.notifications.slack.SlackIncoming
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"text": "⚠️ Asset `{{ trigger.assets[0].id }}` is stale. Last updated: {{ trigger.assets[0].lastUpdated }}"
}
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 }}"
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.notifications.slack.SlackIncoming
url: "{{ secret('OPS_WEBHOOK') }}"
payload: |
{
"text": "⚠️ Regional asset `{{ trigger.assets[0].id }}` in {{ trigger.assets[0].metadata['config.region'] }} is stale"
}
Properties
maxStaleness *Requiredstring
allowConcurrent Non-dynamicboolean
Default
falseassetId string
assetType string
auth Non-dynamic
Definitions
io.kestra.plugin.kestra.AbstractKestraTrigger-Auth
apiTokenstring
autobooleanstring
Default
truepasswordstring
usernamestring
conditions Non-dynamic
Definitions
Allow events only between two datetimes.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DateTimeBetweenio.kestra.core.models.conditions.types.DateTimeBetweenConditionio.kestra.plugin.core.condition.DateTimeBetweenConditionafterstring
beforestring
datestring
Default
{{ trigger.date }}Allow events on a specific weekday.
dayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DayWeekio.kestra.core.models.conditions.types.DayWeekConditionio.kestra.plugin.core.condition.DayWeekConditiondatestring
Default
{{ trigger.date }}Allow events on an nth weekday within the month.
dayInMonth*Requiredstring
Possible Values
FIRSTLASTSECONDTHIRDFOURTHdayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DayWeekInMonthio.kestra.plugin.core.condition.DayWeekInMonthConditionio.kestra.core.models.conditions.types.DayWeekInMonthConditiondatestring
Default
{{ trigger.date }}Match events from a specific flow.
flowId*Requiredstring
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionFlowio.kestra.plugin.core.condition.ExecutionFlowConditionio.kestra.core.models.conditions.types.ExecutionFlowConditionMatch executions by label set.
labels*Requiredarrayobject
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionLabelsio.kestra.core.models.conditions.types.ExecutionLabelsConditionio.kestra.plugin.core.condition.ExecutionLabelsConditionMatch executions by namespace.
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionNamespaceio.kestra.core.models.conditions.types.ExecutionNamespaceConditionio.kestra.plugin.core.condition.ExecutionNamespaceConditioncomparisonstring
Possible Values
EQUALSPREFIXSUFFIXprefixbooleanstring
Default
falseCondition based on the outputs of an upstream execution.
expression*Requiredbooleanstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionOutputsio.kestra.core.models.conditions.types.ExecutionOutputsConditionio.kestra.plugin.core.condition.ExecutionOutputsConditionMatch executions by status.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionStatusio.kestra.core.models.conditions.types.ExecutionStatusConditionio.kestra.plugin.core.condition.ExecutionStatusConditioninarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDCondition based on variable expression.
expression*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Expressionio.kestra.plugin.core.condition.ExpressionConditionio.kestra.core.models.conditions.types.VariableConditionMatch executions where a task was retried.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.HasRetryAttemptio.kestra.plugin.core.condition.HasRetryAttemptConditionio.kestra.core.models.conditions.types.HasRetryAttemptConditioninarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDInvert one or more conditions.
conditions*Required
Min items
1type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Notio.kestra.core.models.conditions.types.NotConditionio.kestra.plugin.core.condition.NotConditionPass when any condition is true.
conditions*Required
Min items
1type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Orio.kestra.core.models.conditions.types.OrConditionio.kestra.plugin.core.condition.OrConditionAllow events on public holidays.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.PublicHolidayio.kestra.plugin.core.condition.PublicHolidayConditionio.kestra.core.models.conditions.types.PublicHolidayConditioncountrystring
datestring
Default
{{ trigger.date}}subDivisionstring
Allow events between two times of day.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.TimeBetweenio.kestra.plugin.core.condition.TimeBetweenConditionio.kestra.core.models.conditions.types.TimeBetweenConditionafterstring
beforestring
datestring
Default
{{ trigger.date }}Allow events on weekends.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Weekendio.kestra.plugin.core.condition.WeekendConditionio.kestra.core.models.conditions.types.WeekendConditiondatestring
Default
{{ trigger.date }}interval Non-dynamicstring
Default
PT1HFormat
durationkestraUrl string
metadataQuery array
Definitions
io.kestra.plugin.kestra.ee.assets.FieldQuery
fieldstring
typestring
Possible Values
EQUAL_TONOT_EQUAL_TOvaluestring
namespace string
stopAfter Non-dynamicarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDtenantId string
Outputs
assets array
Definitions
io.kestra.plugin.kestra.ee.assets.FreshnessTrigger-AssetWithStaleInfo
checkTimestring
Format
date-timedescriptionstring
displayNamestring
idstring
Validation RegExp
^[a-zA-Z0-9][a-zA-Z0-9._-]*Min length
1Max length
150metadataobject
namespacestring
Validation RegExp
^[a-z0-9][a-z0-9._-]*Min length
1Max length
150staleDurationstring
Format
durationtypestring
Min length
1