New to Kestra?
Use blueprints to kickstart your first workflows.
Run a Kestra subflow from a parent flow with typed inputs and outputs. Build modular, reusable orchestration with clean parent-child execution.
id: trigger-subflow
namespace: company.team
tasks:
- id: task_a
type: io.kestra.plugin.core.debug.Return
format: "{{ task.id }} - flow_a"
- id: flow_b
type: io.kestra.plugin.core.flow.Subflow
description: This task triggers the flow `subflow` with corresponding inputs.
namespace: "{{ flow.namespace}}"
flowId: my_subflow
inputs:
my_input: "{{ outputs.task_a.value }}"
Trigger a Kestra subflow from a parent flow to compose larger pipelines out of small, reusable units. This blueprint shows the parent-child execution pattern: the parent computes a value, then calls a child flow by flowId and namespace, passing typed inputs and consuming the child's outputs downstream. It is the foundation for modular orchestration, shared utilities, fan-out patterns, and clean separation between business logic and infrastructure tasks.
task_a, an io.kestra.plugin.core.debug.Return task that produces a value ("task_a - flow_a") and exposes it as outputs.task_a.value.flow_b, an io.kestra.plugin.core.flow.Subflow task that calls the child flow my_subflow in the same namespace via "{{ flow.namespace }}".inputs.my_input bound to "{{ outputs.task_a.value }}", so the child sees the parent's output as a typed input.io.kestra.plugin.core.flow.Subflow."{{ flow.namespace }}" so the pair stays portable.Subflows in Kestra are first-class executions: each child run has its own ID, logs, retries, labels, and lineage, and is visible in the UI as a separate execution linked to its parent. You get declarative YAML, event and schedule triggers on either flow, per-task retries, and full observability across the parent-child boundary, something ad hoc function calls or inlined scripts cannot give you. It also lets independent teams own and version their subflows separately while still being callable from any parent pipeline.
This blueprint does not reference any secrets. Add {{ secret('NAME') }} references if you extend the subflow to call external systems.
my_subflow in the same namespace (for example company.team) with a STRING input my_input and any tasks you want to reuse.trigger-subflow.Example child flow:
id: my_subflow
namespace: company.team
inputs:
- id: my_input
type: STRING
tasks:
- id: task_b
type: io.kestra.plugin.core.debug.Return
format: "{{ task.id }} - subflow - {{ inputs.my_input }}"
outputs to the subflow and consume them in the parent via outputs.flow_b.outputs.<name>.wait: false on the Subflow task to fire-and-forget the child.ForEach in the parent to fan out the subflow over a list of inputs in parallel.namespace explicitly.