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
| Global | Value |
|---|---|
$json | JSON of the current item |
$binary | Binary metadata of the current item |
$input.item | The current item ({ json, binary }) |
$input.all(), $input.first(), $input.last() | All items on the input, the first, the last |
$input.params | Parameters of the current node |
$itemIndex | Index of the current item |
$runIndex | How many times this node has run before in this execution |
$parameter | Parameters of the current node (resolved) |
Other nodes
| Global | Value |
|---|---|
$('Node name').item | The 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').params | That node’s parameters |
$('Node name').isExecuted | Whether the node has run in this execution |
$node["Node name"].json | Legacy form, equivalent to the paired item’s JSON |
$prevNode | { name, outputIndex, runIndex } of the node that fed this one |
Execution and environment
| Global | Value |
|---|---|
$execution.id | Execution ID |
$execution.mode | manual, trigger, webhook, retry or sub |
$execution.resumeUrl | URL that resumes this execution at the next Wait node |
$workflow.id, $workflow.name, $workflow.active | Workflow metadata |
$vars | Project variables |
$env | Process environment variables, when allowed (see below) |
$now, $today | Current date-time and start of today as Luxon DateTime in the workflow timezone |
Helpers
| Helper | Example |
|---|---|
$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_ALLOWLISTrestricts$envto 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:
$jsonis 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.