- Who can: a user with the “Manage Studio” permission
- Where: Studio › Workflows › the workflow › a node in “Expression” mode
An expression computes a value from run data: a check, a number, a date in the right format, a list. Most node fields take a path in double curly braces and paste the value as is. An expression does more: it compares, counts and calls functions.
The examples on this page run on the demo request “Kyiv → Lviv” of the data model “Demo: Shipment request”:
{
"route": "Kyiv → Lviv",
"loading_date": "2026-11-12",
"weight_kg": 18000,
"body_type": "tent"
}The record's fields are under trigger.record.data. Where an example needs a list, it uses requests: the three demo requests “Kyiv → Lviv”, “Odesa → Dnipro” (reefer, 12 000 kg, 2026-11-13) and “Kharkiv → Poltava” (isotherm, 8 000 kg, 2026-11-14), each with the same fields.
Where you write expressions
- “Condition” in “Expression” mode: the “Expression” field must give true or false.
- “Switch” in “Expression” mode: one expression per case.
- “Transform” in “Expression” mode: one expression per key; the result is
nodes.<id>.<key>. - “Loop”: the “Collection” field takes an expression that gives a list.
- “Apply rules”: the condition of a rule and a computed value. Here an expression names the row's columns directly:
weight_kg > 20000.
The other fields take paths in double curly braces, not expressions. To put a computed value into such a field, compute it in a “Transform” node first and insert its result. See Use data from earlier steps.
How to write an expression
An expression has no curly braces. Paths start from trigger, state or nodes:
| You type | You get on the demo request |
|---|---|
trigger.record.data.weight_kg > 10000 | true |
trigger.record.data.weight_kg / 1000 | 18 |
trigger.record.data.weight_kg > 10000 && trigger.record.data.body_type == "tent" | true |
trigger.record.data.route contains "Lviv" | true |
trigger.record.data.route starts with "Kyiv" | true |
trigger.record.data.route ends with "Lviv" | true |
trigger.record.data.body_type in ["tent", "reefer"] | true |
trigger.record.data.body_type not in ["tent", "reefer"] | false |
trigger.record.data.weight_kg > 10000 ? "heavy" : "light" | heavy |
"Route: " ~ trigger.record.data.route | Route: Kyiv → Lviv |
(trigger.record.data.note ?? "") == "" | true: the request has no note field |
- Comparison:
==,!=,<,<=,>,>=. Logic:&&,||,!ornot. Arithmetic:+,-,*,/. - Text: put it in double quotes.
~joins pieces of text.matches "/^Kyiv/"checks a pattern. - A list item by number:
requests[0].route. In curly-brace paths the same item isrequests.0.route. a ?? bgivesbwhenais empty or missing.- Values have no methods such as
.length: use a function, for examplesize(requests).
Important
Give a default to a field the record may not have: write trigger.record.data.note ?? "" instead of trigger.record.data.note, and (nodes.<id>.error ?? "") != "" to check whether a step with “Continue on error” failed.
Node results in an expression
In an expression, read a node result through a function, with the node ID in quotes:
| You need | Write |
|---|---|
| One value | prop(nodes, "entity_query-1.count") > 0 |
A list, for “Loop” or size() | pluck(nodes, "entity_query-1", "records") |
The node ID is shown under “Selected node” in its settings. In double curly braces, write the path as is: nodes.entity_query-1.count.
Empty values
A function that gets an empty or wrong value gives null and does not stop the run: date_format("", "d.m.Y") gives null. In an email or a task title, null prints as empty text. Check the result with ??: date_format(trigger.record.data.loading_date, "d.m.Y") ?? "no date".
Date and time
now(), today(), add_days and add_hours count in UTC. Pass a timezone to date_format to print local time.
now()
The current date and time in UTC, as 2026-11-18T11:35:22+00:00.
today()
Today's date in UTC, as 2026-11-18.
add_days(date, days)
Moves a date by whole days and returns YYYY-MM-DD. A negative number moves back.
add_days(trigger.record.data.loading_date, -2) gives 2026-11-10: two days before loading.
add_hours(datetime, hours)
Moves a moment by whole hours and keeps its offset.
add_hours("2026-11-12T08:00:00+02:00", 6) gives 2026-11-12T14:00:00+02:00. A date without time counts from midnight UTC: add_hours(trigger.record.data.loading_date, 6) gives 2026-11-12T06:00:00+00:00.
diff_hours(from, to)
Hours between two moments, with a fraction. Negative when to is earlier than from.
diff_hours("2026-11-12T08:00:00+00:00", "2026-11-13T14:30:00+00:00") gives 30.5.
floor(number)
Drops the fraction. Not a number gives null.
floor(diff_hours("2026-11-12T08:00:00+00:00", "2026-11-13T14:30:00+00:00")) gives 30.
date_format(value, format, timezone)
Prints a date in the format you set: d day, m month, Y year, H hours, i minutes, each with a leading zero. The timezone is optional: a name such as Europe/Kyiv, and summer and winter time follow it. Without it, the value keeps its own offset. A date without time, such as 2026-11-12, never moves to another day.
date_format(trigger.record.data.loading_date, "d.m.Y")gives12.11.2026.date_format("2026-11-12T06:48:06+00:00", "d.m H:i", "Europe/Kyiv")gives12.11 08:48.- An unknown timezone gives
null.
date_spoken(date, language, format)
A date written out for a voice call, with the month as a word. The optional third argument changes the format; "D MMMM" drops the year.
date_spoken(trigger.record.data.loading_date, "en")gives12 November 2026.date_spoken(trigger.record.data.loading_date, "en", "D MMMM")gives12 November.
digits_spoken(number, language)
Spells the digits one by one, for reading a number out in a call. Languages: uk, ru, pl, tr, en, az, ka, kk, uz, bg, ro. Anything that is not whole digits gives null.
digits_spoken(trigger.record.data.weight_kg, "en") gives one eight zero zero zero.
year_spoken(year, language)
Spells a year in words, in the same languages.
year_spoken("2026", "en") gives two thousand twenty-six.
Text
lower(text), upper(text)
Changes the letter case, Cyrillic included. An empty value gives empty text.
upper(trigger.record.data.body_type) gives TENT. lower(trigger.record.data.route) gives kyiv → lviv.
trim(text)
Removes spaces at both ends: trim(" Kyiv ") gives Kyiv.
coalesce(a, b, …)
The first value that is not empty.
coalesce(trigger.record.data.note ?? null, trigger.record.data.route) gives Kyiv → Lviv.
prop(value, path)
Reads a nested field by a path in quotes. A missing path gives null, not an error. A list on the way gives its first item.
prop(trigger, "record.data.route") gives Kyiv → Lviv. prop(trigger, "record.data.note") gives null.
regex_extract(pattern, text)
The pattern goes in quotes between slashes, such as "/^(\\S+)/". The function gives the first part in brackets that matches, or the whole match when the pattern has no brackets. No match gives null.
regex_extract("/^(\\S+)/", trigger.record.data.route) gives Kyiv: the city of loading.
json_parse(text)
Turns JSON text into a value whose fields you can read, for example an AI model's reply. It strips a code fence and, when the reply has extra text around the JSON, takes the part between the first { and the last }. Text that is not JSON gives null.
Read a field of the result with prop, not with a dot: prop(json_parse("{\"weight_kg\": 18000}"), "weight_kg") gives 18000.
split(text, separator)
Cuts text into a list and trims each piece. Empty pieces stay in place.
split(trigger.record.data.route, "→") gives ["Kyiv", "Lviv"].
to_number(text), to_int(text)
Turns text into a number. A comma counts as the decimal mark and spaces are dropped. to_int keeps the whole part. Text that is not a number gives null.
to_number("18 000") gives 18000. to_number("23,5") gives 23.5. to_int("23,9") gives 23.
Lists
size(list)
The number of items: size(requests) gives 3.
pluck(list, field, …)
One field from each item. Further names go deeper.
pluck(requests, "route") gives ["Kyiv → Lviv", "Odesa → Dnipro", "Kharkiv → Poltava"]. It also reads a node result: see Node results in an expression.
list_filter(list, expression)
Keeps the items for which the expression in quotes is true. Inside it, item is the current item and index its number from 0.
list_filter(requests, "item.weight_kg > 10000") keeps “Kyiv → Lviv” and “Odesa → Dnipro”.
list_map(list, expression)
A new value for each item, with the same item and index.
list_map(requests, "item.route") gives the three routes.
list_where_eq(list, field, value), list_where_not(list, field, value)
The items whose field equals the value, or all the others. The match ignores case and spaces at the ends.
list_where_eq(requests, "body_type", "tent") gives “Kyiv → Lviv”. list_where_not(requests, "body_type", "tent") gives the other two.
list_concat(a, b), a + b
Joins lists one after another and keeps repeats: ["Kyiv"] + ["Lviv", "Kyiv"] gives ["Kyiv", "Lviv", "Kyiv"].
list_union(a, b)
Joins lists without repeats: list_union(["Kyiv"], ["Lviv", "Kyiv"]) gives ["Kyiv", "Lviv"].
list_diff(a, b)
The items of a that are not in b: list_diff(["Kyiv", "Lviv", "Odesa"], ["Lviv"]) gives ["Kyiv", "Odesa"].
list_join(list, separator)
Joins a list into one text.
list_join(pluck(requests, "route"), "; ") gives Kyiv → Lviv; Odesa → Dnipro; Kharkiv → Poltava.
list_min(list)
The first value in alphabetical order. For dates written as 2026-11-12 that is the earliest. An empty list gives null.
list_min(pluck(requests, "loading_date")) gives 2026-11-12.
list_map_lookup(list, dictionary, fallback)
Replaces each value through a dictionary and drops repeats. The match ignores case. A value that is not in the dictionary becomes the fallback.
list_map_lookup(pluck(requests, "body_type"), {"tent": "Curtainsider", "reefer": "Reefer"}, "Other") gives ["Curtainsider", "Reefer", "Other"].
list_format(list, template, dictionary)
Text built from a template for each item, for a message or a task description. {field} inserts the field; the optional dictionary replaces raw values. Items are separated by an empty line.
list_format(requests, "• {route}: {body_type}", {"body_type": {"tent": "Curtainsider", "reefer": "Reefer", "isotherm": "Isothermal"}}) gives:
• Kyiv → Lviv: Curtainsider
• Odesa → Dnipro: Reefer
• Kharkiv → Poltava: Isothermallist_rows(list, columns, dictionary)
One flat row per item, for a spreadsheet. The second argument names each column and the path to its value; the optional dictionary replaces raw values per column.
list_rows(requests, {"Route": "route", "Body": "body_type"}, {"Body": {"tent": "Curtainsider"}}) gives the rows Kyiv → Lviv | Curtainsider, Odesa → Dnipro | reefer, Kharkiv → Poltava | isotherm.