Log icon
Flow icon
ExecutionFlow icon

Executes flow on flow trigger with ExecutionFlow condition

Trigger Kestra flows automatically when a specific upstream flow reaches a given state. Build event-driven dependencies with the ExecutionFlow condition.

Categories
Core
id: flow-condition-executionflow
namespace: company.team

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: task of the triggered flow

triggers:
  - id: flow_trigger
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionFlow
        flowId: system_flow
        namespace: system.prod
    states:
      - RUNNING

Build event-driven dependencies between workflows so a downstream flow runs automatically the moment a specific upstream flow reaches a chosen execution state. This blueprint wires a Flow trigger to the ExecutionFlow condition, letting you orchestrate cross-flow pipelines without polling, manual handoffs, or brittle time-based scheduling. Instead of guessing when an upstream job will finish, you react to its real execution events and keep dependent flows tightly coupled to the source of truth.

How it works

  1. The downstream flow defines a trigger flow_trigger of type io.kestra.plugin.core.trigger.Flow, which listens to execution events from other flows on the Kestra instance.
  2. The trigger attaches an io.kestra.plugin.core.condition.ExecutionFlow condition scoped to a specific upstream flow with flowId: system_flow and namespace: system.prod.
  3. The states attribute is set to RUNNING, so the trigger fires when the upstream system_flow execution enters that state.
  4. Once the condition matches, this flow executes its single hello task of type io.kestra.plugin.core.log.Log, which writes a log message confirming the triggered run.

What you get

  • Automatic, event-driven execution of a dependent flow with no polling loops.
  • A clear, declarative dependency between two flows in plain YAML.
  • Precise control over which upstream flow and which state trigger the run.
  • A minimal, working template you can drop your real tasks into.

Who it's for

  • Data and platform engineers building multi-flow pipelines with upstream/downstream dependencies.
  • Teams replacing fragile cron offsets with real execution-event coupling.
  • Anyone who needs flow B to react the instant flow A reaches a given state.

Why orchestrate this with Kestra

Kestra treats flow executions as first-class events, so dependent flows react to real state changes rather than estimated timing. You get declarative YAML definitions, built-in retries and error handling, and full execution lineage across coupled flows in one place. A standalone scheduler can start a job at a fixed time, but it cannot natively listen for another workflow reaching a specific state and chain the next flow off that event. The ExecutionFlow condition closes that gap with event-driven, dependency-aware orchestration.

Prerequisites

  • A running Kestra instance.
  • An upstream flow system_flow in the system.prod namespace whose executions you want to react to.

Secrets

  • None. This blueprint uses only core logging and trigger tasks and references no secret() values.

Quick start

  1. Add this flow to your Kestra instance.
  2. Ensure the upstream flow system_flow exists in namespace system.prod.
  3. Trigger or run system_flow and let it enter the RUNNING state.
  4. Confirm this flow executes automatically and the hello task logs its message.

How to extend

  • Point flowId and namespace at your own upstream flow.
  • Change states to SUCCESS, FAILED, or other states to react to different outcomes.
  • Replace the hello Log task with your real downstream tasks.
  • Add more conditions to the trigger to refine exactly when the flow fires.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.