> For the complete documentation index, see [llms.txt](https://docs.engagevr.io/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.engagevr.io/developer/afx/afx-graphs/afx-subgraphs/using-an-afx-subgraph.md).

# Using an AFX subgraph

You can use a Sub Graph node to include an AFX subgraph within an AFX graph. To do so, complete the following steps:

1. Edit the AFX graph that you want to add the subgraph to.
2. Right click in the graph canvas, and then select **Subgraph** > **Run SubGraph**.
3. Drag the AFX subgraph from the **Project** panel to the **Subgraph** field on the Sub Graph node.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-1651a1f726caeb68be007dfaf87513545771a63e%2Fafx_subgraph_run.png?alt=media" alt=""><figcaption><p>Dragging a subgraph asset to a Sub Graph node</p></figcaption></figure>

4. **Optional**: Select **Setup Ports** to configure any input or output ports that were defined in the subgraph.

<figure><img src="https://2640392766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5yxYHsXtlAaoMUrDWhLm%2Fuploads%2Fgit-blob-2108920755d633abdf32ceb5167df3061abc032f%2Fafx_subgraph_port_setup.png?alt=media" alt=""><figcaption><p>Option to set up ports (left) and and example added port (right)</p></figcaption></figure>

{% hint style="info" %}
You can also drag a subgraph asset from the **Project** panel to an AFX graph canvas to add the subgraph.
{% endhint %}
