GraphTopology

data class GraphTopology(val nodes: List<String>, val edges: List<GraphEdge>, val dynamicRoutes: Set<String>, val subgraphs: Map<String, GraphTopology> = emptyMap(), val forEachNodes: Set<String> = emptySet())

The structure of a compiled graph: its nodes and the edges between them. Read it from CompiledGraph.topology to draw the graph or to check it in a test.

Constructors

Link copied to clipboard
constructor(nodes: List<String>, edges: List<GraphEdge>, dynamicRoutes: Set<String>, subgraphs: Map<String, GraphTopology> = emptyMap(), forEachNodes: Set<String> = emptySet())

Properties

Link copied to clipboard

the nodes whose conditional edge declares no targets. Such a node can route to any node or to END, so it has no entries in edges.

Link copied to clipboard

every edge that is known before the graph runs: the static edges, the declared targets of conditional edges, and an edge to END for each node that has no outgoing edge.

Link copied to clipboard

the nodes that run their work for each item of a list, added with the forEach of StateGraph.node. They are in nodes and edges like any other.

Link copied to clipboard

the node names in the order they were added, without START and END.

Link copied to clipboard

the structure of the graph that a node added with StateGraph.subgraph runs, by the name of that node. The node is in nodes and edges like any other.

Functions

Link copied to clipboard

The nodes (or END) that node can lead to according to edges.

Link copied to clipboard
fun toMermaid(interruptBefore: Set<String> = emptySet(), interruptAfter: Set<String> = emptySet(), edgeLabels: Map<Pair<String, String>, String> = emptyMap()): String

Draws this graph as a Mermaid state diagram, which GitHub, GitLab and most documentation sites show as a picture in a code block of the language mermaid.