$global — Tenant Globals
$global provides read-only access to tenant-wide constants configured by the tenant administrator in the platform settings. These values are shared across all workflows for the tenant and are always available in every expression, regardless of execution state.
What $global Contains
Tenant globals are key-value pairs stored in the platform's tenant configuration store. They are typically used for constants that apply across many workflows — currency codes, API base URLs, threshold values, feature flags, and similar tenant-specific settings.
| Example Global | Example Value | Use |
|---|---|---|
$global.defaultCurrency | "USD" | Used in invoicing and reporting workflows |
$global.maxApprovalAmountUsd | 50000 | Threshold for automatic approval in purchase workflows |
$global.supportEmail | "support@acme.com" | Used in notification templates |
$global.apiBaseUrl | "https://api.acme-internal.com" | Used in HTTP request node URLs |
$global.features.aiSummary | true | Feature flag checked in conditional branches |
Expression Examples
// Using a global constant in an HTTP URL
"{{$global.apiBaseUrl}}/customers/{{$json.body.customerId}}"
// Using a threshold in a condition
$input.orderTotal > $global.maxApprovalAmountUsd
// Using a global in a template expression
"Payment of {{$input.amount}} {{$global.defaultCurrency}} processed."
// Nested global access (if admin configured nested objects)
$global.features.aiSummary == true
How $global Is Populated
The expression context is populated by ExpressionContext.cs at the start of expression evaluation. Tenant globals are loaded from the TenantGlobalVariableService, which reads from a cached configuration store keyed by TenantId. They are not reloaded per-node — they are loaded once per expression evaluation context.
// ExpressionContext.cs (simplified)
public class ExpressionContext
{
public JsonElement Global { get; init; } // Populated from TenantGlobalVariableService
// Usage: $global.{key} resolves as:
// Global.GetProperty(key) — returns JsonElement (null-safe navigation)
}
$global vs. $var vs. ctx.ExecutionMemory.SetGlobal
| Prefix | Set By | Scope | Mutable? |
|---|---|---|---|
$global | Tenant administrator in platform settings | Tenant-wide, all workflows, all executions | No — read-only in expressions |
$var.{name} | SetVariable node in the workflow canvas | Single execution | Yes — updated by SetVariable nodes |
| ctx.ExecutionMemory.SetGlobal | Executor C# code | Single execution (same dictionary as $var) | Yes — updated by executor code |
Caching and Updates
Tenant globals are cached for a configurable TTL (default 5 minutes). If an admin updates a global constant, running executions may see the old value until the cache refreshes. For values that change frequently, use a different mechanism (SetVariable node, API call node) rather than tenant globals.
$global itself is never null — it is an empty object if no globals are configured. However, $global.someKey returns null if someKey is not in the configuration. Use null-safe navigation when accessing globals that may not be configured: $global.features?.aiSummary ?? false.