Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Expressions

Any node parameter can be computed from data with an expression. Expressions are JavaScript, evaluated by the embedded QuickJS runtime.

Syntax

A parameter value that starts with = is an expression. Inside it, {{ ... }} blocks are evaluated and everything else is literal text:

=Hello {{ $json.firstName }} {{ $json.lastName }}

Typing rules:

  • A value that is exactly one {{ }} block keeps the JavaScript type of its result: ={{ $json.total * 1.2 }} is a number, ={{ $json.tags }} is an array.
  • A value that mixes text and blocks is always a string: =Total: {{ $json.total }}.
  • A value without a leading = is a literal, even if it contains {{ }}.

Each block is a JavaScript expression, so anything that fits in one expression works:

={{ $json.items.filter(i => i.qty > 0).map(i => i.sku).join(', ') }}
={{ $json.email ? $json.email.toLowerCase() : 'unknown' }}
={{ (() => { const d = $json.discount ?? 0; return $json.price * (1 - d); })() }}

Expressions are evaluated once per input item, with that item as $json.

Globals

Current item and input

GlobalValue
$jsonJSON of the current item
$binaryBinary metadata of the current item
$input.itemThe current item ({ json, binary })
$input.all(), $input.first(), $input.last()All items on the input, the first, the last
$input.paramsParameters of the current node
$itemIndexIndex of the current item
$runIndexHow many times this node has run before in this execution
$parameterParameters of the current node (resolved)

Other nodes

GlobalValue
$('Node name').itemThe item of that node paired with the current item (see Paired items)
$('Node name').all(branch?, runIndex?)All output items of that node
$('Node name').first(), .last()First or last output item
$('Node name').paramsThat node’s parameters
$('Node name').isExecutedWhether the node has run in this execution
$node["Node name"].jsonLegacy form, equivalent to the paired item’s JSON
$prevNode{ name, outputIndex, runIndex } of the node that fed this one

Execution and environment

GlobalValue
$execution.idExecution ID
$execution.modemanual, trigger, webhook, retry or sub
$execution.resumeUrlURL that resumes this execution at the next Wait node
$workflow.id, $workflow.name, $workflow.activeWorkflow metadata
$varsProject variables
$envProcess environment variables, when allowed (see below)
$now, $todayCurrent date-time and start of today as Luxon DateTime in the workflow timezone

Helpers

HelperExample
$if(cond, a, b){{ $if($json.vip, 'priority', 'normal') }}
$ifEmpty(value, fallback){{ $ifEmpty($json.nickname, $json.name) }}
$max(...), $min(...){{ $max($json.a, $json.b) }}
$jmespath(obj, query){{ $jmespath($json, 'orders[*].id') }}

Dates

$now and $today are Luxon DateTime objects, and the DateTime, Duration and Interval classes are available:

={{ $now.minus({ days: 7 }).toISO() }}
={{ DateTime.fromISO($json.createdAt).setZone('Europe/Berlin').toFormat('yyyy-LL-dd HH:mm') }}
={{ $today.startOf('month').toISODate() }}

The workflow’s timezone setting is the default zone. If it is unset, TAPPET_TIMEZONE is used, then UTC.

Extension methods

Values have convenience methods in addition to standard JavaScript ones, for example:

={{ $json.email.isEmail() }}
={{ $json.notes.isEmpty() }}
={{ $json.created.toDateTime().toFormat('DDD') }}
={{ $json.body.extractEmail() }}
={{ $json.prices.sum() }}

Each method is implemented and tested against a recorded fixture. The list of supported methods is part of the generated node reference. An imported workflow that uses an unsupported method gets an EXPR_EXTENSION_UNSUPPORTED issue in its diagnostics report, naming the method and the parameter.

Limits and isolation

  • Each worker thread has its own QuickJS runtime with a memory cap (64 MB by default, TAPPET_JS_MEMORY_LIMIT). Each execution gets a fresh context, so no state leaks between executions.
  • Each evaluation has a time budget (TAPPET_EXPR_TIMEOUT). A runaway expression is interrupted and the node fails with a timeout error.
  • Expressions cannot access the network, the file system or processes.
  • Compiled expressions are cached by source text, so the same expression over many items is compiled once.

$env

$env exposes process environment variables to workflows. It is controlled by TAPPET_EXPR_ALLOW_ENV:

  • Single-user deployments: allowed by default.
  • Multi-tenant mode: denied by default, because any editor could read the server’s environment.
  • TAPPET_EXPR_ENV_ALLOWLIST restricts $env to listed names.

Prefer project variables ($vars) for configuration that workflows need. They are scoped to a project and visible in the UI.

Code node

The Code node runs a whole JavaScript function body instead of a single expression, with the same globals. It has two modes:

  • Run once for all items: $input.all() returns every item; return an array of items.
  • Run once for each item: $json is the current item; return one item.
// Run once for all items
const out = [];
for (const item of $input.all()) {
  out.push({ json: { id: item.json.id, total: item.json.qty * item.json.price } });
}
return out;

require is limited to bundled libraries (luxon). There is no network, file or process access; use HTTP Request or a connector for I/O. The default time budget is 5 seconds per run (TAPPET_CODE_TIMEOUT), and the workflow’s own maximum cannot exceed the instance setting.