Portal Community

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 GlobalExample ValueUse
$global.defaultCurrency"USD"Used in invoicing and reporting workflows
$global.maxApprovalAmountUsd50000Threshold 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.aiSummarytrueFeature 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

PrefixSet ByScopeMutable?
$globalTenant administrator in platform settingsTenant-wide, all workflows, all executionsNo — read-only in expressions
$var.{name}SetVariable node in the workflow canvasSingle executionYes — updated by SetVariable nodes
ctx.ExecutionMemory.SetGlobalExecutor C# codeSingle 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 is always non-null at the top level. $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.