Docs/Variables & References

Variables & References

Learn how to pass data between nodes using the variable reference system.

Overview

In XYZGent, nodes communicate by passing data through a shared context. You can reference the output of any previous node in your prompts, configurations, and templates using the {{variable.path}} syntax.

Key Concept: Each node stores its output in the workflow context under its node ID. Downstream nodes can then read these values.

Basic Syntax

PatternDescriptionExample
{{inputs.field}}Access workflow input data{{inputs.query}}
{{node_type.field}}Access output by node type{{llm.text}}
{{node_id.field}}Access output by specific node ID{{llm_1234567890.text}}
{{sys.field}}Access system variables{{sys.timestamp}}

Node Type Aliases

For convenience, you can reference nodes by their type instead of their full ID. The system will automatically find the matching node from your workflow.

{{inputs...}}

Workflow input data (form, webhook, etc.)

{{form...}}

Form node submission data

{{llm...}}

LLM node response

{{knowledge...}}

Knowledge/RAG node results

{{document...}}

Document extraction results

{{code...}}

Code node return value

{{object...}}

Object Builder output

{{http...}}

HTTP Request response

{{database...}}

Database query results

{{tool...}}

Tool execution result

{{human-input...}}

Human Input response

{{iteration...}}

Current item in loop

Nested Access

Access nested objects and arrays using dot notation:

// Access nested object property
{{llm.extracted_data.customer.name}}

// Access array element by index
{{knowledge.documents.0.content}}

// Access array element property
{{database.rows.0.email}}

System Variables

These special variables are always available:

VariableDescriptionExample Value
{{sys.timestamp}}Current ISO timestamp2024-01-15T10:30:00Z
{{sys.date}}Current date (YYYY-MM-DD)2024-01-15
{{sys.run_id}}Unique workflow run IDrun_abc123xyz

Common Patterns

LLM Prompt with Form Data

Analyze this customer inquiry:

Customer Name: {{form.name}}
Email: {{form.email}}
Message: {{form.message}}

Categorize and respond appropriately.

RAG with Knowledge Context

Based on the following context from our knowledge base:

{{knowledge.context}}

Answer this question: {{inputs.query}}

Chaining Multiple Nodes

// Email node using data from multiple upstream nodes:

To: {{form.email}}
Subject: Analysis Complete - {{llm.category}}
Body: 
Hi {{form.name}},

Based on our analysis, your request has been categorized as: {{llm.category}}

Summary: {{llm.summary}}

Next steps will be sent shortly.

Tips

  • •Use type aliases (e.g., {{llm.text}}) for cleaner, more readable workflows
  • •If a variable doesn't exist, it resolves to an empty string
  • •Arrays and objects are automatically JSON-stringified when used in text
  • •Use the workflow test feature to debug variable resolution

Start Building

Now that you understand variables, explore the node documentation to see what data each node outputs.

Explore Nodes