Expression Syntax & Data Flow
Nodes2Cloud uses a clean, safe JavaScript-subset expression engine to map and transform data between steps without requiring full boilerplate scripts.
How Data Moves Through Nodes
Every node execution receives the output payload of its incoming connection as $json. The output is structured as standard JSON. Downstream nodes can either consume this immediate input or reach back to any earlier node in the DAG using $node["NodeName"].
Common Expression Patterns
$json.user.emailAccesses the 'email' property inside the 'user' object of the immediate predecessor node.
$node["Webhook Trigger"].json.headers["x-signature"]Retrieves headers from the original Webhook Trigger, even several steps downstream.
"Welcome {{ $json.name }}, your order #{{ $json.order_id }} is confirmed!"Interpolates dynamic values into messages for Slack, Email, or Discord notifications.
$json.contact.phone ?? "No phone provided"Safely handles optional properties without throwing runtime exceptions.
$json.items.map(i => i.price * i.quantity).reduce((a, b) => a + b, 0)Performs standard JavaScript array operations and mathematical reductions.
Standard Globals
| Variable | Type | Description |
|---|---|---|
| $json | Record<string, any> | Output payload from the immediate predecessor node. |
| $node["Name"] | StepExecutionResult | Historical output of any named upstream node in the execution branch. |
| $env | Record<string, string> | Workers environment variables and secrets configured for this deployment. |
| $now | Date | Current ISO timestamp of workflow execution. |
Pure Compilation Invariant
Expressions compile to plain JavaScript inside your Worker bundle. There is no runtime expression engine and no eval(): what runs is the code you can read in the compiled output.