Distribute workflow execution with round-robin logic using data tables

Distribute workflow execution with round-robin logic using data tables

RevOps & Data
n8n
Adrian Kendall's template keeps the counter in a Data Table, so the rotation carries on after a restart instead of starting over.
Source
n8n
Tools
n8n Data Table, Switch node
Runs
On any trigger
Cost
Free template
Last updated
August 7, 2026

What it is.

A Data Table stores the last route used. A Code node increments the counter and cycles it back to the start, and a Switch node sends the execution down the matching path.

The routes arrive as placeholder nodes you replace with your own sub-workflow calls or API triggers. Merge logic preserves the original input, so whatever triggered it survives the routing step.

What you get.

  • A persistent counter in a Data Table, so the rotation continues after a restart.
  • A Switch-based router with placeholder routes you swap for your own.
  • Merge logic that keeps the triggering data intact through the routing step.
  • A pattern that works with any trigger type, including a webhook or a schedule.
HOW TO USE IT

How to set it up.

1

Create the Data Table with the last-used field before importing, since every run reads it.

2

Set the cycle length in the Code node to match your number of reps or destinations.

3

Replace each placeholder route with a sub-workflow call or an API request to your CRM.

4

Check the merge step keeps your lead payload, because a router that loses the record is worse than none.

5

Trigger it a dozen times by hand and confirm the rotation is even before it touches a live lead.

6

Add a fallback route for the case where the Data Table read fails.

Use cases

Rotate leads across a team

Keep the counter in a Data Table so the rotation survives a restart.

Add a rep without a rebuild

Extend the router with the placeholder branches already wired.

Prove the split is even

Read the counter when someone claims they get fewer leads.

Best for

Even lead assignment

Rotating inbound demos across reps without buying a routing product.

Rate-limited destinations

Spreading calls across several accounts or API keys so no single one gets throttled.

Any workflow needing a memory

The persistent-counter pattern is reusable well beyond lead routing.

Open the original.

Hosted on n8n, free to open.
Open the Tool

Questions about Distribute workflow execution with round-robin logic using data tables

Does it work on its own?
How many routes does it come with?
Does it know who's available?

Questions about RevOps & Data

Is round-robin the right way to assign leads?
What breaks lead routing most often?
Strengths
  • The counter lives in a Data Table, so the rotation is not lost when the instance restarts.
  • It works with any trigger, which makes it a component instead of a finished workflow.
  • Merge logic keeps the input payload, which homemade routers usually drop.
Limitations
  • It is a routing component, so on its own it delivers nothing until you wire your own routes in.
  • Even rotation ignores capacity, so a rep on holiday still gets their turn unless you add a check.
  • It comes with three placeholder routes, so more destinations means editing the Code node cycle.
Skip this if
  • Skip it if your CRM already round-robins and the counter survives a restart.
Ideal for
  • RevOps leads
  • Automation builders
  • Stage: Any stage

Want this running without building it yourself?

TripleDart has scaled 300+ tech companies with expert operators and AI workflows behind every play.