Skip to main content
GraphAI has two ways for one node to lead to more than one node. A fork (two or more regular edges) runs successors concurrently as part of the main path. A branch runs a side pipeline that stays out of the main path. They look similar on a diagram and behave very differently.

The Same Nodes, Two Wirings

As a fork

As a branch

What Differs

Choosing

Use a fork when the paths are parts of one result and the graph needs all of them before it can continue, such as running several tools at once and then deciding what to do with the combined output. Use a branch when the work is a consequence of a node running and the main path should not depend on it, such as writing a log row, notifying another system, or syncing data after a tool call.

Inside a Router Loop

The difference matters most in a loop. Here a router repeatedly calls a tool and the tool returns to the router:
Adding a fork off the tool changes how the loop terminates, because the router path is now one arm of a fork that expects to join. Adding a branch does not:

Mixing Them

A branch’s pipeline may itself fork and join, and a node inside a pipeline may have branches of its own:

Next Steps