Blueprints

Pass data between subflows — use outputs from the child flow in a parent flow

Source

yaml
id: pass-data-between-subflows
namespace: company.team

tasks:
  - id: call_child_flow
    type: io.kestra.plugin.core.flow.Subflow
    namespace: company.team
    flowId: child_flow
    wait: true

  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "{{ outputs.call_child_flow.outputs.data_from_child_flow }}"

About this blueprint

Outputs

First, create a child flow:

yaml
tasks:
  - id: return_data
    type: io.kestra.plugin.core.debug.Return
    format: this is a secret message returned from {{ flow.id }}
    
outputs:
  - id: data_from_child_flow
    type: STRING
    value: "{{ outputs.return_data.value }}" 

Then, you can run this parent flow that will retrieve data from the subflow and store it under a specified key. In this example, the subflow uses the key data_from_child_flow.

Subflow

Log

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra