Method Signature
Description
Thedownstream() method traverses the graph to find all nodes that the starting node depends on. This is useful for understanding the complete dependency tree of a service, library, or other asset.
The method performs a depth-first traversal following outgoing edges from the starting node, respecting the maximum depth constraint to prevent infinite loops.
Parameters
The unique identifier of the starting node. Should be in the format
type:name (e.g., service:payment-api, database:users-db).Maximum traversal depth to prevent infinite loops. Higher values allow deeper traversal but may impact performance on large graphs.
Optional list of edge types to follow during traversal. If provided, only edges matching these types will be followed. Common edge types include:
DEPENDS_ONUSESIMPORTSCALLS
Returns
A list of dependency nodes, each containing:
Examples
Basic Usage
Output Example
With Edge Type Filtering
Limited Depth Traversal
Analyzing Dependency Depth
Use Cases
- Dependency audits: Understand what your service relies on
- Security analysis: Identify all dependencies that could introduce vulnerabilities
- Migration planning: Find all components that need to be migrated together
- Build optimization: Analyze dependency chains for build improvements
- Technology stack analysis: Map out technology dependencies
See Also
- upstream() - Find what depends on this node
- blast_radius() - Complete impact analysis
- path() - Find specific paths between nodes