Skip to main content
A Data Engine graph is not just a static collection of nodes and connections - it has a defined execution model that determines which nodes run, in what order, and when execution stops. Understanding this model is essential for building graphs that branch, loop, or terminate cleanly.

Roots and ends

Every graph has exactly one root node. The root is where execution begins. From the root, execution follows the connections drawn between nodes, visiting each downstream node and running the operation it defines. Every graph also has at least one end node. An end node is what captures the final output of the graph. A graph without an end node cannot produce a result.

Termination

Execution proceeds from the root until it reaches an end node. Once an end node has been reached, execution stops. The value present on the end node when it is reached is the graph’s output, and no further nodes are evaluated even if other paths exist in the graph. This is important to keep in mind when designing graphs with multiple end nodes: only one of them will actually be reached for any given execution. Which one is reached is determined by the path execution takes through the graph.

Branching with switch

The switch node directs execution down one of several alternative paths based on a condition. When execution reaches a switch, only the branch matching the chosen case is followed; the other branches are not visited at all. This means that after a graph involving switches has run, some nodes will have been executed and some will not. Nodes on untaken branches are simply skipped - they do not produce values and do not influence the outcome.

Loops with each

The each node iterates over a list, executing a subgraph once per element. The subgraph attached to the each node’s loop ports has its own root and its own end nodes, but those end nodes behave differently from the top-level end nodes described above:
An end node reached inside an each subgraph terminates that iteration of the loop, not the parent graph.
In other words, an end node inside an each subgraph signals “this iteration is done, move on to the next element” rather than “the whole graph is done.” Once the loop has visited every element, execution returns to the parent graph and continues from the each node. This is the only place where reaching an end node does not terminate execution outright.