Embeds existing workflows within your current workflow, creating modular and reusable automation components with full context sharing.
The invokeWorkflow function allows you to embed existing workflows within your current workflow, creating modular and reusable automation components. This powerful feature enables you to break down complex processes into smaller, manageable workflows that can be combined and reused across different scenarios.
Execute existing workflows inline within your current workflow, enabling modular design, code reuse, and sophisticated workflow composition while maintaining full context access and security boundaries.
Step Flattening: When you invoke a workflow, its steps are flattened and executed inline within your parent workflow. The invoked workflow has access to the full context of the parent workflow, including previous step outputs, global variables, and conversation context.
The specified workflow is executed inline as part of your current workflow
Steps from the invoked workflow become available at the top level of your workflow context
Invoked workflows have complete access to parent workflow context and variables
Break complex workflows into smaller, focused components that can be maintained and updated independently
Create common workflow patterns once and reuse them across multiple workflows
Updates to invoked workflows automatically apply to all parent workflows that use them
End users only need permissions for your main workflow - they don't need access to the invoked workflows
| Parameter | Type | Required | Description |
|---|---|---|---|
| workflow_id | string | The slug/identifier of the workflow you want to invoke |
Workflow ID Format: Use the workflow slug (e.g., 'customer-validation-workflow') exactly as it appears in the Vibes interface. The workflow must exist and you must have access to it.
Understanding permission requirements is crucial for successful workflow invocation:
You must have access to the workflow you're invoking. If you don't have permissions, the function will throw an error when executed.
Users only need permissions to access your main workflow. They don't need direct access to the invoked workflows.
Simple workflow that prompts for a database table and then queries it:
Using conditionals to invoke different workflows based on context:
Create complex processing pipelines by invoking multiple workflows in sequence:
Business process that validates customer information before proceeding with onboarding:
Complex document analysis workflow that chains multiple specialized workflows:
Invoked workflows have comprehensive access to the parent workflow's context and can share data seamlessly:
Global variables set in the parent workflow are available to invoked workflows:
When a workflow is invoked, its steps become available at the top level of your workflow context:
Understanding common error scenarios helps with debugging and proper workflow design:
When you don't have access to the workflow you're trying to invoke
Solution: Verify you can manually access the workflow in the Vibes interface and check workflow slug spelling
When the specified workflow doesn't exist or has been renamed/deleted
Solution: Ensure the workflow exists, hasn't been deleted, and the slug is spelled correctly
When you can't access steps from an invoked workflow in subsequent steps
Solution: Verify the step ID exists in the invoked workflow and that the workflow completed successfully
Implementing fallback workflows when primary workflows fail:
Use clear, descriptive workflow IDs that indicate their purpose and maintain consistency across your organization.
Design your invoked workflows to be self-contained and focused on specific tasks for maximum reusability.
Document the expected inputs and outputs of workflows you plan to invoke for better maintainability.
Understand permission boundaries and ensure proper access control for workflow composition.
These functions work well with invokeWorkflow for building sophisticated modular automation systems: