Parallel Sub-Workflow Execution with Webhook Wait
detail.loadingPreview
Starts multiple sub-workflows in parallel and waits for all of them to complete using webhooks.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This workflow demonstrates how to initiate multiple sub-workflows asynchronously and then wait for all of them to finish before proceeding. It utilizes webhooks for sub-workflows to signal their completion back to the main workflow. The main workflow maintains a count of completed sub-workflows and uses a webhook wait node to pseudo-synchronously wait for all tasks to finish.
Key Features
- Initiates multiple sub-workflows concurrently.
- Uses HTTP requests to trigger sub-workflows.
- Leverages webhooks to receive completion signals from sub-workflows.
- Implements a mechanism to track the completion of all sub-workflows.
- Employs a webhook wait node to pause the parent workflow until all sub-tasks are done.
- Includes robust error handling and retry mechanisms for webhook callbacks.
How To Use
-
Main Workflow Setup:
- Configure the
Simulate Multi-Item for Parallel Processingnode to define the number of sub-workflows to start. - Set up the
Start Sub-Workflow via Webhooknode with the correct URL for your sub-workflow endpoint and the callback URL pointing to the parent workflow's resume URL. - Ensure the
Initialize finishedSetnode correctly initializes thefinishedSetarray. - Configure the
If All Finishednode to compare the count of finished items with the total number of initiated sub-workflows. - The
Webhook Callback Waitnode will wait for incoming webhook requests from the sub-workflows. - The
Update finishedSetnode adds the ID of the completed sub-workflow to thefinishedSet. - The
Acknowledge Finishednode sends a confirmation back to the sub-workflow.
- Configure the
-
**Sub-Workflow Setup (Separate Workflow):
- The sub-workflow should start with a
Webhooknode to receive the initial trigger from the parent workflow. - It should perform its intended task.
- Use a
Respond to Webhooknode to send back thefinishedItemId. - Use a
Call Resume on Parent Workflownode to trigger the parent workflow's resume URL, passing thefinishedItemId. - Ensure the
Waitnode is configured to wait for the response from the parent workflow if necessary, or remove it if the sub-workflow doesn't need to wait for a direct response. - Important: The
BASE_URLenvironment variable needs to be correctly configured in your n8n instance to point to the appropriate service for webhook callbacks.
- The sub-workflow should start with a
Apps Used
Workflow JSON
{
"id": "2c030e18-d32a-4724-9cfc-2cff4a8524f5",
"name": "Parallel Sub-Workflow Execution with Webhook Wait",
"nodes": 0,
"category": "Wait",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 2c030e18-d32a...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Wait Node Workflow Template
Template demonstrating the use of the Wait node for asynchronous process synchronization.
Community Contributed Template (Unverified) - Wait
A template for community-contributed items that are currently unverified and require a waiting period.
Wait For Message To Settle
Waits for a message to be the last in a buffer for a set duration before proceeding.
Wait Node Example
Demonstrates the use of the Wait node to introduce delays in an n8n workflow.
Wait Workflow
This workflow uses a wait node to pause execution for a specified duration.