Skip to content

Syntax basics

Everything you can write inside {{ }}, and what it turns into.


Delimiters

An expression is anything between {{ and }}:

Hello, {{ $trigger.payload.name }}!

A field with no {{ is a plain value and is used as typed.

An expression must start with one of the five roots: $node, $trigger, $input, $workflow or $env. See Referencing data.


Multiple expressions in one field

A field can hold any number of blocks. Each one is resolved on its own:

{{ $env.API_HOST }}/api/v{{ $node["Config"].output.version }}/users/{{ $trigger.payload.id }}

If one block fails (a typo in a node name, say), the others still resolve. The failed block becomes an [EXPR-ERROR: …] marker, not an empty string, so the problem is visible in the output.


Whitespace inside a block

Spaces and line breaks inside {{ }} are ignored. These are equivalent:

{{ $node["HTTP Request"].output.response.body.email }}
{{$node["HTTP Request"].output.response.body.email}}

Paths

After the root, use .field for properties and [index] for list elements, starting at 0:

{{ $node["List users"].output.users[0].address.city }}
{{ $trigger.payload.items[2].sku }}

That is all a path can do. There is no .length, no negative index, no [*] wildcard, and no method calls.

  • A missing field at the end of a path resolves to null.
  • Going further into something that isn't there is an error: reading a property of null, indexing something that isn't a list, or an index past the end. You get an [EXPR-ERROR: …] marker.

Node names go in square brackets with double or single quotes: $node["HTTP Request"] or $node['HTTP Request']. Single quotes save escaping inside JSON.


What an expression turns into

A field that is exactly one expression and resolves to a list or an object keeps that type. That is how a Loop gets a real list from fieldToLoopOn: {{ $node["Fetch"].output.items }}, and how an HTTP body field can carry a JSON array.

Everything else becomes text:

Resolved value Inserted as
Text The text, without quotes
Number Its digits: 42
Boolean true or false
null null
List or object inside other text JSON: [1,2,3], {"a":1}

So {{ $input.count }} on its own gives the text 42, not the number 42. The If node's numeric operators convert numeric text; equal compares exactly, so compare text with text. Database parameters and sub-workflow input mappings are the exception: a whole-value reference there keeps its type, so a number stays a number and null stays null.

Inside JSON bodies, values placed inside a string are escaped, so a quote in the data can't break the JSON.


Literal {{ and }}

A {{ … }} block that doesn't start with a $ root is left alone, as literal text. So templates for other tools, such as {{ today }} in a Handlebars snippet, pass through unchanged.

The exception is text shaped like a node path without the $node[…] wrapper, such as {{ start.output.x }}. Flero flags that as an error because it is almost always a mistake.


Code, terminal and SQL fields

In a Code node's script, a Terminal command and SQL in the Database and Query Data nodes, expressions work differently. Each value is handed over as data (a script value, an environment variable or a query parameter), never pasted into the program text. Data from a web page or a form can't change what your code or query does.



Found something out of date? This page lives in the Flero docs content set.