Reference

Expressions

Expressions are a sandboxed formula language, not JavaScript. Write them between double braces in text fields, for example {{ $json.total | format(2) }}. Every function also works as a transform after a pipe: $json.name | upper.

Values you can read

$jsonThe current item.
$inputAll items that arrived at this node.
$nodeOutput of an earlier node, by its id.
$triggerWhat started the run (webhook body, form answers, schedule time).
$varsWorkspace variables.
$runFacts about this run (id, test flag).
$nowStart time of the run as ISO text.

Computed access needs a literal key ($json.items[0]), use get($json, path) for dynamic paths. Relative filters such as [.x > 1] are refused; use filterBy. Results must be JSON data and are limited to 256 KB.

Text

lower(text)Lower-cases text.
upper(text)Upper-cases text.
trim(text)Removes spaces at both ends.
split(text, sep = ",")Splits text into a list.
join(list, sep = ",")Joins a list into text.
replace(text, find, with = "")Replaces every occurrence of a piece of text.
slice(textOrList, from = 0, to?)Takes part of a text or a list.
startsWith(text, prefix)True when the text begins with the prefix.
endsWith(text, suffix)True when the text ends with the suffix.
includes(textOrList, x)True when the text or list contains x.
pad(text, length, char = " ")Pads text on the left up to a length (0 to 100).
length(value)Characters in a text, items in a list, keys in an object.

Numbers

round(n, digits = 0)Rounds to a number of decimals (0 to 10).
floor(n)Rounds down.
ceil(n)Rounds up.
abs(n)Absolute value.
min(a, b, ...) or min(list)Smallest number, or null for an empty list.
max(a, b, ...) or max(list)Largest number, or null for an empty list.
sum(list)Adds up a list of numbers.
avg(list)Average of a list of numbers, or null when empty.
toNumber(value)Converts text to a number, or null when it is not one.
format(n, digits = 2)Number to text with a fixed number of decimals.

Dates

now()The current time as an ISO 8601 text.
parseDate(value)Reads a date or timestamp and returns ISO 8601 text.
formatDate(date, pattern, tz = "UTC")Formats a date with a pattern in a time zone.
addDays(date, n)Adds (or subtracts) calendar days.
diffDays(a, b)Calendar days between two dates.

Lists

first(list)First item, or null.
last(list)Last item, or null.
pluck(list, path)Reads one field from every item of a list.
unique(list)Removes duplicate items, keeping the first of each.
sortBy(list, path, dir = "asc")Sorts items by a field, ascending or descending.
filterBy(list, path, op = "==", value?)Keeps items whose field passes a test (==, !=, >, >=, <, <=, contains, exists).
count(list)Number of items in a list.
chunk(list, size)Splits a list into groups of 1 to 100 items.

Objects

keys(object)Names of an object's fields.
values(object)Values of an object's fields.
get(value, path)Reads a nested value by dotted path, for example "customer.address.city".
has(value, path)True when the path exists.
merge(a, b)Combines two objects; fields of b win.
pick(object, ...keys)Keeps only the named fields.
omit(object, ...keys)Drops the named fields.

Data

toJson(value)Turns data into JSON text.
fromJson(text)Parses JSON text (up to 256 KB).
default(value, fallback)The fallback when the value is missing, null or empty text.
uuid()A random v4 identifier.
hashSha256(text)SHA-256 of the text as hex.
base64Encode(text)Encodes text as base64.
base64Decode(text)Decodes base64 into text.
urlEncode(text)Percent-encodes text for use in a URL.