Skip to content

Expression

Type key: expression_node
Group: Data
Category: data
Tier: CORE

The Expression node evaluates dynamic expressions to compute new fields, perform calculations, transform strings, and apply conditional logic. It is more powerful than simple {{tag}} replacement and is the go-to tool for computed fields without writing PHP.

Handles

HandleDirectionDescription
inputInputReceives data from the preceding node
outputOutputEmits input data with computed fields added/replaced

Configuration

FieldTypeDefaultDescription
expressionsarray[]Array of expression definitions
pass_through_inputbooleantrueInclude all original input fields in the output
evaluation_modeenumper_recordper_record or dataset

Expression Object

json
{
    "field": "price_with_tax",
    "expression": "{{input.price}} * 1.22"
}
PropertyDescription
fieldOutput field name where the result is stored
expressionThe expression to evaluate

Expression Syntax

Arithmetic

{{input.subtotal}} + {{input.shipping}}
{{input.quantity}} * {{input.unit_price}}
{{input.total}} / {{input.count}}
{{input.value}} % 100

Comparison (returns boolean)

{{input.score}} > 80
{{input.age}} >= 18
{{input.status}} == "active"

Ternary Operator

{{input.quantity}} >= 10 ? 0.15 : 0.05
{{input.vip}} == true ? "VIP" : "Standard"

String Concatenation

{{input.first_name}} + " " + {{input.last_name}}

Built-in Functions

String Functions

FunctionDescriptionExample
$upper(str)Convert to uppercase$upper({{input.name}})
$lower(str)Convert to lowercase$lower({{input.email}})
$trim(str)Remove whitespace$trim({{input.code}})
$length(str)String length$length({{input.description}})
$replace(str, search, replace)Replace substring$replace({{input.text}}, "foo", "bar")
$contains(str, needle)Check substring$contains({{input.tags}}, "urgent")
$substr(str, start, length)Extract substring$substr({{input.code}}, 0, 3)

Math Functions

FunctionDescriptionExample
$round(num, decimals)Round to N decimal places$round({{input.price}}, 2)
$floor(num)Round down$floor({{input.score}})
$ceil(num)Round up$ceil({{input.average}})
$abs(num)Absolute value$abs({{input.delta}})
$min(a, b)Minimum$min({{input.a}}, {{input.b}})
$max(a, b)Maximum$max({{input.a}}, {{input.b}})

Date Functions

FunctionDescriptionExample
$dateFormat(date, format)Format a date$dateFormat({{input.created_at}}, "d/m/Y")
$dateDiff(date1, date2, unit)Difference between dates$dateDiff({{input.start}}, {{now}}, "days")
$dateAdd(date, amount, unit)Add time to a date$dateAdd({{input.date}}, 7, "days")
$now()Current datetime string$now()

Currency Functions

FunctionDescriptionExample
$currency(value, code, locale, decimals)Format a number as currency string$currency({{input.total}}, "EUR", "it_IT", 2)
$currency_it(value, decimals)Shortcut for EUR + italian locale$currency_it({{input.total}}, 2)

Function signature:

text
$currency(value, currencyCode = 'EUR', locale = 'it_IT', decimals = 2)
  • value: numeric value to format
  • currencyCode: ISO-like code (e.g. EUR, USD, GBP, CHF, JPY)
  • locale: formatting style hint (e.g. it_IT, en_US, de_DE)
  • decimals: number of decimal digits

Important: locale must be a quoted string literal:

text
$currency({{input.total}}, "USD", "en_US", 2)   // ✅
$currency({{input.total}}, "USD", en_US, 2)     // ❌

Examples by locale:

text
$currency({{input.total}}, "EUR", "it_IT", 2)   // 4.048,00 €
$currency({{input.total}}, "USD", "en_US", 2)   // $ 4,048.00

Important: currency helpers do not divide by 100 automatically. If your values are in cents, divide explicitly:

text
$currency({{input.total}} / 100, "EUR", "it_IT", 2)

Evaluation Modes

per_record

Expressions are evaluated once per item in the dataset. Use this when the input is a single record or when processing inside a For Each loop.

dataset

Expressions are evaluated once against the entire dataset object. Use this for meta-level computations that operate on the whole context (e.g. counting records, computing totals across the dataset).

Examples

Calculate Total with VAT

Expression node — VAT calculation exampleExpression node — VAT calculation example
json
{
    "field": "total_with_vat",
    "expression": "{{input.subtotal}} * 1.22"
}

💾 Try this example

Download the workflow JSON — open an empty workflow and import the file.

Expression inside For Each (greeting per user)

With For Each, each iteration exposes the current item as input. An Expression node in per_record mode can build fields such as a personalized greeting from {{input.name}}.

Expression node inside ForEach — greeting per userExpression node inside ForEach — greeting per user

💾 Try this example

Download the workflow JSON — open an empty workflow and import the file.

Conditional Discount

json
{
    "field": "discount_rate",
    "expression": "{{input.quantity}} >= 10 ? 0.15 : 0.05"
}

Clean and Normalize Name

json
{
    "field": "clean_name",
    "expression": "$upper($trim({{input.name}}))"
}

Days Since Created

json
{
    "field": "days_since_registration",
    "expression": "$dateDiff({{input.created_at}}, $now(), \"days\")"
}

Notes

  • When pass_through_input: true, all original fields are preserved and new computed fields are added alongside them
  • When pass_through_input: false, only the fields listed in expressions appear in the output
  • Expression evaluation errors (division by zero, invalid types) result in null for that field, not a node failure
  • For complex logic that outgrows the expression engine, use the PHP Code node

Proprietary software — source-available. All rights reserved.