# GetSubgraph()

> Retrieves the subgraph linked to this node.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
Graph GetSubgraph()
```

### Returns

| Type                                                                        | Description                                                                                                         |
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) | The [Graph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graph.md) instance that this node references. |

### Remarks

Call this method to access the subgraph that provides the behavior for this node. The subgraph defines input and output variables that appear as ports on the subgraph node. This method does not create or modify the subgraph.
