Sub-workflow
A guide to using the Sub-Workflow action for modular and reusable workflow design.
The Sub-Workflow Action is a powerful feature for organization and reusability. It allows you to encapsulate a complex series of actions into a single, clean, and reusable component. This is essential for keeping large workflows manageable and for standardizing common processes that are used in multiple places.
Think of it as creating your own custom action, built from a sequence of existing actions.
Key Concepts
Modularity: Break down a massive workflow into smaller, logical, and self-contained parts. Instead of a hundred actions in one graph, you might have a main graph with ten Sub-Workflow actions.
Reusability: Create a common process once (like "Customer Onboarding" or "Generate Social Media Post") and reuse it in different workflows just by dropping in the Sub-Workflow action.
Configuration
Input & Output Mapping
A Sub-Workflow needs a clearly defined way to receive data from the main workflow and send data back.
Input Parameters: In the Sub-Workflow's settings, you define the inputs it expects to receive. For example, a "Customer Onboarding" Sub-Workflow might require a
user_email
anduser_name
.Output Parameters: You also define what data the Sub-Workflow will return to the main flow. For instance, it might output a
crm_contact_id
and aproject_url
.
When you place a Sub-Workflow action in your main graph, its configuration panel will automatically show the input fields you defined, allowing you to map data from previous actions into it. The outputs it produces will be available as variables for subsequent actions.
Example: Standardizing Customer Onboarding
Let's say your customer onboarding process involves three steps: sending a welcome email, adding the user to your CRM, and creating a starter project for them. You do this for users who sign up via your website, and also for leads you add manually.
Instead of building this logic in two different places, you can create a Sub-Workflow.
Create the Sub-Workflow:
Create a new workflow named "Customer Onboarding".
Define its Inputs:
user_email
,user_name
.Define its Outputs:
crm_id
.Inside this workflow, build the logic:
An Email Action that uses
user_email
anduser_name
.An API Action that adds the user to your CRM and outputs the new
crm_id
.Another API Action to create their starter project.
Use the Sub-Workflow Action:
Now, in your "New Website Signup" workflow, add a Sub-Workflow Action.
Select the "Customer Onboarding" workflow you just created.
Map the data from your signup form to the action's inputs:
user_email
:{{form_trigger.email}}
user_name
:{{form_trigger.name}}
The Sub-Workflow will run, and its output,
crm_id
, will be available as{{sub_workflow_action.crm_id}}
for any later steps.You can reuse this exact same action in your "Manual Lead Entry" workflow.
Last updated
Was this helpful?