Example of Parallel Sub-Workflow Initiation and Synchronized Waiting
This workflow demonstrates how to effectively manage the asynchronous parallel initiation of multiple sub-workflows and achieve pseudo-synchronous waiting through a webhook callback mechanism. Users can initiate multiple tasks simultaneously and proceed with subsequent operations only after all subtasks are completed, thus avoiding the blocking and complex management issues found in traditional processes. It is suitable for scenarios such as large-scale data processing, asynchronous system call waiting, and automated integration, enhancing work efficiency and process stability.

Workflow Name
Example of Parallel Sub-Workflow Initiation and Synchronized Waiting
Key Features and Highlights
This workflow demonstrates how to asynchronously initiate multiple sub-workflows in parallel using n8n, and pseudo-synchronously wait for all sub-workflows to complete before proceeding with subsequent steps in the main workflow via a webhook callback mechanism. The core highlight lies in leveraging webhook callbacks as signals for task completion, enabling effective management and status tracking of parallel tasks within the main workflow.
Core Problem Addressed
In automation processes, it is often necessary to start multiple subtasks (sub-workflows) simultaneously and wait for all of them to finish before moving on to the next step. Traditional approaches tend to cause process blocking or complex management. This workflow solves the challenges of status synchronization and flow control during concurrent execution of multiple sub-workflows by combining asynchronous initiation with webhook callbacks.
Application Scenarios
- Parallel execution of tasks by splitting large-scale data processing into multiple sub-processes
- Business processes that require waiting for multiple asynchronous external system calls to complete before continuing
- Automation integrations involving parallel execution of multiple steps and aggregation of results
- Implementation of complex approval, task distribution, and merging business logic
Main Process Steps
- Simulate Multiple Task Generation: Generate multiple simulated request items (requestId) using a code node.
- Loop and Initialize Status: Split tasks into batches and initialize the collection of completed tasks.
- Asynchronously Trigger Sub-Workflows: Use HTTP Request nodes to call sub-workflows’ webhook URLs, passing the current task ID and callback URL.
- Sub-Workflow Execution and Callback: Upon completion, sub-workflows invoke the callback webhook to notify the main workflow of task completion.
- Update Completion Collection: The main workflow receives callbacks and updates the set of completed tasks.
- Check if All Tasks Are Completed: Use a conditional node to determine whether all subtasks have finished.
- Proceed with Main Flow or Wait for Callbacks: If all tasks are completed, continue the workflow; otherwise, enter a webhook wait state to pseudo-synchronously wait for remaining tasks.
Systems or Services Involved
- n8n Workflow: Coordination between main and sub-workflows
- Webhook: Enables sub-workflow callback notifications and asynchronous flow control
- HTTP Request: Triggers sub-workflow execution and callback invocations
- Code Node: Generates simulated data and manages the completion status array
Target Audience and Value
- Automation engineers and process designers who need to manage complex parallel tasks
- Developers building efficient and scalable asynchronous business workflows
- Enterprise IT teams driving digital transformation and enhancing automation levels
- Users aiming to leverage n8n for parallel task execution and result synchronization
This workflow provides a mature solution for asynchronous parallel task scheduling and synchronized waiting, significantly improving process efficiency and stability in multi-task automation scenarios. Combined with n8n’s powerful node composition capabilities, users can flexibly extend and adapt it to various business requirements.