Back to Articles
Technical Guide April 9, 2026 4 min read

Run Context and Identity

By Fredrik Brattén

LangGraph Apache Airflow Temporal.io OpenTelemetry Pydantic LangChain Durable Functions
Cover image for: Run Context and Identity

Resources

  • LangGraph Documentation A framework for building stateful, multi-actor applications with LLMs that utilizes cyclic graphs and persistent state to manage execution identity.
  • Temporal: Workflow Executions Explains the fundamental concepts of durable execution, run IDs, and how state is maintained across complex distributed system lifecycles.
  • Prefect Runtime Context Documentation on how modern orchestrators track metadata, task identity, and environmental constraints during a pipeline run.
  • Reflexion: Language Agents with Verbal Reinforcement Learning A foundational research paper on Level 3 reflective awareness, where agents reason about their own execution traces to self-correct.

Tech Stack

LangGraphApache AirflowTemporal.ioOpenTelemetryPydanticLangChainDurable Functions

Key Takeaways

  • System identity in autonomous pipelines is defined by the Run Context, a formal data structure that integrates real-time execution state, structural architecture, and contextual purpose.
  • To achieve advanced self-correction, systems must move beyond simple execution to reflective awareness, where they can reason about and modify their own structural graphs during runtime.
  • A system’s identity is stabilized by four external anchors—initial task, constraints, environment, and feedback—which prevent execution degradation and self-referential collapse.
  • Effective design requires separating identity into three distinct layers: the active runtime node, the compiled structural pipeline, and the foundational contextual purpose.

Who this is for

AI system designers building autonomous agents and reflective execution pipelines

The Identity Problem

Part 11 ended with a question: when a system builds its own execution pipeline, what is "it"?

This is not a philosophical exercise. It is a design problem. If the system cannot identify itself - where it is in the graph, why it is running, what came before - then reflection, branching, and self-correction all become impossible.

"It" is not the pipeline. The pipeline is a structure that was compiled. "It" is the active run instance operating over that structure, within a context, under constraints.


Three Selves

A self-assembling system has three distinct aspects of identity:

Runtime Self

What is executing right now. The current node, the active tool call, the in-flight computation.

Structural Self

The pipeline or DAG that was built. The architecture the system compiled for itself.

Contextual Self

Why this exists. The original task, the constraints, the purpose. The identity seed.

If these are not separated, everything becomes fuzzy. The runtime self changes constantly. The structural self was determined at compilation. The contextual self is the anchor that gives meaning to the other two.


The Run Context

The missing formalization in most systems is the Run Context - the data structure that answers "what is it?" at any point during execution:

  • run_id - Unique identifier for this execution
  • task - The original request - the identity seed
  • graph - The compiled DAG being executed
  • current_node - Where execution is right now
  • history - What has already happened
  • state - Accumulated artifacts and evidence
  • constraints - What the system is allowed to do
  • environment - Available tools, skills, compute

Identity is defined by past (history) + present (current node) + future (graph) + constraints (rules) + purpose (task). Not just "what is next."

Run Context: what defines 'it' during execution

Run Context: what defines it during execution


Three Levels of Self-Awareness

Level 1: No Self-Reference

Node executes, passes output, next node runs. The system does not know what it is, where it is, or why it exists. Only: "what is next?" Purely forward-moving. Most systems operate here.

Level 2: Positional Awareness

"I am node 3 in a graph. I depend on node 2. My output feeds node 4." The system knows where it is in the pipeline, what came before, what comes next. This is where stability emerges.

Level 3: Reflective Awareness

The system can reason about the graph itself - whether the plan is valid, whether it should continue, whether the pipeline is wrong. "I am executing vulnerability-check, but dependency-analysis looks incomplete, so I should trigger a re-run." This is inflection. This is where the system can modify its own structure while inside it.


Four Sources of External Reference

A system's identity is not purely internal. It is anchored by four external sources:

Initial Task (Origin anchor): Defines purpose and success criteria. The identity seed.

Constraints (Boundary anchor): Defines what the system is allowed to be and do.

Environment (Execution anchor): Defines available tools, skills, data, and compute.

Feedback (Temporal anchor): Verification results, errors, confidence scores. Defines how it evolves.

Identity requires all three movements simultaneously: forward progression gives direction, external reference gives meaning, internal reflection gives control. Remove any one and the system degrades - blind execution, static rigidity, or self-referential collapse.


Branching

When the contextual self encounters ambiguity or conflicting strategies, it can trigger controlled divergence - branching the runtime into parallel hypotheses:

Run Context (identity) -> Branch Decision -> Branch A (plan variant 1), Branch B (plan variant 2), Branch C (plan variant 3)

Branches are hypothesis-bound executions. They share a parent identity but explore different paths. The identity is tree-structured, not duplicated.

But this raises a harder question: must the branches collapse into one? Must there be a reconciler?

Or can opposing paths coexist - and even improve each other?


This article is Part 12 of the From Meta-Prompt to Asset Factory series on Adaptivearts.ai.

Previously: The Cognitive Compiler - when 5PP starts compiling execution pipelines from a skill registry. Next: DIALECTIC as Control - when contradiction becomes a resource.

Share this article

Tags

#run context#system identity#execution pipelines#self-awareness#graph execution#ai architecture