Flow Studio
Variable Scoping
Flow Studio expressions use six variable prefixes to reference data at different scopes. Understanding which prefix to use — and when each is available — is fundamental to writing reliable node configurations and expression conditions.
The Six Prefixes
| Prefix | What It References | Always Available? | Mutable? |
|---|---|---|---|
$json | The raw trigger payload — the data that started this workflow execution | Yes | No — read-only |
$input | Output of the immediately preceding node (primary input port) | No — null for the first node | No — read-only |
$output.{nodeId} | Output of any specific node by its ID | No — null until that node has run | No — read-only |
$var.{name} | A mutable execution variable set by a SetVariable node | No — null until SetVariable has run | Yes — can be updated by SetVariable nodes |
$global | Tenant-wide read-only constants configured in the platform | Yes | No — tenant admin sets these outside of workflows |
$context | Execution metadata: executionId, tenantId, actorId, timestamp | Yes | No — read-only |
Prefix Quick Reference
// $json — trigger payload
$json.body.customerId
$json.headers["x-correlation-id"]
// $input — output of the immediately preceding node
$input.invoiceTotal
$input.items[0].sku
// $output.{nodeId} — output of a named node
$output.fetch-customer.tierLevel
$output.validate-order.isValid
// $var.{name} — mutable execution variable (set by SetVariable node)
$var.retryCount
$var.selectedRegion
// $global — tenant-wide constants (admin-configured)
$global.defaultCurrency
$global.maxApprovalAmountUsd
// $context — execution metadata
$context.executionId
$context.actorId
$context.tenantId
$context.startedAt
Scope Boundaries
All six variable prefixes are scoped to a single execution run. None of them carry values from a previous execution. If you need cross-execution data, use pinned data (ctx.ExecutionMemory.GetPinnedData) or tenant globals ($global).
Guide Contents
| Page | What You Will Learn |
|---|---|
| $json | The trigger payload — HTTP body, event payload, scheduled data |
| $input | Immediate upstream output — null for first-node expressions |
| $output.{nodeId} | Named node output — how to reference any node in the graph |
| $var.{name} | Mutable workflow variables set by SetVariable nodes |
| $global | Tenant-wide constants — configured by tenant admins |
| $context | Execution metadata fields always available in any expression |
| Availability Table | Matrix of which prefixes are available at each node position |
| Common Mistakes | Using $output before a node has run, initializing $var too late, and other frequent errors |
$global is NOT the same as SetGlobal in executors. The
$global expression prefix refers to tenant-wide constants configured by administrators in the platform settings. The SetGlobal/GetGlobal executor API is for within-execution state. The names are similar but they serve different purposes.