Overview
ExecutionContext is the runtime state container for workflow execution. It stores variables, resolves template expressions, and tracks node outputs.
Variable Management
setVariable / getVariable
hasVariable / deleteVariable
getAllVariables / clearAll / mergeVariables
Interpolation
interpolate
Resolves{{variable}} references in strings. If the entire string is a single reference, returns the actual value (not stringified).
interpolateObject
Recursively interpolates all strings in an object or array.Path Resolution
evaluateJsonPath
Evaluate JSONPath expressions against the variable store.Single results are automatically unwrapped from arrays.
resolveNestedPath
Resolve dot-notation paths including array indices.Node Output Storage
storeNodeOutput
Stores a node’s output and merges object keys to the root variable scope.getNodeOutput
Retrieve a specific node’s stored output.Context Conversion
toNodeContext
Create aNodeExecutionContext for passing to node executors.
Serialization
Factory Functions
All Methods
| Method | Signature | Description |
|---|---|---|
setVariable | (name: string, value: unknown): void | Set a variable |
getVariable | (name: string): unknown | Get a variable |
getAllVariables | (): Record<string, unknown> | Get copy of all variables |
hasVariable | (name: string): boolean | Check if variable exists |
deleteVariable | (name: string): void | Delete a variable |
clearAll | (): void | Clear all variables |
mergeVariables | (vars: Record<string, unknown>): void | Merge multiple variables |
evaluateJsonPath | (path: string): unknown | Evaluate JSONPath expression |
interpolate | (template: string): unknown | Interpolate {{var}} in string |
interpolateObject | <T>(obj: T): T | Recursively interpolate object |
resolveNestedPath | (path: string): unknown | Resolve dot-notation path |
storeNodeOutput | (nodeId: string, output: unknown): void | Store node output |
getNodeOutput | <T>(nodeId: string): T | undefined | Get stored node output |
toNodeContext | (userId, workflowExecutionId, campaignId?): NodeExecutionContext | Create executor context |
toJSON | (): Record<string, unknown> | Export variables |
static fromJSON | (json): ExecutionContext | Create from serialized data |

