Execute Workflow
The Execute Workflow activity allows you to run another workflow from within the current workflow. This enables modular workflow design, letting you reuse existing logic and simplify complex processes.
By nesting workflows, you can break down automation into smaller, reusable units — each performing specific tasks — while maintaining data flow between them.
Overview
This activity helps in:
- Modularity: Breaking large workflows into smaller, manageable components.
- Reusability: Reusing the same sub-workflows across multiple parent workflows.
- Maintainability: Reducing duplication and simplifying updates across related workflows.
When executed, the designated workflow (child workflow) starts and receives data from the parent workflow. Once the child workflow completes, it returns output data back to the parent workflow for further processing.
Run the Specified Workflow
Workflows executed from within another workflow behave similarly to those triggered by a webhook. When initiated, data from the primary (parent) workflow becomes accessible in the child workflow through the {{payload}} object.
Configuration
Inputs
This activity accepts two inputs:
-
Workflow to Execute
- Required: Yes
- Description: Select the target (child) workflow to run. Only Published and Scheduled workflows can be executed.
-
Payload
- Required: Yes
- Description: The data object to pass to the child workflow. It can include any combination of payload values, variables, or API results from the parent workflow.
Example Input:
{
"workflow": "OrderProcessingWorkflow",
"payload": {
"order_id": 12345,
"customer_email": "[email protected]",
"amount": 250.75
}
}
Example Use Cases
- Executing a sub-workflow to handle repeated logic like sending emails or processing payments.
- Running conditional child workflows based on specific payload conditions.
- Performing multi-step processes by chaining workflows sequentially.
Notes
- The child workflow runs asynchronously but returns its result to the parent workflow upon completion.
- Only workflows that are published or scheduled can be executed.
- Ensure the payload structure matches the expected input of the child workflow for smooth data transfer.