Expressions and templates

Nodes pass data over wires, and {{ }} templates use that data inside any text setting: a prompt, a URL, an email subject, a request body. A template reads what's wired into its step, and can embed a small expression language for reshaping values inline.

Template basics

Text settings accept {{ }} references:

  • {{name}}: a wired input, by its handle name
  • {{user.profile.email}}: a nested field of a wired input
  • {{trigger.output.email}}: what the run's trigger produced, readable by every step the trigger reaches (trigger.<output>.<path>)
  • {{env.API_HOST}}: an entry in the workflow Environment, set directly or from a workspace variable

Spaces inside the braces are fine: {{ name }} and {{name}} resolve the same way.

https://api.example.com/users/{{user.id}}

A template never reads another step directly. To use a value an earlier step produced, wire that step's output into this one, and the input's name is what the template reads. Every data dependency is then a wire you can see on the canvas.

A setting that isn't written text (a choice, a number, a picked record, a secret, a list of secret names, a request's allowed origin) is kept exactly as written and doesn't take {{ }} values. Saving one there is refused. In the inspector, a field that takes them shows a {} button at its right edge.

Two kinds of setting never treat {{ }} as a template: code editors, where the Run JavaScript source is delivered verbatim, and the condition fields on control-flow nodes, which take expressions directly. See Condition fields.

How values render

Templates produce text. A referenced value is inserted as:

  • Strings: as-is
  • Numbers and booleans: as text (42, true)
  • Lists of strings: comma-separated (a, b, c)
  • Other lists and objects: JSON
  • Null: an empty string

Environment values are plain

Workflow Environment values, including those from workspace variables, are readable in outputs, Task notes and inspection, and they're never redacted. Keep credentials in workspace secrets. A secret in the Environment reaches Run shell script steps only, can't be read as {{env.NAME}}, and is scrubbed from run history. HTTP request reads secrets its own way. See Authentication.

Inserting values

You rarely need to type addresses by hand:

  • In the inspector, typing {{ in a text field or pressing its {} button opens the value picker. It lists this step's inputs (and trigger), what earlier steps produce, and the workflow's settings. Type to search, and several words narrow it ("customer email").
  • Picking an earlier step's value that isn't wired in yet adds the wire first: the whole output goes into an input named after it, and the reference reads the field below it ({{ profile.email }}). An output already wired in is reused.
  • Dragging a field out of an output's value tree on the canvas and dropping it on a text setting does the same at the drop point.
  • A reference shows as a chip named like prose (profile › email). Hovering it shows its source and a sample. A chip that reads a name nothing is wired to, or another step directly, is red.
  • After the workflow has run at least once, the picker shows sample values from previous runs, and a → line under the field shows what the setting resolves to. Condition fields have their own autocomplete for input paths and functions.

Expressions

When the content between {{ }} is more than a plain dotted path, it's evaluated as an expression:

{{ upper(name) }}
{{ price * qty }}
{{ default(user.tag, "n/a") }}
{{ items[0].id }}

Operators and literals

  • Logic: &&, ||, !
  • Comparison: ==, !=, >, >=, <, <=
  • Arithmetic: +, -, *, /, % (remainder)
  • Access: .field, [index]
  • Literals: numbers, double-quoted strings ("done"), true, false, null, arrays ([1, 2, 3]), (…) grouping

Semantics to know:

  • Only null and false are falsey. "", 0 and [] are truthy. Test for non-empty with len(x) > 0.
  • A missing field or out-of-range index reads as null, never an error.
  • Arithmetic coerces numeric strings. A null operand or division by zero yields null.
  • == compares by value: 1 == 1.0 is true.
  • Ordering comparisons (>, <, …) work between two numbers or two strings. Anything else is false.
  • Strings use double quotes only, with \n, \t, \" and \\ escapes.

Functions

Group Functions
Logic if(cond, a, b), where only the taken branch is evaluated; default(value, fallback) and coalesce(a, b, …), which return the first argument that isn't null or an empty string
Evidence reference_matches(a, b), true when two result references name exactly the same stored result; reference_complete(r), true when a reference carries both digests. See Query workspace
String concat, lower, upper, trim, replace, regex_replace, regex_match, mime_match, strip_html, byte_len, split, join, fold, levenshtein, similar, starts_with, ends_with, pad_start, pad_end, truncate, slugify, to_base64, from_base64, md5, sha256, json_digest, lines, and safe format(fmt, args…) (%s, %d, %.2f, %% only)
Numbers round, min, max, clamp, to_number, abs, floor, ceil, trunc, mod, pow, sqrt
Collections Lazy per-item forms: map, filter, find, any, all, sort_by, group_by, unique_by, sum, count, min_by, max_by, reduce; plain forms: len, contains, slice, get, pluck, first, last, take, drop, take_last, flatten, reverse, unique, union, difference, intersection, entries, keys, values, pick, omit, merge, zip, range, is_empty, is_nil, type_of
Convert to_string(v), json_parse(s) / from_json(s), to_json(v) / json(v), xml_parse(s)
Time Run-stable now_iso(), now_unix(), now_unix_ms(); to_unix, to_unix_ms, from_unix, from_unix_ms, format_date, parse_date, date_add, signed date_diff(a, b, unit), date_trunc, weekday, day_of_month, date_key, to_date

The now_* functions read a clock stamped once per run, so every node in the same run sees the same timestamp.

byte_len returns a string's size in UTF-8 bytes, while len counts the characters a person reads.

json_digest hashes any JSON value with SHA-256 after sorting its keys, so 2 objects with the same content give the same digest.

Use reference_matches to compare result references. a == b is true for two incomplete references, which prove nothing, and reference_matches says false for them.

Collection expression arguments are lazy. They run with item, zero-based index and the outer scope available, and reduce also provides acc. group_by returns stable {key, items, count} objects. type_of returns nil, boolean, number, string, list, map or other.

Date values are ISO 8601 and UTC unless a timezone argument is shown. parse_date uses strftime-style directives (for example %Y%m%d;%H%M%S) and converts an IANA-zone wall time to UTC. date_diff(a, b, unit) returns a - b in whole units. date_key and to_date are UTC YYYY-MM-DD aliases.

Condition fields

The If, Switch and Repeat workflow nodes route on expressions, and their condition fields take the language directly, with no braces. The scope is the node's wired inputs at the root:

input.status == "done" && len(input.items) > 0
input.score > env.threshold
  • If routes its input to the true or false output on one condition.
  • Switch evaluates a list of cases (condition and output name), and the first match wins. In partition mode it splits a list across the cases with a per-item condition that reads item and index.
  • Repeat workflow takes a Condition under Stop when that reads state and iteration. It's optional: blank runs the workflow up to Maximum runs.
  • Transform list operations use the same language per list item, with item and index in scope.

Condition fields fail closed. A blank condition on If or Switch, or an invalid condition on any of them, fails the node before anything routes, and an evaluation error fails the node. The editor highlights the expression as you type, flags compile errors inline, and shows a live → result once sample data from a previous run is available.

Connected inputs, null, and defaults

A node input can be in one of these states, and they mean different things:

  • Not connected. No wire feeds the input. The node uses what it's configured with, or its own default.
  • Connected, and the upstream node sent a value. The node receives it, including when that value is null. A null an upstream node chose to send is a value, and the receiving node decides what it means. Many inputs treat it as invalid and fail the node rather than guess.
  • Connected, but the upstream node didn't produce that output. The output name is absent from what ran, so the input behaves as if it weren't connected and the node's own default applies.
  • Fed only by skipped nodes. The input reads as empty, so a {{reference}} to it renders blank instead of failing. If any live branch also feeds it, the live value wins.

Omitting an output is the only way to say "I'm not sending this". To fall back to the receiving node's default, build the object without the key instead of with a null value.

That works through outputs a node derives from an object, too. When a node pulls an output from a field of another output, such as a Transform list result, leaving that field out leaves the output unsent. So unset in a Transform list pipeline means "don't send this". A field explicitly set to null is still sent as null. A path that can't be followed at all (into a number, a string, or past the end of a list) still reads as empty.

Wires into a node's run-after or branch header are different: they carry a signal, not a value. A null arriving there means "this branch didn't fire" and the node is skipped. Only ordinary data wires deliver a null to the node.

When a reference doesn't resolve

  • A {{path}} reference that resolves to null renders as an empty string.
  • A {{path}} reference that can't resolve, because nothing is wired to that name or the upstream step didn't produce it, fails the node before it executes, with an error naming the variable. The literal {{…}} text never reaches an API, prompt or shell command.
  • Inside an expression, a missing path reads as null, so wrap it in default(…) to substitute. An unknown function or an evaluation error fails the node.
  • While you edit, a reference to a name nothing is wired to, or one that addresses another step directly ({{nodes.…}}), is listed under the step's problems. Publish refuses a Draft with such a reference.
  • {{env.…}} names are validated against the workflow's Environment when you save and Publish. A workspace secret in the Environment isn't readable here.

Literal braces and other template engines

Authored text often carries another engine's template syntax, such as a shell script writing GitHub Actions or Helm files. These pass through untouched:

  • ${{ … }} (GitHub Actions) is never treated as a Rollout template.
  • Leading-dot references like {{ .Values.image }} (Helm and Go) pass through, because Rollout references start with a letter, digit or underscore.
  • Any span that doesn't parse as a path or expression, such as {{ var | filter }}, passes through verbatim.
  • To force literal braces, escape them: \{\{ name \}\} renders as {{ name }} without being resolved.

Limits

  • An expression can be at most 10,000 bytes, with bounded nesting and complexity.
  • Regex patterns are capped at 1,000 bytes and regex inputs at 100,000 bytes.
  • fold, similar, starts_with, ends_with, pad_start, pad_end, truncate, slugify, to_base64, from_base64, md5, sha256, lines, format and the date functions refuse inputs above 64 KiB.
  • levenshtein and similar inputs are capped at 256 characters.
  • range is capped at 10,000 generated items.
  • A {{ }} span can't cross a line break.

See Workflows for the editor basics, the Node reference for every node, and HTTP request for templating a request end to end.