Flow Studio
Context Variable Reference
Every expression has access to a set of well-known context variables injected by the resolver. These correspond to the data sources in EvaluationContext and cover the most common reference patterns in workflow configuration.
Directive Syntax Summary
| Directive | Data Source | Example |
|---|---|---|
@{output:{nodeId}.{field}} |
Completed node's output data (NodeOutputs[nodeId]) |
@{output:http-req-1.statusCode} |
@{output:{nodeId}} |
Full output dictionary of a completed node | @{output:json-transform-1} |
@{input:{field}} |
Data arriving at the current node from the upstream connection | @{input:email} |
@{var:{name}} |
Workflow variable set by a Variable Assignment node | @{var:totalCount} |
@{context:tenantId} |
Tenant ID from the execution context | @{context:tenantId} |
@{context:executionId} |
Current execution ID (UUID) | @{context:executionId} |
@{context:userId} |
ID of the user who triggered the execution | @{context:userId} |
@{js:{expression}} |
Arbitrary JavaScript — evaluated by Jint with all above as variables | @{js: $output['form-1'].age >= 18} |
JavaScript Variable Injection (for @{js:...})
When a @{js:...} expression is evaluated, the following JavaScript variables are injected into the Jint scope:
| JS Variable | Contents |
|---|---|
$output | Object keyed by nodeId — each value is that node's OutputData dictionary |
$input | The current node's input data dictionary |
$var | Object of all workflow variables |
$context | Object with tenantId, executionId, userId, correlationId |
$global | Execution-scoped global data (trigger payload, initial input) |
Examples
// Reference a specific field from a completed node
Recipient Email: @{output:form-submission-1.email}
// Build a full name from two fields
Display Name: @{js: $output['form-submission-1'].firstName + ' ' + $output['form-submission-1'].lastName}
// Check a workflow variable
Max Retries: @{var:maxRetries}
// Conditional value
Priority: @{js: $output['order-check-1'].isPremium ? 'high' : 'normal'}
// Use tenant ID in an API path
API Path: /api/tenants/@{context:tenantId}/records
// Reference current input (for pass-through nodes)
Forward: @{input:payload}
Null and Missing Values
If a referenced node has not yet executed, or a variable has not been set, the directive resolves to null. JavaScript expressions receiving null follow standard JavaScript null-coalescing rules. Use ?? or conditional checks in @{js:...} expressions to handle missing values gracefully.
// Safe access with null fallback
@{js: ($output['maybe-skipped-1']?.result) ?? 'default-value'}