Data Flow & Conditions
Master template variables to pass data between nodes and use conditions to branch workflow logic.
What you'll be able to do after this module
- Write template variable expressions to reference any upstream node's output
- Understand how the variable system resolves data at execution time
- Build conditional branches that route execution based on runtime values
- Apply the three core data passing patterns: linear chain, fan-out, and conditional routing
Template Variables
Template variables are how nodes communicate. When you type in an action's config field, you can reference the output of any upstream node using this syntax:
{{@nodeId:NodeLabel.field}}| Part | Meaning | Example |
|---|---|---|
@nodeId | Internal ID of the source node | @abc123 |
NodeLabel | Display label of the source node | Generate Text |
.field | Path to a specific field in the output's data object | .text, .email, .data.status |
How to insert variables
- Click an action node to open the config panel
- Place your cursor in a template-enabled field (text input or textarea with the
{{ }}icon) - Type
{{— a dropdown appears showing all upstream nodes and their available output fields - Select a node and field to insert the full reference
Template variables are supported in Template Input and Template Textarea fields. Plain text, number, and select fields do not support variables.
Examples
{{@trigger:Webhook.body.customer_id}} → access webhook payload field
{{@node1:Scrape URL.markdown}} → scraped page content
{{@node2:Generate Text.text}} → AI-generated text
{{@node3:Get Customer.email}} → nested field (auto-unwrapped from data)Data resolution at runtime
When a step executes, the engine:
- Looks up the stored output for the referenced
nodeId - Automatically unwraps the standard
{ success, data, error }envelope — so.textactually accessesdata.text - Substitutes the resolved value into the config field before the action runs
If a referenced node hasn't executed yet (e.g., it's in a different branch), the variable resolves to undefined.
Data Passing Patterns
There are three fundamental patterns for wiring data through a workflow:
Pattern 1: Linear Chain
Each step reads from the step before it.
- Generate Text reads
{{@A:Scrape URL.markdown}} - Send Email reads
{{@B:Generate Text.text}}
This is the most common pattern — a sequential pipeline.
Pattern 2: Fan-Out
Multiple steps read from the same upstream node.
Here, the classifier output is consumed by three different actions. All three run after Classify Ticket completes.
Pattern 3: Conditional Routing
A Condition node evaluates an expression and routes to one of two branches.
The Condition checks whether the score meets a threshold. Only the matching branch executes.
The Condition Node
The Condition is a system action (no integration needed) that evaluates a boolean expression and routes execution to a true or false branch.
How to add a Condition
- Click + to add a new node
- Select Condition from System Actions
- Connect two outgoing edges from the Condition node — one for the true path, one for the false path
Writing Expressions
The expression field accepts template variables, literals, and operators:
Comparison operators:
| Operator | Meaning |
|---|---|
=== | Strict equality |
!== | Strict inequality |
> | Greater than |
< | Less than |
>= | Greater or equal |
<= | Less or equal |
Logical operators:
| Operator | Meaning |
|---|---|
&& | AND |
|| | OR |
! | NOT |
Value types:
| Type | Example |
|---|---|
| Variable | {{@node1:Score Lead.score}} |
| String literal | "active", "high" |
| Number literal | 42, 3.14 |
| Boolean literal | true, false |
Expression examples
// Simple comparison
{{@node1:Get Customer.status}} === "active"
// Numeric threshold
{{@node2:Score Lead.score}} > 80
// Compound logic
{{@node1:Get Customer.status}} === "active" && {{@node2:Score Lead.score}} > 50
// Negation
!{{@node3:Guard.detected}}Expressions are validated against a security whitelist. Only comparison and logical operators plus literals are allowed. Arbitrary code execution (function calls, property access chains, etc.) is blocked.
Branching behavior
- The true edge connects to the actions that run when the expression evaluates to
true - The false edge connects to the alternate path
- Each branch can have any number of downstream steps
- Only the matching branch executes — the other is skipped entirely
Practical Exercise: Priority Router
Build a workflow that classifies incoming support tickets and routes them based on priority.
Create the workflow
New workflow → change trigger to Webhook.
Set the webhook schema to:
{
"subject": "string",
"body": "string",
"customer_email": "string"
}Add the classifier
Add AI Gateway → Generate Text.
- Prompt:
Classify this support ticket as "high" or "normal" priority. Reply with only the word "high" or "normal".\n\nSubject: {{@trigger:Webhook.subject}}\nBody: {{@trigger:Webhook.body}} - Format:
text
Add the Condition
Add a Condition node.
- Expression:
{{@node1:Generate Text.text}} === "high"
Connect two outgoing edges: true path and false path.
Add the branches
True branch: Add Slack → Send Message
- Channel:
#support-urgent - Message:
🚨 High priority ticket from {{@trigger:Webhook.customer_email}}: {{@trigger:Webhook.subject}}
False branch: Add Linear → Create Ticket
- Title:
{{@trigger:Webhook.subject}} - Description:
From: {{@trigger:Webhook.customer_email}}\n\n{{@trigger:Webhook.body}} - Priority:
3(normal)
Test with mock data
Use the Mock Request field on the Webhook trigger to test without an actual HTTP call:
{
"subject": "Cannot access dashboard",
"body": "I'm locked out of my account and have a demo in 30 minutes",
"customer_email": "[email protected]"
}Click Run. The classifier should route this to the Slack urgent channel.
What you now understand
| Concept | What it means |
|---|---|
| Template variable | {{@nodeId:Label.field}} — references data from an upstream node |
| Auto-unwrap | Variables automatically access inside the data object |
| Linear chain | Sequential data pipeline: A → B → C |
| Fan-out | One node's output consumed by multiple downstream nodes |
| Conditional routing | Condition node splits execution into true/false branches |
| Expression whitelist | Only comparison/logical operators and literals allowed |
Up next: Triggers & Webhooks — make your workflows callable from the outside world.