Skip to content
Agentic Workflowdocs
v0.8.2Install free

concepts / data / data mapping

Mapping with expressions

Read values from earlier steps with {{ }} expressions, and add fallbacks, comparisons, maths and helper functions.

Edit Fields receives two orders and builds two fields from expressions. Each expression is worked out once per item.

Example run: Orders, 2 items → Edit Fields, ran 2 times, 2 items. name = {{ upper(trim($input.first)) + " " + $input.last }} · size = {{ $input.total > 100 ? "big order" : "small order" }}

Output of Edit Fields
#namesize
0ADA Lovelacebig order
1GRACE Hoppersmall order
name = {{ upper(trim($input.first)) + " " + $input.last }} · size = {{ $input.total > 100 ? "big order" : "small order" }}
Write Reads Example
$input The item this node is working on {{ $input.title }}, {{ $input.metadata.description }}, {{ $input.0.name }}
$('Step name') The output of another step, by its label {{ $('Get Page Metadata').title }}
$run A variable stored earlier in this run by Set Variable {{ $run.cursor }}, {{ $run.page.next }}
  • Paths use dots, including for list positions: $input.items.0.name is the name of the first entry (counting starts at 0).
  • Step names must match the node label exactly, spaces and capitals included. Renaming the step breaks the reference.
  • $('…') and items: a step directly connected to this one gives the matching item; a step further back gives its whole output. See Item linking.
  • Missing values in $input and $('…') become empty text, so a typo doesn’t stop the run. Check Preview from last run under the field.
  • $run is strict: reading a variable that hasn’t been set yet fails the step with an error that names it and lists the variables set so far. Read a variable only in steps that run after the Set Variable node. When a read might come first, the canvas warns you; see reading a variable before it is set.

You rarely type $input yourself: drag a field from the Input panel and the expression is written for you. See Mapping in the UI.

Mix your own words with expressions in any text setting:

Prompt
Summarize the page at {{ $input.url }}.
Title: {{ $input.title }}

Fallbacks: || returns the first value that isn’t empty.

Expression
{{ $input.title || "Untitled page" }}

Maths: + - * / %, with the usual precedence and parentheses.

Expression
{{ 5 + 3 * 2 }} → 11
{{ (5 + 3) * 2 }} → 16
{{ $input.price * 1.2 }}

Joining text: + joins text when either side is text.

Expression
{{ $input.first + " " + $input.last }}

Comparisons and choices: == != < <= > >=, logic with && || !, and condition ? ifYes : ifNo.

Expression
{{ $input.total > 100 ? "big order" : "small order" }}
{{ $input.status == "open" && $input.priority == "high" }}
Text Numbers Lists and general
upper(s) lower(s) trim(s) round(n) floor(n) ceil(n) abs(n) length(x)
replace(s, find, with) min(a, b, …) max(a, b, …) includes(list, value)
split(s, sep) slice(s, start, end) number(x) join(list, sep) slice(list, start, end)
str(x) default(value, fallback)
Expression
{{ upper(trim($input.name)) }}
{{ join($input.tags, ", ") }}
{{ default($input.title, "Untitled") }}
{{ length($input.items) > 0 ? "has items" : "empty" }}

Expressions are sandboxed: only these functions exist. There are no variables of your own, no method calls like .toUpperCase(), and no access to anything outside the values you reference.

The result shows expression text, like $(‘Get Metadata’).title, instead of a value

AWFlow couldn’t work the expression out, so it left the text as it was rather than failing the step. The usual cause is a $('…') name that differs from the node label. Copy the label from the canvas, or drag the field from the Input panel instead.

The value is empty

The path doesn’t exist on this item. Open the previous step’s Output tab and compare: maybe the value is nested ($input.data.title), or the step output one item holding a list ($input.links.0).

The step fails with “Variable … has not been set at this point in the run”

A $run variable is read before the Set Variable step that writes it, for example from a parallel branch. Connect the reading step after the Set Variable step.

An expression with .toUpperCase() comes out as plain text

Methods and outside functions aren’t available, so the expression can’t be worked out and its text is kept as is. Use the helper functions above, such as upper(…), or move the logic to the Code node.

Ask Aria