Blueprints

Trigger a sub Flow

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: company.team
    flowId: subflow
    inputs:
      data: "{{ 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
inputs:
  - id: data
    type: STRING

tasks:
  - id: task_b
    type: io.kestra.plugin.core.debug.Return
    format: "{{ task.id }} - subflow - {{ inputs.data }}"

The flow will trigger this subflow in the task flow_b.

Return

Subflow

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra