Random

Use this step to generate a random number.

Last published at: March 31st, 2026

random Step

Description:

The Random step belongs to the Engine category in FlowWright. Its XML definition identifies the step as random, with the label “Generate a random number” and the display name “random.” It is defined as a Process step using FlowWright.Workflow.ClsRandom from FlowWright.Workflow.dll. The step has 2 input connections and 2 output connections.

The Random step provides three configurable properties:

  • Low value – specifies the lower value for the random-number range. This property is optional and has a default value of 0.
  • High value – specifies the upper value for the random-number range. This property is required.
  • Variable/Global to store the random # – specifies the Variable/Global where the generated random number is stored. This property is required. 

All three properties use the FlowWright string data type, implemented through FlowWright.DataTypes.ClsTextBox.

The step also defines True and False return paths. The XML identifies these return values but does not document additional conditions that determine which return is selected.

Typical uses include:

  • Generating a random number for subsequent workflow processing.
  • Introducing controlled randomness into a workflow.
  • Selecting or determining a value within a configured range.
  • Supporting randomized test or simulation workflows.
  • Using a generated number as input to a later decision or calculation.
  • Creating workflows where different processing outcomes depend on a generated random value.

 

Inputs

  • lowValue Low value specifies the lower value of the random-number range.
  • highValue  - High value specifies the upper value of the random-number range.
  • Variable/Global to store the random Variable/Global to store the random # specifies where FlowWright stores the generated random number.
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute 
 

 

Usage:

The Random step is typically placed in a workflow when a randomly generated value is required for subsequent processing.

During configuration:

  1. Add the Random step to the process definition.
  2. Configure Low value, if a lower boundary other than the default 0 is required.
  3. Configure the required High value.
  4. Specify the required Variable/Global to store the random #.
  5. Connect the Random step to the surrounding workflow operations.
  6. Save the Process Definition.
  7. Create a Process Instance and execute the workflow.
  8. Verify that the configured Variable/Global contains the generated value.
  9. Use the stored value in subsequent workflow processing.

A simple workflow might look like:

 

Typical workflow suggestions:

  • Randomized testing - Use the Random step to generate test values for workflows that require varying inputs during testing.
  • Random value generation - Generate a value within a configured range when a workflow requires a randomly selected number.
  • Randomized workflow branching - Generate a random number and use a subsequent decision step to determine which workflow path should execute.
  • Simulation workflows - Use Random to introduce variable values into process simulations or demonstrations.
  • Randomized assignment - Generate a random value that can subsequently be used by workflow logic to determine an assignment or selection.
  • Test-data generation - Use the Random step to produce changing numeric values when testing downstream calculations, decisions, or integrations.
  • Threshold-based processing - Generate a random value and compare it to a configured threshold in a subsequent decision step.

 

Example:

Let’s build and execute the “randomDef” example.          

  • Create a new definition called “randomDef” and open the definition in designer mode. 
  • Drag a “Random” step to the canvas.
  • Connect the dots between the “Start” and the “Random” steps, as shown above. 
  • Define a variable or a global to store the result. 
  • Click the “Random” step to configure its “Required” properties. Provide a name for the step. Provide a high-value number. Provide a variable or a global to store the generated random number. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • Click the “random” step to configure its “Settings” properties. Provide a low-value number. Click the Save button to confirm. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. Click the Random process step to view its properties. The step should generate a random number.

 

  • Here's another process generating a different random number in a loop. 

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. Click the Random process step to view its properties. The step should generate a random number iteratively. 

 

Tips:

  • Configure High value because it is a required property. 
  • Configure Variable/Global to store the random # because it is required. 
  • Use Low value when a lower boundary other than the default 0 is required. 
  • Use a descriptive Variable/Global name such as RandomNumber or GeneratedValue.
  • Validate the generated value in downstream workflow logic when it is being used to determine a business outcome.
  • When using the generated number for branching, place the decision logic in a subsequent decision or processing step, rather than assuming the Random step itself performs numeric branching.
  • Test workflows using several process instances because random values can differ between executions.
  • Verify that the configured low and high values are appropriate for the intended workflow.
  • Do not assume that the high or low boundary is inclusive unless that behavior is confirmed by FlowWright's runtime documentation or implementation.
  • The XML identifies the properties as strings; it does not document additional numeric-format validation. 
  • The XML defines True and False returns but does not document the conditions under which either return is selected. 

Notes:

  • Category: Engine
  • Internal name: random
  • Label: Generate a random number
  • Display name: random
  • Namespace: FlowWright.Workflow.ClsRandom
  • DLL: FlowWright.Workflow.dll
  • Step definition type: Process
  • Input connections: 2
  • Output connections: 2
  • Low value: Optional; default 0
  • High value: Required
  • Variable/Global to store the random #: Required
  • Low value property: lowValue
  • High value property: highValue
  • Output Variable/Global property: varGlobal
  • Property data type: String
  • Property implementation: FlowWright.DataTypes.ClsTextBox
  • Returns: True / False

 

Comparison with CoinToss step.

The CoinToss and Random steps both introduce randomness into a FlowWright workflow, but they serve different purposes. CoinToss makes a simple two-way random choice, while Random generates a random numeric value within a configurable range.

Feature CoinToss Random
Purpose Makes a random two-way choice Generates a random number
Category Logic Engine
Internal name cointoss random
Label Coin toss step Generate a random number
Display name Coin Toss random
Namespace FlowWright.Workflow.ClsCoinToss FlowWright.Workflow.ClsRandom
DLL FlowWright.Workflow.dll FlowWright.Workflow.dll
Step definition type Process Process
Input connections 2 2
Output connections 2 2
Configurable properties None 3
Low value Not applicable Optional; default 0
High value Not applicable Required
Output Variable/Global Not applicable Required
Output property None varGlobal
Output description Not applicable Variable/Global to store the random #
Possible outcomes Heads / Tails True / False execution paths, with a random number stored in the configured Variable/Global
Result type Workflow path Numeric value stored in a Variable/Global
Property data type None String
Primary use Randomly select between two workflow paths Generate a random number for subsequent workflow processing

 

CoinToss

The Coin Toss step is a Logic step. It has no configurable properties and provides exactly two return paths:

  • Heads
  • Tails

The XML defines no properties or property types for the step.

Conceptually:

Coin Toss → Heads → Path A

Coin Toss → Tails → Path B

This makes it particularly suitable when the workflow needs a simple random binary decision.

 

Random

The Random step is an Engine step that generates a random number. It provides three properties:

  1. Low value – optional, with a default value of 0.
  2. High value – required.
  3. Variable/Global to store the random # – required. 

All three properties use the FlowWright string/text-box data type.

For example, the workflow could configure:

  • Low value = 1
  • High value = 100
  • Variable/Global = RandomNumber

The generated value can then be used by subsequent workflow logic.

 

Key difference

The fundamental distinction is:

CoinToss randomly selects a workflow path; Random generates a random numeric value.

 

Definition Sample:

You may provide a sample process definition containing the Random step and import it into the FlowWright Process Definition (XML file) page.

After importing the sample, configure:

  • Low value
  • High value
  • Variable/Global to store the random #
  • Connections to the preceding and subsequent workflow steps

For example:

Low value: 1
High value: 100
Variable/Global to store the random #: RandomNumber

After executing the process, verify the value stored in RandomNumber before using it in downstream workflow logic.

A useful demonstration workflow is:

Start → Random → Decision → Processing → Stop

This demonstrates the complete pattern of generating a random value, storing it, evaluating it, and using the result in subsequent workflow processing.

A common pattern for using Random is:

Start → Random → Evaluate Generated Value → Business Processing → Stop

Click here to download the sample file.