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.

Any field that shows a template accepts expressions; the prompt fields are the most common place to use them.
The context objects
Section titled “The context objects”| Object | Contains | Lifetime |
|---|---|---|
$trigger | The payload that started the run — webhook body, manual input, or schedule occurrence | Whole run, immutable |
$json | The output of the immediately preceding node on this path | One hop |
$node["<id>"] | The output of a specific earlier node | Whole run |
$vars | Reserved values for the run, when configured | Whole 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.
Syntax
Section titled “Syntax”{{ $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_sdpreturns the operation result, anai_agentreturns the assistant message plus tool trace, adata_transformreturns exactly the mapping you defined. - Conditions accept expressions in both sides: field and value may each be a template.
A worked example
Section titled “A worked example”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.
Why unresolved expressions fail the step
Section titled “Why unresolved expressions fail the step”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
$jsonper iteration; inside a loop, reference the loop item explicitly.
Where expressions are evaluated
Section titled “Where expressions are evaluated”| Place | Expression support |
|---|---|
| Node configuration fields | Yes, for any field marked as a template |
| Condition field, operator, value | Yes |
| Data Transform mapping | Yes, per key |
| HTTP Request URL and body | Yes — treat the result as untrusted input |
| Node label | No |
Limits and failure modes
Section titled “Limits and failure modes”- Typo in a node id → unresolved expression at runtime, not at save time.
- Reading
$jsontwo 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.
Related topics
Section titled “Related topics”Node reference · Testing and debugging · Examples · Data Transform node