On this page
Sommatic Docs
Open portal

Execution Context

Ids of the current run, the workflow and the node being executed, and the environment.

View as Markdown
Open in

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

$execution

$execution

The identity of the run. Write $execution.id in messages, tasks and logs so anyone can trace a case back to its run. When the run was started by workflow.chain, id is the id of the root run, so every workflow of the chain shares it; run_flow_instance_result_id keeps the id of this specific run.

Members

Signature Type Description
$execution.id string The principal id of the run: the result id of the root run of the chain, or of this run when there is no chain.
$execution.flow_instance_result_id string | null The principal result id (the same value as id).
$execution.root_flow_instance_result_id string | null The result id of the root run of a chain.
$execution.run_flow_instance_result_id string | null The result id of this run, also inside a chain.
$execution.flow_instance_id string | null The id of the flow instance.
$execution.flow_definition_id string | null The id of the workflow definition.
$execution.flow_version_id string | null The id of the published version that runs.
$execution.flow_slug string | null The workflow slug.
$execution.mode Reserved string Reserved: meant to tell a test run from a production one; today always 'manual'.
$execution.resumeUrl Reserved undefined Reserved: meant for resuming a paused run; today always undefined.
$execution.customData Reserved object Reserved: always {}.

Examples

Case received. Reference: {{ $execution.id }}
Result string
"Case received. Reference: fir-xxxx"
{{ ({ run: $execution.id, workflow: $execution.flow_slug, version: $execution.flow_version_id }) }}
Result object
{"run":"fir-xxxx","workflow":"order-intake","version":"fv-xxxx"}

Reserved member: the same value in every run.

{{ $execution.mode }}
Result string
"manual"

Notes

  • A field the run does not have is null. The ids are opaque text: compare them, never parse them.
  • A node's own execution configuration field (its retry settings) has nothing to do with $execution.

In JSONata $$execution.id

$workflow

$workflow

The workflow being executed. Use slug and version; id, name and active are reserved and hold fixed values today (for the id of the definition, read $execution.flow_definition_id).

Members

Signature Type Description
$workflow.slug string | null The workflow slug.
$workflow.version string | null Identifies the version that runs (today, the id of the published version). Treat it as an opaque value, not as a number.
$workflow.id Reserved string Reserved: today always 'unknown'. Use $execution.flow_definition_id.
$workflow.name Reserved string Reserved: today always 'Untitled'.
$workflow.active Reserved boolean Reserved: today always false.

Examples

{{ $workflow.slug + '@' + $workflow.version }}
Result string
"order-intake@fv-xxxx"

The whole object, reserved members included.

{{ $workflow }}
Result object
{
  "id": "unknown",
  "name": "Untitled",
  "active": false,
  "slug": "order-intake",
  "version": "fv-xxxx"
}

In JSONata $$workflow.slug

$node

$node

Metadata of the node being executed. It is not a way to read other nodes: for that, use $('Node label').

Members

Signature Type Description
$node.id string The node's node_id.
$node.label string | null The node's label, as shown on the canvas.
$node.name string | null The same value as label.

Examples

Created by {{ $node.label }} in {{ $workflow.slug }}
Result string
"Created by Notify customer in order-intake"
{{ $node.id }}
Result string
"node-notify"

In JSONata $$node.label

$env

Reserved. The engine does not fill it yet: today it is always {}.

$env

Meant for variables declared for the environment a workflow runs in. The engine does not fill it yet: it is always an empty object, and it never exposes the service's own environment. Pass environment-specific values through the trigger input or through a Git Sync environment, and secrets through a credential bound to the node.

Examples

{{ $env }}
Result object
{}

A default keeps the expression working while it is empty.

{{ $ifEmpty($env.API_BASE_URL, 'https://api.example.com') }}
Result string
"https://api.example.com"

In JSONata $$env

$vars

Reserved. Not filled: today it is always {}.

$vars

Reserved for workflow variables. It is always an empty object. Never put secrets in variables: bind a credential to the node instead.

Examples

{{ $vars }}
Result object
{}

In JSONata $$vars

$nodeVersion

Reserved. Today always 1.

$nodeVersion

Meant to be the version of the operator that runs the current node. It is always 1, whatever the node's operator_version. The operator version is part of the node definition in the workflow file.

Examples

{{ $nodeVersion }}
Result number
1

In JSONata $$nodeVersion

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