Overview
Every workflow execution has a single Context Object that updates dynamically as the workflow progresses. It serves as the shared memory layer that nodes read from and write to, enabling data to flow through the entire pipeline. What it tracks:- Run Metadata - Identifiers, timestamps, and workflow configuration (
startDate,status,flowType,appId,versionId,cfProcessId) - Execution State - Each node’s progress and outcome (
steps,branch,activeSteps) - Environment & Config - Runtime parameters and settings (
env,agentTimeout,asyncExecDetails)
Structure
Top-Level Fields
The steps Object
steps is the most critical part of the Context Object—a map indexed by node name or ID that holds the state of each node in the workflow.
Example node structure:
Lifecycle
Thesteps map is populated sequentially as the workflow executes:
- Initialization - The
stepsobject starts empty. - Node Execution - An entry is created for each node as it begins running.
- Completion - Outputs and timing data are appended.
- Error Handling - Logs and status are updated;
branchreflects any failures.
Node Types Reference
Loop Node Context
When a loop node executes, it creates its own context object tracking the loop’s progress and results.Structure
The outputArray
Each item in outputArray represents one iteration’s result:
- Maintains the same order as the
inputsarray. - Each result is wrapped in an
outputobject. - The structure of each
outputdepends on what the loop produces.
Example
Inputs:["user1@example.com", "user2@example.com"]
Accessing Loop Data
Inside the loop – Use special context variables scoped to the current iteration:
Outside the loop - Access full results using the loop node’s ID:
Using the Context Object
Cross-Node Referencing
Nodes reference each other’s data through context interpolation using the{{ }} syntax. Values are resolved at runtime—no code required.
Reference Patterns
contextrefers to the full Context Object.stepsprovides scoped access to node-level data.- References work anywhere: input fields, API parameters, LLM prompts, and conditions.
Evaluation Behavior
- Lazy resolution - Values are resolved immediately before each node executes.
- Missing keys - Resolve to
null(or an empty string in string contexts). - Circular references - Automatically detected and blocked.
Typing
{{ in any field that supports context variables displays a dropdown of all available variables, grouped by node—including environment variables defined at the workflow level.Extending with Script Nodes
Script Nodes let you extend the Context Object programmatically during execution. This is useful for storing computed values, passing control variables across nodes, and persisting contextual data for downstream use.JavaScript
Python
Guidelines
- Use camelCase naming (
customerInfo,retryCounter,tempResults) - Do not override reserved keys:
steps,branch,status,dbquery - Keep data lightweight—avoid storing large arrays or raw API responses
- All keys added to the context are accessible downstream via
{{context.<key>}}
Best Practices
- Use consistent node naming for traceability (for example.
QueryGenerator,DataCleaner). - Mask sensitive data before writing it to the context.
- Prefer declarative references (
{{ ... }}) for readability whenever possible. - Use Script Nodes only when dynamic or computed context manipulation is required.