Skip to content

Random Task

Overview

The Random Task randomly selects one value from a comma-separated list. Each execution picks a different item, making it perfect for A/B testing, load balancing, random assignments, and dynamic content delivery.

When to use this task:

  • A/B test variants (emails, landing pages, offers)
  • Randomly distribute leads or workload
  • Show different promotional content
  • Random assignment for fairness
  • Load balance across multiple resources
  • Gamification and rewards
  • Testing scenarios

Key Features:

  • Pure random selection
  • Uniform probability distribution
  • Unlimited list items
  • Variable support in list values
  • Single-step execution
  • Works with any data type

Quick Start

1. Add Random task
2. Enter comma-separated list
3. Each value has equal probability
4. 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: Option A, Option B, Option C
Values: user1@company.com, user2@company.com, user3@company.com
Values: https://example.com/page-a, https://example.com/page-b
Values: Red, Blue, Green, Yellow, Purple

Format:

  • Comma-separated values
  • Any data type (text, numbers, emails, URLs, IDs)
  • Supports variables: {{task_15001_email}}, backup@company.com
  • Whitespace around commas is preserved

Example Configurations

Two options (50/50):

Values: Version A, Version B

Three options (33.3% each):

Values: Group 1, Group 2, Group 3

Weighted simulation (repeat values):

Values: Common, Common, Common, Rare
# "Common" has 75% chance, "Rare" has 25% chance

Dynamic values:

Values: {{task_15001_primary_rep}}, {{task_15001_backup_rep}}, default@company.com

Output Fields

Field Description Example
task_12001_run Always true if list provided true
task_12001_run_text Message showing selected value Randomly selected: Option B
task_12001_response The randomly selected value Option B

Real-World Examples

Pick a subject line for an A/B test

Schedule
  └─ Random     "Exclusive offer inside,Transform your business in 30 days"
      └─ Email  Subject: {{task_12001_response}}

Each run picks one of the two values. Over many sends the split is roughly even.

Assign an enquiry to a random agent

Form Submission
  └─ Random              "thabo@example.com,jane@example.com,sam@example.com"
      └─ Workflow Note   assign the follow-up to {{task_12001_response}}

Random is not the same as fair

Random can return the same value several times in a row. If you need an even spread across a team, use Round Robin instead.

Best Practices

List Design

  1. Equal probability - Each item has 1/N chance
  2. Simulate weighting - Repeat values to increase probability
  3. Use descriptive values - Clear, meaningful options
  4. Keep lists manageable - 2-10 items typical, more for specific use cases
  5. Validate all options - Ensure every value is valid/usable

Use Cases

Good for:

  • A/B testing (2-4 variants)
  • Fair distribution (team members, queues)
  • Dynamic content (images, messages, offers)
  • Load balancing (servers, workers)
  • Gamification (rewards, challenges)

Not ideal for:

  • Ordered cycling (use Round Robin Type 30)
  • Weighted selection (simulate by repeating values)
  • Deterministic selection (use If or Key Match)
  • State-dependent selection (use Code task)

Testing

  1. Test all values - Ensure each option works correctly
  2. Run multiple times - Verify randomness distribution
  3. Log selections - Track which values are chosen for analysis
  4. Monitor outcomes - Measure performance of each variant
  5. Iterate - Adjust list based on results

Variable Usage

# Dynamic lists from previous tasks
Values: {{task_43001_row.rep_email}}, {{task_43001_row.backup_email}}

# Mix static and dynamic
Values: {{task_15001_primary}}, default@company.com

# Use in conditionals
If {{task_12001_response}} = "Option A" then...

Troubleshooting

Same Value Selected Multiple Times

Issue: Getting the same result repeatedly

Cause: Normal random behavior - not guaranteed to cycle

Solution:

  • This is expected with random selection
  • Use Round Robin for guaranteed cycling
  • Each execution is independent

Empty or Invalid Result

Issue: No value returned

Causes:

  • Empty list provided
  • Single comma with no values
  • List not properly formatted

Solution:

# ❌ Wrong
Values:

# ❌ Wrong
Values: ,

# ✓ Correct
Values: Option A, Option B

# ✓ Correct (single value)
Values: Only Option

Unwanted Whitespace

Issue: Values have extra spaces

Cause: Spaces around commas are preserved

Solution:

# May have trailing space
Values: Option A , Option B

# Clean (no spaces)
Values: Option A,Option B

# Or use Find Replace task to clean

Probability Not Equal

Issue: Some values seem more common

Cause:

  • Small sample size (random clusters)
  • Confirmation bias

Solution:

  • Run many iterations (100+) to see true distribution
  • Log results to database for analysis
  • All values have mathematically equal probability

Variable Not Replaced

Issue: {{variable}} appears in output

Cause: Variable doesn't exist or is empty

Solution:

  • Verify previous task ran successfully
  • Check variable name spelling
  • Use Coalesce task for fallbacks

Frequently Asked Questions

How random is it?

Uses JavaScript's Math.random() - suitable for A/B testing and distribution, but not cryptographically secure.

Can I weight the probabilities?

Not directly. Simulate by repeating values:

# 75% Option A, 25% Option B
Values: Option A, Option A, Option A, Option B

Does it remember previous selections?

No, each execution is independent. Use Round Robin for cycling through options.

Can I use with arrays or objects?

No, only comma-separated strings. Use Code task to handle complex data structures.

What's the maximum list size?

No hard limit, but keep practical (2-100 items). Very large lists may impact readability.

Can I exclude recently selected values?

No. Random has no memory of previous runs. If you need an even spread rather than a random one, use Round Robin, which remembers its position.

Will each option be used equally over time?

Over many iterations, yes (law of large numbers). But in small samples, clustering is normal.


  • Round Robin - Sequential cycling instead of random
  • If Task - Conditional logic based on random result
  • Key Match - Map random result to specific values
  • Loop - Apply random selection to multiple items
  • Variable - Store random result for reuse