Skip to main content

Graph Traversal

Use Graph Traversal to navigate the relationships in your infrastructure data — trace every path between two objects, or find everything that depends on a given object across your entire graph.

Infrahub version

Graph Traversal was released in 1.10.

Two modes

Graph Traversal has two modes, each suited to a different question.

Path mode — select a source and destination object to see every path between them, ordered shortest first, with the hop count for each route. Use it when you know both ends and want to understand how they connect.

Dependency mode — select a source object and the kinds of object you care about to find every reachable object of those kinds. Use it when you know the starting point but not the endpoints — for blast-radius analysis, impact assessment, or dependency discovery.

When to use each mode

GoalModeYou provideResult
Trace the connection between two known objectsPathA source and a destination objectEvery path between them, with hop counts
Find what an object affects or depends onDependencyA source object and one or more target kindsEvery reachable object of those kinds, with the path from the source to each

Use Path mode when you know both ends — for example, tracing connectivity between two devices while investigating packet loss. Use Dependency mode when you know the starting point but not the endpoints — for example, finding every service that depends on a circuit before a maintenance window.

Branch and time context

When you run Graph Traversal on a branch, the results reflect that branch's state rather than the default branch. Run it against a point in time to see relationships as they were then.

Permissions

Graph Traversal applies your view permissions. If you cannot view a kind of object, paths through that kind are excluded — so you never see objects outside your access.

What's included in results

By default, your results skip Infrahub's internal data model and stay focused on your infrastructure. Nodes in the Core, Internal, Builtin, Lineage, Profile, and Template namespaces are excluded, along with BuiltinIPNamespace and the kinds that inherit it. To widen or narrow this, use the namespace and kind filters in the GraphQL API — see the Graph Traversal reference.

Where you can use it

SurfaceAccess
Web interfaceObject Management → Path Traversal; or Find paths in any object's Actions menu
GraphQL APIInfrahubPathTraversal and InfrahubReachableNodes — see Query traversal with GraphQL
Python SDKtraverse_paths, reachable_nodes, and path_exists — see the SDK graph traversal guide
MCP serverComing soon

Because Graph Traversal is also available through the MCP server, an AI agent can trace the same relationships you rely on, grounded in your real data model.