Flow ​Flow

yaml
type: "io.kestra.plugin.core.trigger.flow"
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
SubType string
Default [ "SUCCESS", "WARNING", "FAILED", "KILLED", "CANCELLED", "RETRIED", "SKIPPED", "PAUSED" ]
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
Format partial-time
Format partial-time
Format partial-time
Default DURATION_WINDOW
Possible Values
DAILY_TIME_DEADLINEDAILY_TIME_WINDOWDURATION_WINDOWSLIDING_WINDOW
Format duration
Format duration
Default false
Format time
Format time
Default {{ trigger.date }}
SubType
Min items 1
Min length 1
Default AND
Possible Values
ANDOR
Default {{ trigger.date }}
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
Validation RegExp ^[a-zA-Z0-9][a-zA-Z0-9_-]*
Min length 1
Default true
Default { "type": "DURATION_WINDOW" }
Possible Values
EQUALSPREFIXSUFFIX
Default false
SubType
Validation RegExp ^[a-zA-Z0-9][a-zA-Z0-9_-]*
Min length 1
Default true
Default { "type": "DURATION_WINDOW" }
Possible Values
FIRSTLASTSECONDTHIRDFOURTH
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY
Default {{ trigger.date }}
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY
Default {{ trigger.date }}
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
Format date-time
Format date-time
Default {{ trigger.date }}
Possible Values
FLOW_IDNAMESPACESTATEEXPRESSION
Possible Values
EQUAL_TONOT_EQUAL_TOINNOT_INIS_TRUEIS_FALSEIS_NULLIS_NOT_NULLSTARTS_WITHENDS_WITHREGEXCONTAINS
SubType string
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
SubType string
Possible Values
CREATEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINT
Default {{ trigger.date }}