Docs/Macros & Variables
#

Macros & Variables

export const meta = { title: 'Macros & Variables', description: 'Use macros for fresh test data and variables for values shared across your workflow.', tags: ['reference', 'workflows', 'macros', 'variables'], };

Macros generate fresh, unique data every time a workflow runs. Variables let you reference shared values across nodes — input data, macro results, and extracted values are all accessible as $var.{name}.

Both are available from the same $ suggestions menu in any macro-enabled field.

01Syntax

Macro expressions follow the format $MACRO_NAME() or $MACRO_NAME(args). They can appear standalone or inline within a larger string:

  • Standalone: $EMAIL() resolves to test-a1b2c3d4@example-test.com
  • Inline: user-$UUID()@corp.com resolves to user-4f3a1b2c-...@corp.com
  • Escaped: \$EMAIL() produces the literal text $EMAIL() (no resolution)

02Using macros

Type $ in any macro-enabled field to open suggestions. Browse the list, keep typing to filter, then press Enter to insert the item you want.

In workflow and node configuration fields, inserted macros now appear as inline token pills. This makes mixed text and dynamic values easier to read, especially when you combine plain text, macros, and variables in the same field.

A workflow field showing inline token pills for inserted macros and variables inside mixed text

Use the richer editor to work with dynamic values more easily:

  • Type $ anywhere in a field to open suggestions at the cursor
  • Insert a macro inline without replacing the surrounding text
  • Mix text, macros, and variables in the same field, such as user-$UUID()@corp.com
  • Click a token pill to review or edit the inserted macro or variable
  • Use the cursor keys to move through text and tokens when adjusting a field

Macros work in:

  • Action input fields (text, email, number)
  • Action titles
  • Action descriptions
  • Navigate node URL fields
  • Email notification step fields, including recipients, subject lines, message bodies, and attachment filenames
  • Workflow inputs and step fields where you want AI-generated values inserted directly during execution

Use macros directly in step fields when you want each run to generate realistic values at execution time. For example, enter $FIRST_NAME() $LAST_NAME() in a name field, Welcome $FIRST_NAME() in a short subject field, or Notes: $RANDOM_STRING(12) in a short text entry.

You can also use dynamic values in Workflow inputs so later steps reuse the generated result through variables. For example, set a workflow input to $FIRST_NAME(), $LAST_NAME(), or $RANDOM_STRING(8) when you want a realistic value available across the workflow.

A workflow step field using macros directly for generated execution values

Use macros in workflow navigation when the destination changes by environment, account, or test data. For example, set a Navigate node URL to /customers/$SEQUENCE("accounts") for root-relative routing, or https://app.example.com/users/$UUID() to generate a unique destination on each run.

Use macros in Email notification steps when you want each message to reflect the current run. For example, set the recipient to qa+$SEQUENCE("alerts")@example.com, the subject to Run $UUID() failed, the message body to Failure detected on $TODAY() at $NOW(), or an attachment filename to trace-$TIMESTAMP().zip.

Each run resolves macros independently at send time or execution time, so every run gets fresh values. In notification steps, macros resolve when the email sends during that run, not when you design the workflow. Cached runs also re-resolve macros on replay.

03Available macros

MacroArgumentsOutputExample
$UUID()Random UUID v4a1b2c3d4-e5f6-7890-abcd-ef1234567890
$EMAIL()Unique test emailtest-xk9mq2@example-test.com
$FIRST_NAME()Random first nameJordan
$LAST_NAME()Random last nameChen
$PHONE()US phone number (555 prefix)+1-555-382-7491
$RANDOM_INT(min, max)Two numbersRandom integer (inclusive)42
$RANDOM_STRING(length)One number (1–1000)Alphanumeric stringxK9mQ3bR
$TODAY()Current date2026-02-19
$DATE(days)One numberDate offset from today$DATE(-7) → last week
$NOW()ISO 8601 timestamp2026-02-19T14:30:00.000Z
$TIMESTAMP()Unix milliseconds1771520400000
$SEQUENCE("name")Counter nameAuto-incrementing number per run1, 2, 3...

04Common patterns

Unique user registration: Set the email input to $EMAIL() and name to $FIRST_NAME() $LAST_NAME(). Each run creates a distinct test user.

Direct step values for realistic entries: Enter macros directly in step fields to generate natural-looking values during execution. For example, use $FIRST_NAME() $LAST_NAME() for a full name, Intro to $RANDOM_STRING(6) for a short subject, or About $FIRST_NAME() for a short-form entry.

Workflow inputs with generated data: Set a workflow input to $FIRST_NAME(), $LAST_NAME(), or $RANDOM_STRING(10) when you want generated data to be available as a reusable variable later in the workflow.

Numbered items: Use $SEQUENCE("orders") to generate incrementing IDs. The counter resets with each new run and increments independently per name — $SEQUENCE("orders") and $SEQUENCE("items") maintain separate counts.

Date-relative testing: Use $DATE(30) for a date 30 days in the future or $DATE(-7) for last week. Use $TODAY() for the current date.

Unique identifiers: Use $UUID() for globally unique values or $RANDOM_STRING(8) for shorter random strings. Combine with text for readable IDs: order-$RANDOM_STRING(6).

Dynamic navigation targets: Use macros in a Navigate node URL when the target should change per run. For example, /releases/$DATE(0) opens a date-based page, and https://app.example.com/invites/$RANDOM_STRING(12) navigates to a unique invite path.

05Best practices

  • Use direct step macros when you need realistic one-off values only in that field for that run
  • Use Workflow inputs with macros when later steps need to reuse the same generated value through $var.{name}
  • Use AI-generated macros in step fields for short, natural-language entries such as names, subjects, and short text fields
  • Prefer standard macros such as $EMAIL(), $UUID(), or $SEQUENCE("name") when you need uniqueness, predictability, or a specific format
  • Expect AI-generated values to resolve at runtime for each run, so avoid relying on an exact phrase or wording in later assertions unless you first store and reuse that value through a variable
  • When you mix AI-generated macros with workflow variables and inputs, generate the value once in a Workflow input if multiple steps must use the same text
  • Keep AI-generated values short and task-focused so they fit reliably in the field you are automating
  • Use $EMAIL() instead of hardcoded addresses for any field that requires uniqueness
  • Use $SEQUENCE("name") when you need predictable ordering within a single run
  • Prefer $DATE(days) over fixed dates so tests stay valid over time
  • Insert macros from the $ suggestions menu instead of typing long expressions by hand
  • Keep mixed text and tokens in a single field when you need readable labels, URLs, identifiers, or notification content
  • In Email notification steps, preview your full recipient, subject, body, and attachment naming pattern so the resolved values are clear when the email sends
  • Remember that notification macros resolve when the step sends the email during each run, so avoid assuming a design-time or saved value

06Variables

Note: Workflow runs now block unresolved variable references before execution starts. If a field includes $var.{name}, make sure that variable is defined earlier in the workflow and will have a value when the run begins.

Variables let you reference values that are set during a workflow run. When an action node has input values, macros, or extracted data, those become variables accessible to other nodes as $var.{name}.

How variables are created

Variables come from four sources:

SourceHow it worksExample
InputA value you enter in an action's input fieldSetting a company field creates $var.company
MacroA macro expression in an input field$EMAIL() creates $var.email
ExtractedData extracted from the page during a runAn extraction step creates $var.order_id
CredentialValues from the credential used in a login nodeLogin credentials create $var.username

Using variables in fields

Type $ in any macro-enabled field to open suggestions. Type $var. to narrow the list to variables only, then press Enter to insert the variable you want.

Variables now appear inline in the richer editor as token pills, just like macros. Use this to build mixed values such as /accounts/$var.account_id/details or Hello $var.first_name without losing the surrounding text.

Selecting a variable inserts $var.{name} — no parentheses needed, unlike macros.

You can also use variables in Navigate node URL fields. This lets you build dynamic destinations such as /accounts/$var.account_id or https://app.example.com/$var.region/dashboard after earlier nodes set those values.

Before you run a workflow, confirm that every referenced variable is valid:

  1. Open each field that uses $var.{name}.
  2. Verify the variable appears in suggestions or in the variables list.
  3. Make sure the variable is defined by an earlier node in the workflow.
  4. For extracted or credential values, confirm the workflow has the step or credential needed to populate that variable.

If a variable reference cannot be resolved, the workflow does not start until you fix or remove that reference.

Variables panel

When no node is selected in the Configure tab, the sidebar shows a list of all variables discovered across the workflow. Each variable displays its name and source. Click any variable to jump to the node that defines or references it.

Variables with an Input or Macro source have values at design time. Variables from Extracted or Credential sources are populated when the workflow runs.

Use the variables list to review workflow inputs before you run:

  • Confirm the variable name matches the one you reference in other fields
  • Confirm the source is the node or credential you expect
  • Confirm extracted values come from a step that runs before the reference

07Using shared values in workflows

Use variables to carry values from one node to the next. This lets you create a value once, then reuse it in later inputs, assertions, descriptions, and Navigate node URL fields.

Common examples include reusing an account ID from an extraction step, passing a login username into a later form, or building a destination such as /accounts/$var.account_id/details.

When you decide between a direct macro and a variable, choose based on reuse:

  1. Insert a macro directly in a step field when only that step needs a fresh value.
  2. Set a Workflow input to a macro when later steps must reuse the same resolved value.
  3. Reference the saved value with $var.{name} anywhere else in the workflow.

Use this pattern for AI-generated values too. For example, place an AI-generated macro in a Workflow input when you want one realistic name, subject, or short text value reused across multiple steps. Place it directly in a step field when you only need that text once.

To avoid blocked runs, check shared values before execution:

  1. Create the value in an earlier node with an input, macro, extraction, or credential.
  2. Insert the variable from the $ suggestions menu instead of typing the name manually.
  3. Review the workflow order so the defining node runs before any node that references the variable.
  4. Recheck the variables list if you rename fields or remove steps.

When you need a value that is always available at design time, prefer an Input or Macro source. When you use an Extracted value, make sure the extraction step is still present and succeeds before any dependent step runs.

08Troubleshooting

IssueWhat to checkHow to fix
A workflow will not start because of an unresolved variableThe referenced $var.{name} does not exist in the workflow, appears after the step that uses it, or no longer has a sourceInsert the variable again from the suggestions menu, move the defining step earlier, or update the field to use an available variable
A variable does not appear in the suggestions listThe variable has not been created yet, the defining field was renamed, or the source step was removedRecreate the input, macro, extraction, or credential value that defines the variable
A Navigate URL using a variable does not workPart of the path uses a missing or empty variableOpen the variables list, confirm the value source, and verify the variable is populated before navigation
Editing mixed text and tokens feels difficultThe field contains both plain text and multiple macros or variablesClick the token pill you want to change, then use the cursor keys to move through the field and adjust text or reinsert a value from $ suggestions
An extracted value is unavailable in a later stepThe extraction step does not run before the reference or no longer captures the value you expectMove the extraction earlier or update the extraction so it produces the needed variable
An AI-generated value changes between steps when you expected one shared valueThe AI-generated macro was inserted directly into multiple step fields, so each field resolves independently at runtimeMove the AI-generated macro into a Workflow input, then reuse that saved result with $var.{name} in later steps
A test expects exact AI-generated wording and fails intermittentlyThe step depends on a specific phrase instead of reusing the generated resultSave the AI-generated value once, reference it with $var.{name}, or use a standard macro when you need a fixed format