Skip to content

Round Robin Task

Overview

The Round Robin Task cycles sequentially through a list of values, returning the next item each time it runs. Unlike random selection, it guarantees fair, even distribution by remembering its position and rotating through all options systematically.

When to use this task:

  • Fair lead distribution to sales team
  • Rotate through multiple workers or queues
  • Cycle time slots or appointment windows
  • Team rotation for on-call duty
  • Campaign variant rotation
  • Load balancing across endpoints
  • Scheduled resource allocation

Key Features:

  • Sequential, deterministic cycling
  • State persistence (remembers position)
  • Automatic wrapping to start
  • Fair distribution guaranteed
  • Database-backed position tracking
  • Works with any list type

The task remembers its position between runs and rotates. That is the difference from Random, which can return the same value several times in a row:

flowchart LR
    A[Alice] --> B[Bob]
    B --> C[Carol]
    C --> A

Quick Start

1. Add Round Robin task
2. Enter comma-separated list
3. Task cycles through list in order
4. Automatically wraps to first item
5. Save

Configuration

Builder fields

The Field column is the label as it appears in the task builder; Key is the name the value is stored under and referenced by.

Field Key Type Default Notes
List list text –

List of Values

Values: rep1@company.com, rep2@company.com, rep3@company.com
Values: Queue A, Queue B, Queue C, Queue D
Values: Monday, Tuesday, Wednesday, Thursday, Friday

Format:

  • Comma-separated values
  • Any data type (emails, names, IDs, URLs)
  • Position persists across executions
  • Cycles back to start automatically

How Cycling Works

List: A, B, C

Execution 1 → Returns: A (position 0)
Execution 2 → Returns: B (position 1)
Execution 3 → Returns: C (position 2)
Execution 4 → Returns: A (position 0, wrapped)
Execution 5 → Returns: B (position 1)
...

Position stored in database, survives restarts.

Output Fields

Field Description Example
task_30001_run Success status true
task_30001_run_text Message showing selection Selected: rep2@company.com
task_30001_response The selected value rep2@company.com

Real-World Examples

Share new leads evenly across a sales team

Form Submission
  └─ Round Robin         "thabo@example.com,jane@example.com,sam@example.com"
      └─ Email           notify {{task_30001_response}}

The task remembers its position between runs, so lead 1 goes to Thabo, lead 2 to Jane, lead 3 to Sam, lead 4 back to Thabo. No agent gets two in a row.

Rotate a duty roster

Schedule (weekly)
  └─ Round Robin   "Monday team,Tuesday team,Wednesday team"
      └─ SMS       remind {{task_30001_response}} they are on duty

Because the position is remembered, a weekly schedule walks the list one step per week rather than restarting.

Best Practices

List Design

  1. Equal capacity items - All options should handle similar load
  2. Active items only - Remove unavailable options promptly
  3. Reasonable size - 3-10 items typical, more for specific cases
  4. Update carefully - Changing list resets position
  5. Document rotation - Track who/what is in rotation

Fair Distribution

  1. One task per workflow - Multiple round robins create separate rotations
  2. Consistent execution - Run same workflow for fair distribution
  3. Monitor balance - Check if distribution is even
  4. Handle failures - Failed assignments still increment position
  5. Reset when needed - Contact admin to reset position if needed

Performance

  1. Database-backed - Position stored reliably
  2. Fast execution - Minimal overhead
  3. Concurrent safe - Database handles simultaneous requests
  4. State survives restarts - Position persists across system restarts

vs Random Task

Use Round Robin when:

  • Fair distribution required
  • Need to guarantee everyone gets turn
  • Predictable cycling needed
  • Balanced load important

Use Random when:

  • True randomness needed
  • A/B testing
  • No fairness requirement
  • Independent selections

Troubleshooting

Same Value Returned Multiple Times

Issue: Not cycling properly

Causes:

  • Multiple separate workflows using round robin
  • Different task configurations
  • Database position not updating

Solution:

  • Use single workflow for consistent rotation
  • Check task configuration is identical
  • Verify database connectivity

Skipped Values

Issue: Some list items never selected

Cause: List was modified while task running

Solution:

  • Don't modify list during active use
  • Position may become misaligned with new list
  • Contact admin to reset position if needed

Position Not Persisting

Issue: Always returns first item

Cause: Database write failure or task misconfiguration

Solution:

  • Check database connection
  • Verify task has unique ID
  • Review system logs for errors

Uneven Distribution

Issue: Some team members get more leads

Causes:

  • Multiple entry points to workflow
  • Manual assignments mixed with automation
  • Recent list changes

Solution:

  • Consolidate to single workflow
  • Use round robin exclusively (no manual overrides)
  • Monitor distribution with reporting

Need to Reset Position

Issue: Want to start from beginning

Solution:

  • Contact system administrator
  • Position stored in task_mapping table
  • Can be manually reset if needed

Frequently Asked Questions

Can I reset the position?

Not directly in the workflow. Contact administrator to reset position in database.

What happens if I change the list?

Position continues from current index. If new list is shorter, position may wrap immediately.

Can I see current position?

No direct output. Position managed internally. Monitor by logging selections.

Does it work with empty lists?

No, list must have at least one item.

Can I weight the distribution?

Not directly. Repeat values in list to simulate weighting:

# 60% Rep1, 40% Rep2
Values: rep1, rep1, rep1, rep2, rep2

What if a list item is unavailable?

Task still returns that item and increments. Handle unavailability in subsequent If task or webhook.

Can multiple workflows share position?

No, each task instance maintains its own position.


  • Random - For non-deterministic selection
  • Key Match - Map selected value to actions
  • Loop - Process items in list
  • Variable - Store selected value for reuse
  • If Task - Conditional logic based on selection