Skip to content

Expressions and context

Almost every field in a workflow accepts an expression. An expression is how a step reads data produced by an earlier step — the ticket id from the trigger, a classification from a model, a row from a table. This page explains the context objects, the reference syntax, and the failure mode that catches everyone once.

LLM Call node panel in English with prompt fields that accept workflow expressions.

Any field that shows a template accepts expressions; the prompt fields are the most common place to use them.

ObjectContainsLifetime
$triggerThe payload that started the run — webhook body, manual input, or schedule occurrenceWhole run, immutable
$jsonThe output of the immediately preceding node on this pathOne hop
$node["<id>"]The output of a specific earlier nodeWhole run
$varsReserved values for the run, when configuredWhole run

$json is a convenience, not a store: two hops later it contains something else. Use $node[…] when you need a specific step’s output regardless of the path taken.

{{ $trigger.ticketId }}
{{ $json.subject }}
{{ $node["classify"].json.category }}
{{ $json.priority }} == "High"
  • Expressions are wrapped in {{ }}.
  • Field access uses dots; bracket access is used for ids with dashes.
  • Outputs differ per node type: an action_sdp returns the operation result, an ai_agent returns the assistant message plus tool trace, a data_transform returns exactly the mapping you defined.
  • Conditions accept expressions in both sides: field and value may each be a template.

A classifier step returns JSON, and the next step needs one field from it:

{{ $node["classify"].json.category }}

If the path did not run the classifier — for example a branch skipped it — the read resolves to nothing and the step fails with an unresolved-expression error. That is the correct behaviour: silently substituting an empty string would write a blank category into a ticket.

MAIA Plus evaluates expressions strictly. A missing value is not coerced to an empty string, because the destination is usually a write: a note, a category, a ticket field. Failing makes the gap visible at the step where it occurred, with the expression in the error message.

Practical consequences:

  • Optional values need a deliberate default: an IF Condition that guards the branch, or a Transform that supplies a fallback.
  • Renamed nodes break references: $node["…"] uses the node id, so duplicating and deleting nodes is safer than renaming.
  • Loops change $json per iteration; inside a loop, reference the loop item explicitly.
PlaceExpression support
Node configuration fieldsYes, for any field marked as a template
Condition field, operator, valueYes
Data Transform mappingYes, per key
HTTP Request URL and bodyYes — treat the result as untrusted input
Node labelNo
  • Typo in a node id → unresolved expression at runtime, not at save time.
  • Reading $json two steps later → gets the wrong value or nothing; use $node[…].
  • Expression inside a JSON field → quote it correctly; a template that produces "High" inside a JSON string becomes ""High"".
  • Branch that never runs → the reference fails for that path only, so a test on one branch does not cover the other.
  • Secrets in expressions → an expression cannot read a secret; use the provider or tool configuration.

Node reference · Testing and debugging · Examples · Data Transform node