New to Kestra?
Use blueprints to kickstart your first workflows.
Trigger a Kestra flow when two upstream flows complete successfully within a time window. Build event-driven, dependency-aware pipelines with flow triggers.
id: flow-downstream
namespace: company.team
triggers:
- id: multiple_listen_flow
type: io.kestra.plugin.core.trigger.Flow
dependsOn:
- flowId: flow_a
namespace: company.team
states:
- SUCCESS
- flowId: flow_b
namespace: company.team
states:
- SUCCESS
window:
lookback: P1D
tasks:
- id: task_c
type: io.kestra.plugin.core.debug.Return
format: "{{ task.id }}"
This blueprint wires up a downstream flow that runs automatically once two upstream flows, flow_a and flow_b, both finish successfully inside a rolling 24-hour window. It solves the classic fan-in dependency problem: when a final step (a report, a load, an aggregation) must wait for several independent pipelines to complete, you should not hardcode brittle schedules and hope they line up. Instead, this flow listens for completion events and fires the moment all conditions are met, giving you reliable cross-flow orchestration without polling or guesswork.
The flow is intentionally minimal so the trigger logic stays front and center.
task_c of type io.kestra.plugin.core.debug.Return echoes the task id as a placeholder for your real downstream logic.multiple_listen_flow of type io.kestra.plugin.core.trigger.Flow listens to executions across the instance.dependsOn list has two entries, each pinned to a specific upstream flow with flowId: flow_a and flowId: flow_b in the company.team namespace, and each requiring states: [SUCCESS].window.lookback: P1D (a 24-hour evaluation window) means the downstream flow fires only when both upstream flows have succeeded inside that rolling day.A flow's own scheduler can only fire on time, not on the completion of other flows. Kestra flow triggers react to real execution events, so the downstream flow runs exactly when its upstream dependencies finish rather than on a guessed clock offset. You get declarative YAML, built-in retries, full execution lineage across flows, and a dependsOn list paired with a window.lookback that captures multi-flow completion. That cross-flow, event-based dependency is the specific gap a single flow's cron schedule cannot fill.
flow_a and flow_b in the company.team namespace.This blueprint references no secrets.
company.team namespace.flow_a and flow_b exist in the same namespace.SUCCESS.task_c runs automatically once both succeed inside the 24-hour window.task_c with your real workload (a transform, a load, a notification).dependsOn (each with its own flowId) to wait on additional flows.window.lookback to widen or shift the evaluation period.dependsOn entries at flows in other namespaces to coordinate across teams.