Skip to main content

Directed Acyclic Graph (DAG)

All Conductor workflows are directed acyclic graphs (DAGs). A DAG is a set of vertices connected by unidirectional edges, with no cycles or repeated paths. Workflows modeled as DAGs can only move forward and cannot revisit a step or series of steps.

Here is a breakdown of what DAG means:

  • Graph

A graph is a collection of vertices (points) and edges (lines) representing connections between them.

a regular graph (source: wikipedia)

Each vertex can represent a microservice, and each edge represents a dependency between microservices. The graph above is not yet directed because its edges have no direction.

  • Directed

In a directed graph, each connection (edge) has a direction.

directed graph

In the example above, point N can proceed to B, but B cannot proceed directly back to N.

  • Acyclic

Acyclic means without circular paths. A cyclic directed graph contains paths that loop back to an earlier point, such as A → B → D → A. A directed acyclic graph can only move from a start point to an end point, such as A → B → D.

Workflows as DAGs

A Conductor workflow is a DAG: tasks connect in a specific direction and cannot circle back. The order and structure of tasks are defined in the tasks array in the workflow definition JSON, or generated by an SDK.

Conductor Dag

Can a workflow contain loops and still be a DAG?

Yes. A workflow can include Do While tasks and still be a DAG because the loop is a simplified way to represent repeated instances of the same tasks. Each iteration creates a new task instance, so the execution path remains acyclic.