Build a reusable subflow
In this tutorial, you will move a repeated transformation into a subflow, define its interface, and use it from a parent flow.Before you begin
Create or choose a workflow with a small sequence you expect to reuse. A good example is normalizing a text value before other steps process it.1. Create the subflow
1
Add a subflow
Create a new subflow and give it a name that describes its outcome, such as Normalize request text.
2
Define the input
Add a Flow Input block and configure a text input named
request.3
Add the reusable logic
Add the blocks that transform or validate the input. Keep the subflow focused on one responsibility.
4
Define the output
Add a Flow Output block named
normalizedRequest and connect the final value.2. Call it from the parent flow
- Return to the parent flow.
- Add a Subflow block.
- Select Normalize request text.
- Connect the parent value to
request. - Connect
normalizedRequestto the next parent block.
3. Test the interface
Run the parent flow with:- A normal value
- Empty or missing text
- Unexpected whitespace or formatting
- A value at the expected maximum size
Design guidance
- Give inputs and outputs business-meaningful names.
- Keep one clear responsibility per subflow.
- Avoid hidden dependencies on parent-flow state.
- Document expected input types and failure behavior.
- Retest parent workflows after changing a shared subflow.