yaml
type: "io.kestra.plugin.core.trigger.flow"
Examples
yaml
id: transform
namespace: company.team
inputs:
- id: date
type: STRING
defaults: "2025-01-01"
variables:
result: |
Ingestion done in {{ trigger.executionId }}.
Now transforming data up to {{ inputs.date }}
tasks:
- id: run_transform
type: io.kestra.plugin.core.debug.Return
format: "{{ render(vars.result) }}"
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ render(vars.result) }}"
triggers:
- id: run_after_extract
type: io.kestra.plugin.core.trigger.Flow
inputs:
date: "{{ trigger.outputs.date }}"
preconditions:
id: flows
flows:
- namespace: company.team
flowId: extract
states: [SUCCESS]
yaml
id: silver_layer
namespace: company.team
tasks:
- id: transform_data
type: io.kestra.plugin.core.log.Log
message: deduplication, cleaning, and minor aggregations
triggers:
- id: flow_trigger
type: io.kestra.plugin.core.trigger.Flow
preconditions:
id: bronze_layer
timeWindow:
type: DAILY_TIME_DEADLINE
deadline: "09:00:00"
flows:
- namespace: company.team
flowId: bronze_layer
states: [SUCCESS]
yaml
id: alert
namespace: system
tasks:
- id: send_alert
type: io.kestra.plugin.notifications.slack.SlackExecution
url: "{{secret('SLACK_WEBHOOK')}}" # format: https://hooks.slack.com/services/xzy/xyz/xyz
channel: "#general"
executionId: "{{trigger.executionId}}"
triggers:
- id: alert_on_failure
type: io.kestra.plugin.core.trigger.Flow
states:
- FAILED
- WARNING
preconditions:
id: company_namespace
where:
- id: company
filters:
- field: NAMESPACE
type: STARTS_WITH
value: company
yaml
id: sentry_execution_example
namespace: company.team
tasks:
- id: send_alert
type: io.kestra.plugin.notifications.sentry.SentryExecution
executionId: "{{ trigger.executionId }}"
transaction: "/execution/id/{{ trigger.executionId }}"
dsn: "{{ secret('SENTRY_DSN') }}"
level: ERROR
triggers:
- id: failed_prod_workflows
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatus
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespace
namespace: company.payroll
prefix: false
Properties
conditions Non-dynamicDateTimeBetweenDayWeekDayWeekInMonthExecutionFlowExecutionLabelsExecutionNamespaceExecutionOutputsExecutionStatusExpressionFlowConditionFlowNamespaceConditionHasRetryAttemptMultipleConditionNotOrPublicHolidayTimeBetweenWeekend
inputs Non-dynamicobject
preconditions Non-dynamicFlow-Preconditions
states Non-dynamicarray
SubType string
Default
[
"SUCCESS",
"WARNING",
"FAILED",
"KILLED",
"CANCELLED",
"RETRIED",
"SKIPPED",
"PAUSED"
]
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
stopAfter Non-dynamicarray
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
Outputs
executionId *Requiredstring
executionLabels *Requiredobject
flowId *Requiredstring
flowRevision *Requiredinteger
namespace *Requiredstring
state *Requiredstring
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
outputs object
Definitions
io.kestra.core.models.triggers.TimeWindow
deadline string
Format
partial-time
endTime string
Format
partial-time
startTime string
Format
partial-time
type string
Default
DURATION_WINDOW
Possible Values
DAILY_TIME_DEADLINE
DAILY_TIME_WINDOW
DURATION_WINDOW
SLIDING_WINDOW
window string
Format
duration
windowAdvance string
Format
duration
Condition for a specific flow of an execution.
flowId *Requiredstring
namespace *Requiredstring
type *Requiredobject
Condition for a flow namespace.
namespace *Requiredstring
type *Requiredobject
prefix boolean
Default
false
Condition for a specific flow. Note that this condition is deprecated, use `io.kestra.plugin.core.condition.ExecutionFlow` instead.
flowId *Requiredstring
namespace *Requiredstring
type *Requiredobject
Condition to allow events between two specific times.
type *Requiredobject
after string
Format
time
before string
Format
time
date string
Default
{{ trigger.date }}
io.kestra.plugin.core.trigger.Flow-ExecutionFilter
Condition that checks labels of an execution.
labels *Requiredarrayobject
type *Requiredobject
Condition based on the outputs of an upstream execution.
expression *Requiredbooleanstring
type *Requiredobject
Condition to allow events on weekend.
type *Requiredobject
date string
Default
{{ trigger.date }}
io.kestra.plugin.core.trigger.Flow-UpstreamFlow
namespace *Requiredstring
flowId string
labels object
states array
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
io.kestra.plugin.core.trigger.Flow-Preconditions
id *Requiredstring
Validation RegExp
^[a-zA-Z0-9][a-zA-Z0-9_-]*
Min length
1
resetOnSuccess boolean
Default
true
timeWindow TimeWindow
Default
{
"type": "DURATION_WINDOW"
}
Condition to have at least one condition validated.
Condition for an execution namespace.
namespace *Requiredstring
type *Requiredobject
comparison string
Possible Values
EQUALS
PREFIX
SUFFIX
prefix booleanstring
Default
false
Run a flow if the list of preconditions is met in a time window.
id *Requiredstring
Validation RegExp
^[a-zA-Z0-9][a-zA-Z0-9_-]*
Min length
1
type *Requiredobject
resetOnSuccess boolean
Default
true
timeWindow TimeWindow
Default
{
"type": "DURATION_WINDOW"
}
Condition to exclude other conditions.
Condition to execute tasks on a specific day of the week relative to the current month (first, last, ...)
dayInMonth *Requiredstring
Possible Values
FIRST
LAST
SECOND
THIRD
FOURTH
dayOfWeek *Requiredstring
Possible Values
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
type *Requiredobject
date string
Default
{{ trigger.date }}
Condition based on variable expression.
expression *Requiredstring
type *Requiredobject
Condition to allow events on a particular day of the week.
dayOfWeek *Requiredstring
Possible Values
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
type *Requiredobject
date string
Default
{{ trigger.date }}
Condition based on execution status.
type *Requiredobject
in array
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
notIn array
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
Condition to allow events between two specific datetime values.
type *Requiredobject
after string
Format
date-time
before string
Format
date-time
date string
Default
{{ trigger.date }}
io.kestra.plugin.core.trigger.Flow-Filter
field *Requiredstring
Possible Values
FLOW_ID
NAMESPACE
STATE
EXPRESSION
type *Requiredstring
Possible Values
EQUAL_TO
NOT_EQUAL_TO
IN
NOT_IN
IS_TRUE
IS_FALSE
IS_NULL
IS_NOT_NULL
STARTS_WITH
ENDS_WITH
REGEX
CONTAINS
value string
values array
SubType string
Condition that matches if any taskRun has retry attempts.
type *Requiredobject
in array
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
notIn array
SubType string
Possible Values
CREATED
RUNNING
PAUSED
RESTARTED
KILLING
SUCCESS
WARNING
FAILED
KILLED
CANCELLED
QUEUED
RETRYING
RETRIED
SKIPPED
BREAKPOINT
Condition to allow events on public holidays.
type *Requiredobject
country string
date string
Default
{{ trigger.date }}