Source
yaml
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 }}"
About this blueprint
Trigger
This blueprint shows how to trigger a (sub)flow from another flow. It's a great pattern to reuse common flows. Thanks to inputs you can parameter your flows and reuse them easily.
You can create this subflow first:
yaml
id: 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 }}"
The flow will trigger this subflow in the task flow_b
.
More Related Blueprints