Execute multiple asynchronous sub-workflows in parallel using n8n webhooks and synchronously wait for all tasks to complete using a robust n8n node loop pattern. Ideal for long-running processes.
Download this n8n workflow template and start using it instantly.
Automation developers needing to execute long-running tasks concurrently within n8n.
Users looking for advanced n8n templates for robust flow control and synchronization.
Technical teams building reliable, scalable backend processes with n8n.
Anyone needing to implement a "wait for all" logic across separate n8n workflow executions.
This advanced n8n workflow demonstrates a critical design pattern for managing asynchronous, parallel execution of tasks. When you have a list of items that require significant processing time (e.g., generating reports, massive data transformation), running them sequentially is inefficient. This specialized n8n workflow pattern utilizes a parent-child relationship where the parent simultaneously kicks off multiple independent sub-workflows (via webhook calls) and then enters a sophisticated waiting loop, anchored by the Webhook Callback Wait n8n node. This ensures the parent execution only proceeds after receiving confirmation (via resume webhook callbacks) from all initiated sub-workflows. This n8n workflow template is essential for building highly concurrent and resilient automation systems within n8n.
Code n8n node to simulate multiple data items requiring parallel processing. A Set n8n node initializes the crucial state variable finishedSet (an empty array) to track completed tasks.Split In Batches n8n node iterates over the simulated items. For each item, an HTTP Request n8n node calls the webhook endpoint of the separate sub-workflow execution, passing the item ID and, critically, the parent workflow's unique resume URL ($execution.resumeUrl) as a callback header.Webhook n8n trigger, immediately responds to prevent the parent's HTTP Request from blocking, and then simulates the required processing time.HTTP Request n8n node to hit the parent workflow's specific resume webhook URL (obtained from the callbackurl header), signaling its completion and passing the finished item ID.If All Finished condition. If synchronization is not complete, it pauses at the designated Webhook Callback Wait n8n node. Upon being resumed by a sub-workflow callback, a Code n8n node updates the finishedSet array with the newly finished item ID. The process then loops back to the If All Finished node to re-check the count.finishedSet matches the total number of items originally dispatched does the parent n8n workflow continue to the final step.Webhook node labeled 'Webhook' at path parallel-subworkflow-target and the following nodes) must be copied and pasted into a separate, new n8n workflow. Activate this sub-workflow.WEBHOOK_URL environment variable in your n8n instance configuration. This URL must be the base URL where the child workflow's public webhook endpoint can be reached. If self-hosting, ensure this points to the correct internal service or domain. Manual Trigger: When clicking ‘Test workflow’. Serves as the initial n8n trigger to start the parent execution.
Code Node: Simulate Multi-Item for Parallel Processing. Generates an array of three items (requestIds) to simulate the tasks requiring parallel execution.
Split In Batches Node: Loop Over Items. Manages the iteration, ensuring the HTTP Request n8n node is executed for every item.
Set Node: Initialize finishedSet. Creates the initial state variable finishedSet as an empty array, crucial for tracking synchronization status in the n8n workflow.
HTTP Request Node: Start Sub-Workflow via Webhook. This n8n node initiates the parallel sub-workflow executions. Key Configuration: Passes the parent's unique $execution.resumeUrl in the callbackurl header.
If Node: If All Finished. This core synchronization n8n node checks if the count of finished items equals the count of original items, controlling whether the flow pauses or proceeds.
Wait Node: Webhook Callback Wait. Pauses the parent n8n workflow execution until a specific external webhook call hits its unique resume endpoint. This acts as the synchronization barrier.
Code Node: Update finishedSet. Upon resumption, this n8n node uses JavaScript to safely update and append the newly finished finishedItemId from the webhook payload to the state tracked in the finishedSet array.
Webhook Node (Sub-Workflow): Acts as the external n8n trigger (parallel-subworkflow-target) for the parallel task execution instances.
HTTP Request Node (Sub-Workflow): Call Resume on Parent Workflow. Executes the crucial callback by hitting the parent workflow's resume URL. It uses retry settings (retryOnFail: true, waitBetweenTries: 3000ms) to mitigate potential race conditions if multiple sub-tasks finish simultaneously and try to resume the parent n8n workflow.
Master advanced n8n workflow design using the Wait n8n node and resumeUrl callback method. Manage long-running, asynchronous tasks across independent n8n executions seamlessly.

Automate patient check-in using this powerful n8n workflow. It validates data, verifies email, generates QR health cards, stores them in Google Drive, logs data to Google Sheets, and sends confirmation via Gmail and Slack. Download this n8n templates for healthcare.

Automate WooCommerce product creation using n8n. Read Google Sheets, generate descriptions and images with GPT-4 and DALL-E, and publish via this advanced n8n workflow.

Build an advanced RAG system using this n8n workflow. Scrape Paul Graham essays, embed them with OpenAI, store data in Milvus, and enable conversational Q&A via an n8n chat trigger.

Automate YooKassa payments, order tracking, and transaction logging using this robust n8n workflow. This template simplifies e-commerce operations with no-code Google Sheets integration.


Software developer specializing in "back-end plumbing" to connect and sync data between large corporate systems, enabling application distribution/migration, scaling, and containerization. Using n8n for various orchestration tasks both at home and "on the job."







































