Skip to content

graph

diapason.workflow.graph

WorkflowGraph — DAG with validation and topological sort.

WorkflowGraph

Directed acyclic graph of workflow nodes.

Supports DAG validation (cycle detection), topological sort, and execution_stages() for parallel-ready ordering.

execution_stages()

Group nodes into parallel execution stages.

Nodes in the same stage have no dependencies on each other and can be executed concurrently.

topological_sort()

Return node IDs in topological order (Kahn's algorithm).

validate()

Validate the graph: check for cycles and orphan nodes.