/pattern/workflow-dag/

04 · ProductionRuntime ArchitectureDurable WorkflowDAG OrchestrationResumable Workflow

Workflow DAG.
A graph that can be drawn.

Workflows are operated as persistent execution graphs featuring resumability, retries, and state history.

In practiceA document-processing pipeline runs OCR, classification, and archival as nodes in a durable graph, replaying only the failed node after a transient storage error.

When to reach for it

  • Runs take a long time or can fail.
  • States and retries must be robustly managed.
  • Production demands traceability.

When it backfires

  • Tasks are brief and stateless.
  • Persistence creates unnecessary operational load.
  • The graph model does not fit the execution flow.

The tradeoff

Production robustness is achieved at the expense of infrastructure and modeling effort.

The effect

What it actually does.

Tasks execute as a durable directed graph.

starttasktaskend
Pitfalls

Two ways this pattern will hurt you.

Hidden cycles in the DAG

A conditional edge creates an implicit cycle that the DAG validator misses. The workflow loops indefinitely at runtime.

Fix · Run a static cycle check at build time. Reject any graph that contains a back-edge unless it's explicitly declared as a loop.

Over-static DAGs forcing pipeline-shaped problems

Every new requirement gets squeezed into the existing DAG shape. The graph becomes a tangled mess of conditional hacks.

Fix · Re-evaluate the DAG topology quarterly. If conditional edges exceed 30% of total edges, consider decomposing into smaller graphs.

Framework support

Where Workflow DAG is native.

LangGraphdurable graph runtimeNative
AWS StrandsAWS Strands WorkflowNative
Google ADKworkflow graphsNative
Microsoft Agent Frameworkdurable workflowsNative
CrewAICrewAI FlowsNative

Search

Search patterns, frameworks, and pages.