ADR-013: Native DAG as Single Supported Execution Engine¶
Status: Accepted Date: 2026-04-20 Supersedes: ADR-001 Superseded by: N/A
Context¶
The agentic-workflows-v2 runtime has maintained two parallel execution engines since its inception:
-
Native DAG executor (
agentic_v2/engine/) — Kahn's topological-sort algorithm withasyncio-driven wavefront parallelism. Implements theExecutionEngineprotocol directly with no third-party runtime dependency. -
LangGraph adapter (
agentic_v2/adapters/langchain/,agentic_v2/langchain/) — A wrapper aroundlanggraph.StateGraph/ Pregel, providing an alternative execution path for the same YAML workflow definitions.
ADR-001 ratified a "common interface" transitional architecture converging toward a single engine. The platform has since completed that transition: the native DAG executor now satisfies all production requirements, the LangGraph adapter adds an optional dependency on langchain-core, langgraph, and several provider-specific packages, and no active workflows require LangGraph-specific capabilities (cycles, langgraph-checkpoint-sqlite, human-in-the-loop interrupts).
Maintaining the adapter creates ongoing costs:
- Dependency surface: The
langchainoptional extra pulls in 8+ packages with separate release cadences. - Dual-engine test matrix: Every new engine feature requires verification against two backends (ADR-F1 contract suite).
- Behavioral divergence risk: Subtle differences in state management, error propagation, and streaming semantics between Pregel and Kahn's algorithm require continuous reconciliation.
- Onboarding friction: New contributors must understand two execution models.
Decision¶
The native DAG executor (agentic_v2/engine/, Kahn's algorithm) is the single supported execution engine for agentic-workflows-v2.
The LangGraph adapter (agentic_v2/adapters/langchain/ and agentic_v2/langchain/) is deprecated as of this ADR. Both entry points now emit a DeprecationWarning on import.
The adapter will be removed in a future release to eliminate the optional-extras dependency surface and reduce the test matrix.
Consequences¶
Positive¶
- Single execution model to maintain, test, and document.
- Eliminates
langchain,langgraph, and associated provider packages from the optional dependency tree after removal. - Reduces CI matrix: no dual-engine contract suite after removal.
- Clearer onboarding: contributors learn one DAG executor.
Negative¶
- Consumers who directly import
agentic_v2.langchainoragentic_v2.adapters.langchainwill see deprecation warnings until they migrate. - Workflows using LangGraph-specific features (cycles,
SqliteSavercheckpointing, time-travel) must be refactored before the removal milestone. - The
langchainoptional extra will be removed frompyproject.tomlat the removal milestone.
Migration path¶
- Replace any
agentic_v2.langchain.WorkflowRunnerusage with the nativeAdapterRegistry.get("native")path. - Replace
agentic_v2.langchain.compile_workflow/get_chat_modelwith equivalents fromagentic_v2.modelsandagentic_v2.engine. - Validate migrated workflows against the native DAG executor test suite.
Removal Milestone¶
LangGraph adapter removal target: v2.0, 2026-Q3.