workflows.fit
Back to n8n workflows
n8n templateFreeBy Adrian Kendall

Distribute workflow execution with round-robin logic using data tables

Key Features Implements a simple round-robin distribution mechanism using a Data Table to track the last route used. Supports multiple downstream workflows or resources, balancing workload across them sequentially. Us...

DevelopmentCore NodesManual TriggerCodeNo OpSwitch
Loading interactive preview...

Template notes

Key Features

Implements a simple round-robin distribution mechanism using a Data Table to track the last route used.

Supports multiple downstream workflows or resources, balancing workload across them sequentially.

Uses Switch and Code nodes for flexible routing logic.

Designed for easy customization — replace placeholder “Route” nodes with sub-workflow calls or API triggers.

Works with any trigger type, and includes merge logic to preserve input data.

Nodes in Use | Node Name | Type | Purpose | |-------------------------------------------------|---------------|--------------------------------------------------------------------------| | When clicking ‘Execute workflow’ | Manual Trigger | Test entry point for manual execution. | | Calculate the next route to use | Data Table | Retrieves the last used route number. | | Code in JavaScript | Code | Increments the route counter (0–3 cycle). | | Update lastused in the datatable | Data Table | Updates the “LastUsed” field to track next route. | | Round Robin Router | Switch | Routes workflow execution to the correct path based on LastUsed value. | | Route 1 / Route 2 / Route 3 | NoOp | Placeholder routes — replace with your own workflows. | | Merge trigger data to pass to subworkflow if needed | Merge | Combines trigger data with routing data for sub-workflows. | | Sticky Notes | Annotations | Explain workflow logic and intended replacements. |

How It Works