---
title: 'Directed acyclic graph (DAG)'
description: 'A directed graph with no path that returns to an earlier node.'
canonical_url: 'https://darkfactory.dev/glossary/directed-acyclic-graph'
markdown_url: 'https://darkfactory.dev/glossary/directed-acyclic-graph.md'
collection: glossary
date_published: '2026-08-04T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Directed acyclic graph (DAG)


## Definition

A directed acyclic graph, or DAG, is a directed graph with no path that returns to an earlier node. Its edges have direction, and the absence of cycles makes it possible to order nodes so every dependency appears before the work that depends on it.

DAGs fit one-way dependency structures such as build pipelines, data transformations, and task plans whose steps never need revision. They also make concurrency visible: independent nodes can run in parallel once their prerequisites are complete.

Many agent workflows are not DAGs. Retrying, revising a draft, asking for more information, and returning to a prior decision all introduce cycles or require state outside the graph.

## Distinguish it from nearby terms

A workflow is an operational process. A DAG is one possible structure for representing its dependencies. A control graph may contain cycles, while every DAG is acyclic by definition.

## Check your understanding

A plan has steps A, B, and C, but a failed C sends the run back to B. The happy path resembles a DAG; the actual control graph does not.

## Also called

DAG

## Related terms

- [Control graph](https://darkfactory.dev/glossary/control-graph)
- [Execution graph](https://darkfactory.dev/glossary/execution-graph)
- [Workflow](https://darkfactory.dev/glossary/workflow)
- [Agent loop](https://darkfactory.dev/glossary/agent-loop)

## Related factory areas

- [Orchestration, state, concurrency & recovery](https://darkfactory.dev/factory/orchestration-state)

## Evidence and further reading

- [LangChain: 3 Years of Graph Engineering with LangGraph](https://www.langchain.com/blog/3-years-of-graph-engineering-with-langgraph)
