🚀 New! Kestra raises $3 million to grow Learn more

Home / Solutions / Blueprints

Create a Python subflow, acting like an abstracted component

Plugins Used in this Blueprints

About this blueprint

Create a Python subflow, acting like an abstracted component

This Flow shows how you can create a templated flow (subflow) to run a custom script.

This flow can used in another flow, actin like a separated component. We can imagine having a complex flow, with many tasks but abstracted with inputs and outputs, so users can only deal with a simple interface. Here is an example of calling this flow, giving inputs and retrieve the desired outputs.

id: call_python_component
namespace: dev
tasks:
  - id: python
    type: io.kestra.core.tasks.flows.Flow
    namespace: dev
    flowId: python_subflow_component
    wait: true
    inputs:
      arg1: 5
      arg2: 3
    outputs:
      result: '{{ outputs.python.vars.result }}'

New to Kestra?

Use blueprints to kickstart your first workflows.