Implement a persistent Round Robin load balancer in your n8n workflow. This n8n template uses a Data Table and a Switch node to distribute tasks evenly across multiple routes.
Download this n8n workflow template and start using it instantly.
This specialized n8n workflow addresses the challenge of scaling high-volume automation tasks by implementing a custom, persistent load-balancing mechanism. While n8n naturally handles parallel execution, this setup ensures strict, sequential, round-robin distribution across defined worker routes (Route 1, 2, 3). By using an n8n Data Table to persist the "Last Used" worker index, the n8n workflow reliably determines the next destination for the incoming job. This core logic flow control pattern is essential for separating resource-intensive operations into smaller, dedicated sub-workflows, enhancing stability and throughput. This advanced n8n template demonstrates powerful state management within n8n, ensuring fairness in task distribution.
LastUsed index, indicating which worker route was utilized in the previous execution.LastUsed value (1, 2, or 3), ensuring persistence across subsequent n8n workflow executions.Round Robin Router Switch n8n node evaluates the calculated Last_Used value and routes the execution data to the corresponding branch (Route 1, Route 2, or Route 3), completing the round-robin cycle. These route n8n nodes should be replaced with calls to actual worker sub-workflows.Load Balancer with at least two columns: id (string) and LastUsed (number).Load Balancer table. Set id to 1 and set LastUsed to 0 (or the starting route number).Route 1, Route 2, and Route 3 No Op n8n nodes with Execute Workflow n8n nodes pointing to your actual worker sub-workflows or the full process logic you wish to distribute. When clicking ‘Execute workflow’ (Manual Trigger): The initial n8n trigger used for testing. For production, replace this n8n node with a Webhook or Schedule n8n trigger.
Calculate the next route to use (Data Table node): Functioned to retrieve the current state (LastUsed) from the Data Table before the core logic executes. Key operation: Get.
Code in JavaScript (Code node): Implements the sequential round-robin calculation: newValue = currentValue === 3 ? 0 : currentValue + 1;. This ensures cycling between indices 1, 2, and 3.
Update lastused in the datatable (Data Table node): Writes the calculated next index back to the Data Table using the Update operation, ensuring persistence for the next execution of this n8n workflow.
Merge trigger data to pass to subworkflow if needed (Merge node): Merges the original incoming data from the n8n trigger with the metadata calculated by the Code n8n node, ensuring the subsequent steps have all necessary information.
Round Robin Router (Switch node): The primary flow control n8n node. It checks the value of {{ $json.Last_Used }} and routes the execution to one of three corresponding outputs (1, 2, or 3).
Use this n8n workflow to automatically fetch your YouTube subscriber count hourly and display it instantly on an AWTRIX smart clock or dashboard. This n8n template is essential for creators.

Automate ServiceNow incident lookups directly from Slack using an n8n workflow. Instantly retrieve incident details and status using a simple Slack slash command.

Automate conference research using this advanced n8n workflow. Scrape agendas, identify high-priority speakers, and plan your networking strategy with AI-driven insights and custom n8n nodes.

Schedule and automate Docker Registry cleanup using this powerful n8n workflow. Automatically remove old image tags and execute crucial garbage collection commands via SSH.

Automate doctor appointments, online payments (Stripe), reminders, and cancellations using a conversational AI built with a robust n8n workflow. Integrate WhatsApp and Google Sheets for seamless management.

Deploy a robust doctor appointment scheduler using this n8n workflow. It leverages Telegram for instant chat, Google Gemini for transcription, and Google Sheets for availability tracking and booking, all managed by a powerful n8n node agent.

Business process improvement and continuous improvement SME. Process automation advocate.







































