On this page
Sommatic Docs
Open portal

Input Data

The data that reached the current node.

View as Markdown
Open in

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

$json

$json

The output of the node that routed to the current one. For the first node after a trigger, it is what the trigger delivered: a webhook trigger delivers the request as { body, headers, query, method }. When several branches join into one node, $json is the output of the branch that arrived last; the flow.join node is the way to combine branches.

$json changes from node to node. To read something from a node further back, use $('Node label').

Examples

{{ $json.body.email }}
Result string
"ana.perez@example.com"
{{ $json.body.items.length }}
Result number
3
{{ $json.headers['content-type'] }}
Result string
"application/json"

A field that may be missing: optional chaining returns undefined instead of failing.

{{ $json.body.customer?.phone }}
Result undefined
undefined

Errors

Message Cause and fix
Cannot read properties of undefined (reading '<field>') A step of the path does not exist, for example $json.body.customer.phone.number when phone is missing. Use optional chaining (?.) or $ifEmpty.

In JSONata $$json.body.email Or the field names directly: JSONata reads the input as its context (body.email).

$binary

Reserved. The engine does not fill it yet: today it is always {}. Do not base logic on it.

$binary

Meant for the files attached to the current item, one key per file with { data, mimeType, fileName }. The engine does not fill it yet: it is always an empty object. Nodes that handle files today return them inside their output, so read files from $json (for example the attachments of an email trigger) or from the node that produced them with $('…').

Examples

{{ $binary }}
Result object
{}
{{ Object.keys($binary).length }}
Result number
0

In JSONata $$binary

$itemIndex

Reserved. Each node execution handles one item: today it is always 0.

$itemIndex

Meant to be the zero-based position of the item being processed when a node handles a batch. A node handles one item per execution, so it is always 0. To work with the position of an element inside a list, use the index that map, forEach or findIndex give you, or iterate with flow.split.

Examples

{{ $itemIndex }}
Result number
0

The position of each element of a list.

{{ $json.body.items.map((item, index) => index + ': ' + item.sku) }}
Result list
["0: A-100","1: B-200","2: C-300"]

In JSONata $$itemIndex

$runIndex

Reserved. The attempt number is not passed to expressions: today it is always 0, also on retries.

$runIndex

Meant to count the attempts of the current node (0 on the first, 1 on the first retry…). The engine does not pass the attempt number to expressions: it is 0 on every attempt, retries included. Retry behaviour is configured per node with its execution settings (retryOnFail, maxTries).

Examples

{{ $runIndex }}
Result number
0

In JSONata $$runIndex

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"
  }
}

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