Portal Community

$context Fields

FieldTypeDescription
$context.executionIdstring (GUID)Unique ID for this execution run — use for correlation and audit logs
$context.processIdnumberThe workflow definition ID — same for all executions of the same workflow
$context.tenantIdstringThe tenant this execution belongs to
$context.actorIdstring | nullUser ID of the person or system that triggered the execution; null for scheduled jobs
$context.startedAtISO 8601 stringUTC timestamp when the execution started
$context.triggeredBystring | nullDisplay label for the trigger source: user name, cron job name, or API key label

Expression Examples

// Include executionId in a log or notification message
"Execution {{$context.executionId}} started by {{$context.triggeredBy}}"

// Use tenantId in a URL to route to a tenant-specific endpoint
"https://api.example.com/tenants/{{$context.tenantId}}/orders"

// Use actorId in an audit log node's payload
{
  "action"     : "workflow-run",
  "actorId"    : "{{$context.actorId}}",
  "executionId": "{{$context.executionId}}",
  "timestamp"  : "{{$context.startedAt}}"
}

// Conditional branch based on who triggered the run
$context.actorId == "system-scheduler"

$context in Notification Templates

$context.actorId and $context.triggeredBy are commonly used in notification node templates to include attribution information in emails or Slack messages.

// Email node body template
"Your order approval workflow (Execution ID: {{$context.executionId}}) was started by
{{$context.triggeredBy ?? 'an automated system'}} at {{$context.startedAt}}."

Read-Only Guarantee

$context fields are populated from ExecutionMetadata at the start of execution and are immutable. No node or executor can modify $context values. They always reflect the values set when the execution was created.

Relationship to ctx.ExecutionMemory.Metadata

The same fields available via $context in expressions are also available in executor C# code via ctx.ExecutionMemory.Metadata:

// In executor code — same data as $context fields
ctx.ExecutionMemory.Metadata.ExecutionId   // = $context.executionId
ctx.ExecutionMemory.Metadata.ProcessId     // = $context.processId
ctx.ExecutionMemory.Metadata.TenantId      // = $context.tenantId
ctx.ExecutionMemory.Metadata.TriggeredBy   // = $context.triggeredBy
ctx.ExecutionMemory.Metadata.StartedAt     // = $context.startedAt
$context.actorId is null for scheduled and system-triggered executions. When a workflow is triggered by a cron schedule or internal system event, there is no human actor. Check for null before using actorId in audit or attribution contexts: $context.actorId ?? 'system'.