Skip to main content
The Context Object is the central runtime state container for every workflow execution—capturing inputs, node states, outputs, and metadata across the full lifecycle of a run.

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.
Each node entry contains: Example node structure:

Lifecycle

The steps map is populated sequentially as the workflow executes:
  1. Initialization - The steps object starts empty.
  2. Node Execution - An entry is created for each node as it begins running.
  3. Completion - Outputs and timing data are appended.
  4. Error Handling - Logs and status are updated; branch reflects 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 inputs array.
  • Each result is wrapped in an output object.
  • The structure of each output depends 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

  • context refers to the full Context Object.
  • steps provides 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

  1. Use consistent node naming for traceability (for example. QueryGenerator, DataCleaner).
  2. Mask sensitive data before writing it to the context.
  3. Prefer declarative references ({{ ... }}) for readability whenever possible.
  4. Use Script Nodes only when dynamic or computed context manipulation is required.