Skip to main content

Expression Reference

Complete reference for all expression variables available in TARX workflows. Expressions use the {{variable.field}} syntax and are evaluated at runtime when a node executes.


Trigger Node

Node type: triggerNode

ExpressionTypeDescriptionExample Value
{{trigger.output}}stringThe trigger's output — main entry point for all workflows"artificial intelligence"

By Trigger Type

Trigger Type{{trigger.output}} Value
ManualThe string entered in the run modal
WebhookFull JSON payload, or extracted field if payload_path is set
ScheduleThe default_input configured on the trigger
HTTPFull request context JSON: {"method": "POST", "headers": {...}, "body": {...}, "query_params": {...}}

Agent Node

Node type: agentNode

The expression variable uses the agent's name (from Agent Editor), not the canvas node label.

ExpressionTypeDescription
{{agent_name.output}}stringThe full text output from the LLM call

Multiple Agents in One Workflow

All previous agents' outputs are available to any downstream node:

# In a third agent node's input:
Research: {{researcher.output}}
Draft: {{writer.output}}
Please review and combine these.

Caveat: Can only reference agents that have already completed (upstream agents). Referencing a downstream or non-existent agent returns empty string.


Loop / Iterator Node

Node type: loopNode

ExpressionTypeAvailable InDescription
{{loop_name.current_item}}stringInside loop bodyCurrent item being processed
{{loop_name.index}}intInside loop body0-based index of current iteration
{{loop_name.output}}string (JSON array)After loop completesJSON array of all iteration results

Example Values

For a loop named content_loop iterating over ["topic A", "topic B", "topic C"]:

During iteration 1:

  • {{content_loop.current_item}}"topic A"
  • {{content_loop.index}}0

During iteration 2:

  • {{content_loop.current_item}}"topic B"
  • {{content_loop.index}}1

After all iterations:

  • {{content_loop.output}}["result for A", "result for B", "result for C"]

Branch Node

Node type: branchNode

ExpressionTypeDescription
{{branch_name.output}}string"True" or "False" based on condition evaluation

The branch node also exposes output as a plain variable in the condition expression itself (not via {{...}} syntax — it's a Python variable in the condition field).


Merge Node

Node type: mergeNode

ExpressionTypeDescription
{{merge_name.output}}stringOutput from the completed branch (first mode) or combined outputs (all mode)

Human-in-Loop Node

Node type: humanLoopNode

ExpressionTypeDescription
{{hil_name.output}}stringDecision result including any reviewer comment

HiL Output Format

DecisionOutput Value
Approved (no comment)"approved"
Approved with comment"approved: [reviewer's comment]"
Rejected with comment"rejected: [reviewer's comment]"
Timeout auto-reject"rejected: timeout — approval expired after N hours"

Output Node

Node type: outputNode

Output nodes are leaf nodes — they don't expose expressions to other nodes (they're the final collection point). Their value field uses expressions from upstream nodes.


Expression Resolution Rules

1. Execution Order

Expressions resolve to empty string "" if the referenced node hasn't completed yet. Nodes can only reference upstream (already-completed) nodes.

# Valid: writer comes after researcher
researcher → writer
writer's input: "{{researcher.output}}" ✅

# Invalid: researcher references writer which hasn't run yet
writer → researcher
researcher's input: "{{writer.output}}" → "" ❌

2. Case Sensitivity

Agent names in expressions are case-sensitive and must exactly match the agent's name as configured in the Agent Editor.

# Agent named: researcher (lowercase)
{{researcher.output}} ✅ Matches
{{Researcher.output}} ❌ Does not match (returns "")
{{RESEARCHER.output}} ❌ Does not match (returns "")

3. Whitespace in Names

Agent names cannot contain spaces (the Agent Editor enforces this). Use hyphens: seo-writer, not seo writer.

{{seo-writer.output}} ✅ Valid
{{seo writer.output}} ❌ Invalid syntax

4. Nested Expressions

Expressions cannot be nested:

{{{{agent1.output}}.something}} ❌ Not supported

Use a Transform node (JSONPath) to extract a field, or have an agent produce the simple string you need for downstream use.

5. Expression in Different Field Types

Field TypeExpression Support
Text input fields✅ Full expression support
Dropdown selectors❌ No expression support
Boolean toggles❌ No expression support
Numeric fields⚠️ Limited — {{loop.index}} works if the field accepts the resulting numeric string

Condition Expression Variables

In Branch node condition fields, these Python variables are available (not {{...}} syntax — these are direct Python variables):

VariableTypeValue
outputstrOutput of the immediately upstream node
trigger_outputstrThe original trigger output
node_outputsdictAll completed node outputs: {"agent_name": "output_text"}

Condition Examples Using Variables

# Basic string check using output
"error" in output.lower()

# Length check
len(output) > 500

# Access specific agent output
node_outputs.get("researcher", "") != ""

# Parse JSON from agent output
__import__('json').loads(output).get("severity") == "critical"

# Cross-reference two agents
node_outputs["reviewer_1"].strip() == node_outputs["reviewer_2"].strip()

# Numeric comparison
float(output.strip()) > 0.8

Complete Example

A workflow with all node types, showing which expressions are available at each step:

1. Trigger (Manual): "research quantum computing"
→ {{trigger.output}} = "research quantum computing"

2. Loop: item_loop, items = ["quantum gates", "quantum error correction", "quantum supremacy"]
During iteration 1:
→ {{item_loop.current_item}} = "quantum gates"
→ {{item_loop.index}} = 0

3. Agent: researcher, input = "Research: {{item_loop.current_item}} in context of {{trigger.output}}"
→ {{researcher.output}} = "Quantum gates are the building blocks..."

4. Agent: writer, input = "Write intro based on:\n{{researcher.output}}"
→ {{writer.output}} = "In the world of quantum computing..."

5. Branch: is_long, condition = "len(output) > 500"
→ {{is_long.output}} = "True" or "False"

6. [True path] Agent: summarizer, input = "Summarize:\n{{writer.output}}"
→ {{summarizer.output}} = "A brief summary..."

7. [False path] Agent: expander, input = "Expand to 300 words:\n{{writer.output}}"
→ {{expander.output}} = "Expanded version..."

8. Merge: content_merge
→ {{content_merge.output}} = whichever path ran

9. After loop completes:
→ {{item_loop.output}} = ["result 1", "result 2", "result 3"]

10. Output: {{item_loop.output}}