Description
Subgraphs are reusable components that can be referenced in larger workflows. They allow you to define common patterns once and use them multiple times, improving maintainability and reducing duplication.Creating Subgraphs
Define subgraphs at the same level as the main graph with their owninputs, outputs, and nodes:
Using Subgraphs
Reference subgraphs using thesubgraph: prefix in the type field:
Subgraph Reference Syntax
Features
| Feature | Description |
|---|---|
| Nesting | Subgraphs can contain other subgraphs |
| Reusability | One subgraph can be called multiple times in the same workflow |
| Encapsulation | Internal node names don’t conflict with parent graph |
| Typed I/O | Subgraphs define their own typed inputs and outputs |