Skip to main content

Expression Syntax

Expressions use standard JavaScript syntax inside {{ }} delimiters.

Accessing node output

Reference a field from a previous node using its name:

{{ $nodes['NodeName'].fieldName }}

For nested objects:

{{ $nodes['HTTP Request'].response.user.email }}

For array elements:

{{ $nodes['Parse Response'].items[0].name }}

Replace NodeName with the exact name you gave the node in the editor.

String operations

{{ $nodes['NodeName'].text.toLowerCase() }}
{{ $nodes['NodeName'].firstName + ' ' + $nodes['NodeName'].lastName }}
{{ `Hello, ${$nodes['NodeName'].name}!` }}

Number operations

{{ $nodes['NodeName'].count * 2 }}
{{ Math.round($nodes['NodeName'].value) }}
{{ $nodes['NodeName'].total.toFixed(2) }}

Conditional expressions

{{ $nodes['NodeName'].status === 'active' ? 'Enabled' : 'Disabled' }}
{{ $nodes['NodeName'].value ?? 'default' }}

Checking execution status

{{ $status['NodeName'].isSuccess }}
{{ $status['NodeName'].isSuccess ? 'succeeded' : $status['NodeName'].errorMessage }}

Working with dates

{{ new Date($nodes['NodeName'].timestamp).toISOString() }}
{{ new Date($now).toLocaleDateString() }}

JSON serialisation

{{ JSON.stringify($nodes['NodeName'].data) }}
{{ JSON.parse($nodes['NodeName'].rawJson).field }}

Accessing secrets

Secrets stored in the project vault are accessible via $secrets:

{{ $secrets.MY_SECRET_KEY }}

See Secrets for how to create secrets.

Multi-line expressions

For complex logic, write a multi-line JavaScript block ending with a return statement:

{{
const items = $nodes['NodeName'].results;
const active = items.filter(i => i.status === 'active');
return active.length;
}}

Common patterns

Extract a field from an HTTP response:

{{ $nodes['HTTP Request'].body.id }}

Build a URL with a dynamic ID:

https://api.example.com/users/{{ $nodes['Get User'].id }}/profile

Check if a list is non-empty:

{{ $nodes['NodeName'].items && $nodes['NodeName'].items.length > 0 }}