Skip to main content
Variables are named, declared values that live at the journey level and can be referenced by any step. Unlike run inputs — which are supplied fresh each time — variables are part of the journey definition. They centralize values that multiple steps share, so you do not have to repeat the same configuration in every step that needs it.

When to use it

Use variables when:
  • Multiple steps in the same journey need the same value (for example, a base_user_id used in both a setup step and a later assertion step).
  • You want a single place to change a value and have it propagate to all the steps that reference it.
  • You are building a journey that will be run with different variable presets to swap in different configurations without modifying the journey itself.
If a value is different every run and comes from the person or system executing the journey, use a run input instead. If a value should never change, use a hard-coded value.

Key concepts

Declared at the journey level. Variables are configured in the Values panel in Build mode. Each variable has a name and an optional default value. Referenced by name. Any step can reference a variable by name. If the variable’s value changes — whether from a preset or at run time — every step picks up the updated value automatically. Default values. A variable can have a default value. That default is used unless overridden by a variable preset, a run input that maps to it, or an explicit override at run time. Scope. Variables are journey-scoped. A variable declared in one journey is not automatically available in another.

How it works

1

Declare the variable

In the Values panel, add a variable with a name and an optional default value. Add a description to explain its purpose to collaborators or Runbook users.
2

Reference it in steps

In each step that needs the value, reference the variable by name in the relevant field. The step resolves it when the journey runs.
3

Supply or override at run time

The variable’s default value is used unless a preset or run-time override supplies a different one. You can also override a variable’s value via the CLI using --set.

Examples

Declaring variables in YAML:
variables:
  - name: base_user_id
    default: usr_demo
  - name: subscription_tier
    default: pro
Referencing a variable in a step:
steps:
  - name: Get user
    request: get-user
    values:
      userId: ${{ variables.base_user_id }}
Overriding a variable at run time via CLI:
reqflo run billing-flow --set base_user_id=usr_99999
Using a case to switch all variable values at once:
reqflo run billing-flow --case "Expired subscription"
Cases can pre-fill variables with scenario-specific values. See Variable presets for reusable preset sources.