Working with Variables and Templates

Learn how to pass data between steps using template expressions.

Overview

Template expressions are how nodes share data in a workflow. They use double curly braces, for example {{ step1.customer.email }}, and resolve at runtime against the trigger payload and the outputs of previously executed steps.

Most node configuration fields - subjects, bodies, URLs, queries, structured field values - accept template expressions. Understanding what is in scope and how types are preserved is what makes the difference between a workflow that just runs and one you can troubleshoot a month later.

Accessing Step Output

Each step's output is available by its step name:

  • {{ step1 }} - the full output object of step 1.
  • {{ step1.customer.email }} - a nested field from step 1's output.
  • {{ step1.items[0].name }} - the first item's name from an array.

Trigger Data

Data from the trigger is available as:

  • {{ input }} - the full trigger payload (webhook body, email data, manual input, schedule context).
  • {{ input.order_id }} - a specific field from the trigger payload.

Loop Variables

Inside the body of a Loop node:

  • {{ item }} - the current array element.
  • {{ index }} - the current iteration counter, starting at 0.

Custom Output Variables

Every step has a default name (step1, step2, ...). You can rename a step's output in its properties panel to something more meaningful, for example searchResults or customer. Downstream expressions then read {{ searchResults.items }} instead of {{ step3.items }}.

Type Handling

  • When a field's value is a single template expression, the original type is preserved (number, object, array, boolean).
  • When a template expression is mixed with surrounding text - for example Order: {{ step1.id }} - the result is a string.
  • Structured transforms let you assert the target type explicitly, which protects downstream connectors from string/number mismatches.

Tips

  • Rename steps as you build. {{ shopifyOrder.line_items }} is much easier to read than {{ step4.line_items }}.
  • Inspect a previous execution log to copy the exact field path you need. Guessing the shape leads to silent empty values.
  • If you need to preserve a number or object across steps, reference the value alone rather than embedding it in a string.

Common Pitfalls

  • Referencing a step that has not run on the current branch (for example, a step on a Condition false path) resolves to nothing.
  • Mixing text with an expression always returns a string, even if the source value was a number. This breaks connectors that expect numeric input.
  • Renaming a step's output variable does not retroactively update existing references. Search the workflow for the old name when you rename.

Related Articles

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.