๐Ÿ‡ฌ๐Ÿ‡ง EN
๐Ÿ‡ฎ๐Ÿ‡น IT

๐ŸŽฒ Random

Generates a random integer within a range, or selects a random item from a list. Useful for A/B testing, random routing, sampling, and load distribution.

Category: Flow Control  ยท  Type identifier: random

Overview

The Random node introduces controlled non-determinism into your workflows. You can use it in two modes:

The result is available as a variable and can be passed to a Switch node to route execution based on which variant was selected, or used directly in a template.

Configuration

Field Status Description
Mode Required number โ€” generate a random integer; choice โ€” pick one item from a defined list.
Min Conditional Required when Mode is number. The minimum value (inclusive). Supports {{ variable }} references.
Max Conditional Required when Mode is number. The maximum value (inclusive). Must be greater than or equal to Min. Supports {{ variable }} references.
Choices Conditional Required when Mode is choice. An array of values to select from. Each entry can be a static string, number, or a {{ variable }} reference. All items have equal probability.
Seed Optional A fixed integer seed for the random number generator. When set, the same seed always produces the same result. Useful for testing workflows reproducibly without changing the node configuration.

Output Data

Variable Type Description
value integer or string The generated number (in number mode) or the selected item (in choice mode).
mode string The mode that was used: "number" or "choice".
index integer In choice mode: the zero-based position of the selected item in the Choices list. Always null in number mode.
// Access random outputs (replace "random_step" with your step key) {{ random_step.output.value }} {{ random_step.output.mode }} {{ random_step.output.index }}

Example Usage

A/B test โ€” route users to one of two variants

  1. Add a Random node (step key: ab_picker). Set Mode to choice and add two choices: variant_a and variant_b.
  2. Add a Switch node after it. Set the Expression to:
    {{ ab_picker.output.value }}
    Add cases variant_a and variant_b.
  3. Connect each Switch branch to the appropriate email template or action node. Each user run will randomly receive one variant.

Generate a random verification code

Mode: number Min: 100000 Max: 999999 // Use the result in a Send Email node Your verification code is: {{ verify_code.output.value }}

Tips & Notes

Related Nodes