Find Paths
find_pathsDetermine how two Infrahub objects are connected by tracing the shortest path(s) between them in the graph. Returns 0 if no path exists within max_depth.
Instructions
Find the shortest path(s) between two nodes in the Infrahub graph.
Use this to answer "how are these two objects connected?". A result with
count of 0 means no path exists within max_depth. Requires Infrahub 1.10+.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | Branch to query. Defaults to the default branch. | |
| source | Yes | Start node: a UUID or kind-qualified HFID (e.g. 'InfraDevice__atl1-edge1'). | |
| max_depth | No | Maximum relationship hops to explore (1-30). | |
| destination | Yes | End node: a UUID or kind-qualified HFID. | |
| kind_filter | No | Only traverse through nodes of these kinds. | |
| relationship_filter | No | Only follow these schema relationship identifiers (e.g. 'device__interface'). |