On this page
Sommatic Docs
Open portal

Node Reference

The output of any node that already ran in this execution, the previous node and the entry point of a chained workflow.

View as Markdown
Open in

Each example was run against the deployed expression engine over the example context at the end of the page.

$('Node label')

$(label)

$ is a function. It takes the label of a node (the name shown on the canvas) and returns an accessor to the output that node produced in this execution. A node without a label is found by its node_id. Only nodes that already ran have an output; for any other name, the accessor still exists and returns an empty item, so a read gives undefined instead of an error.

The lookup is by text: renaming a node breaks every expression that reads it, and when two nodes share a label the one placed later in the workflow wins. Give nodes short, stable, unique labels.

Parameters

label string required
The node's label, exactly as written (case and spaces count). Its node_id when it has no label.

Returns

NodeAccessor An object with the members below.

Members

Signature Type Description
$('X').item { json } The node's output as an item: item.json is what the node returned. { json: {} } when the node did not run.
$('X').first() { json } Same as .item.
$('X').last() { json } Same as .item (a node produces one item).
$('X').all() list A list with the node's item, or an empty list when the node did not run.
$('X').params Reserved object Reserved: the configuration of that node is not exposed; always {}.
$('X').context Reserved object Reserved: always {}.
$('X').isExecuted boolean true when the node already ran in this execution.

Examples

{{ $('Normalize input').item.json.correlation_id }}
Result string
"c-7f3a"

The webhook body, from any node further down the graph.

{{ $('Webhook Receiver').item.json.body.email }}
Result string
"ana.perez@example.com"
{{ $('Classify').item.json.confidence >= 0.8 }}
Result boolean
true

A node on another branch, or not reached yet.

{{ $('Approval').isExecuted }}
Result boolean
false

Reading a node that did not run gives undefined, not an error.

{{ $('Approval').item.json.decision }}
Result undefined
undefined
{{ $('Classify').all().length }}
Result number
1

Notes

  • The node's output is exactly what it returned through its port (data of the envelope), not the envelope itself: $('X').item.json.ok does not exist.
  • A node on a branch that did not run is not an error. Check .isExecuted when the difference matters, for example after a flow.if.

In JSONata Not available: $ and $$ mean the context in JSONata. Read the node in a JavaScript expression instead.

$prevNode

Reserved. The engine does not pass the previous node: today it is always { name: 'Start', runIndex: 0, outputIndex: 0 }.

$prevNode

Meant to describe the node that routed to the current one. The engine does not pass it, so it always holds the same fixed values. To know which node produced the input, read its output with $('label') and check .isExecuted.

Members

Signature Type Description
$prevNode.name Reserved string Meant to be the previous node's name. Today always 'Start'.
$prevNode.runIndex Reserved number Meant to be the attempt of the previous node. Today always 0.
$prevNode.outputIndex Reserved number Meant to be the output port it used. Today always 0.

Examples

{{ $prevNode }}
Result object
{"name":"Start","runIndex":0,"outputIndex":0}

In JSONata $$prevNode.name

Chain entry point

$('Chain Entry Point').item.json

A workflow called by another one through workflow.chain starts at a workflow.trigger node (named here Chain Entry Point; use your node's label). Its output is the data the caller sent, spread at the top level, plus chain_context, which identifies the caller. The node right after the trigger reads it as $json; any later node reads it with $('Chain Entry Point').

Inside a chained workflow, $execution.id is the id of the root run of the chain, so messages and tasks show the same reference across every workflow; $execution.run_flow_instance_result_id is the id of this hop.

Members

Signature Type Description
$('Chain Entry Point').item.json.<field> any Each field of the data object the caller sent, at the top level.
…chain_context.caller_flow_definition_id string | null Definition id of the calling workflow. accepted_caller_ids of the trigger is checked against it.
…chain_context.caller_flow_instance_id string | null Flow instance id of the calling run.
…chain_context.caller_flow_slug string | null Slug of the calling workflow.
…chain_context.caller_node_id string | null node_id of the workflow.chain node that made the call.
…chain_context.correlation_id string Id of this call (chain- + 20 characters), new on every call.
…chain_context.root_flow_instance_result_id string | null Result id of the root run of the chain, the same in every hop (it is also $execution.id).

Examples

Right after the trigger: the data the caller sent, at the top level.

{{ $json.order_id }}
Result string
"ord_1042"
{{ $('Chain Entry Point').item.json.chain_context.caller_flow_slug }}
Result string
"order-intake"

The editor suggests data, but the trigger spreads the caller's fields at the top level: .data reads as undefined.

{{ $('Chain Entry Point').item.json.data }}
Result undefined
undefined
{{ $('Chain Entry Point').item.json.chain_context.correlation_id }}
Result string
"chain-7Hq2Lw9sKd3pXa1mZr4t"

The root run of the chain.

{{ $execution.id }}
Result string
"fir-root-xxxx"

This hop of the chain.

{{ $execution.run_flow_instance_result_id }}
Result string
"fir-hop-xxxx"

Notes

  • The label Chain Entry Point is an example: $('…') takes the label you gave the workflow.trigger node.
  • chain_context keeps travelling only if you pass it on: a workflow.chain node builds a new one for the next hop and carries the root id forward on its own.

In JSONata $$json.chain_context.caller_flow_slug

Example context

The examples run over this data: the input of the current node ($json), the nodes that already ran ($(…)), the ids of the run and the current node. The clock is fixed at 2026-11-26T14:30:00.000Z and the server zone is UTC, so $now and $today give the same values on every page.

Input of the current node JSON
{
  "$json": {
    "body": {
      "order_id": "ord_1042",
      "email": "ana.perez@example.com",
      "customer": {
        "name": "Ana Pérez",
        "segment": "gold"
      },
      "priority": "",
      "items": [
        {
          "sku": "A-100",
          "qty": 2,
          "price": 10.5
        },
        {
          "sku": "B-200",
          "qty": 0,
          "price": 4
        },
        {
          "sku": "C-300",
          "qty": 1,
          "price": 25
        }
      ],
      "tags": [
        "new",
        "web",
        "new"
      ],
      "created_at": "2026-11-25T09:15:00Z"
    },
    "headers": {
      "content-type": "application/json"
    },
    "query": {},
    "method": "POST"
  }
}
Nodes that already ran (label → output) JSON
{
  "Webhook Receiver": "= $json",
  "Normalize input": {
    "correlation_id": "c-7f3a",
    "channel": "web"
  },
  "Classify": {
    "label": "billing",
    "confidence": 0.92
  }
}
Run and current node JSON
{
  "$execution": {
    "id": "fir-xxxx",
    "flow_instance_id": "fi-xxxx",
    "flow_definition_id": "fd-xxxx",
    "flow_version_id": "fv-xxxx",
    "flow_slug": "order-intake"
  },
  "$node": {
    "id": "node-notify",
    "label": "Notify customer"
  }
}

The examples of a chained workflow run over a second context: a workflow started by workflow.chain, whose workflow.trigger node is labelled Chain Entry Point.

Chained workflow (examples marked chain) JSON
{
  "$json": {
    "order_id": "ord_1042",
    "customer_email": "ana.perez@example.com",
    "amount": 46,
    "chain_context": {
      "caller_flow_definition_id": "fd-caller-xxxx",
      "caller_flow_instance_id": "fi-caller-xxxx",
      "caller_flow_slug": "order-intake",
      "caller_node_id": "node-chain-billing",
      "correlation_id": "chain-7Hq2Lw9sKd3pXa1mZr4t",
      "root_flow_instance_result_id": "fir-root-xxxx"
    }
  },
  "nodes": {
    "Chain Entry Point": {
      "order_id": "ord_1042",
      "customer_email": "ana.perez@example.com",
      "amount": 46,
      "chain_context": {
        "caller_flow_definition_id": "fd-caller-xxxx",
        "caller_flow_instance_id": "fi-caller-xxxx",
        "caller_flow_slug": "order-intake",
        "caller_node_id": "node-chain-billing",
        "correlation_id": "chain-7Hq2Lw9sKd3pXa1mZr4t",
        "root_flow_instance_result_id": "fir-root-xxxx"
      }
    }
  },
  "$execution": {
    "id": "fir-root-xxxx",
    "run_flow_instance_result_id": "fir-hop-xxxx",
    "flow_slug": "billing-review"
  }
}

Examples run against the orchestrator at commit 31e874b

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs