# Display subggraph agent in the ux/ui

**URL:** <https://forum.langchain.com/t/display-subggraph-agent-in-the-ux-ui/837>\
**Category:** LangGraph\
**Tags:** intro-to-langgraph, python-help\
**Created:** [July 30, 2025, 8:39pm UTC](https://forum.langchain.com/t/display-subggraph-agent-in-the-ux-ui/837 "2025-07-30T20:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cotarelorodrigo](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/cotarelorodrigo/32/410_2.png) [@cotarelorodrigo](https://forum.langchain.com/u/cotarelorodrigo)\
**Post date:** [July 30, 2025, 8:39pm UTC](https://forum.langchain.com/t/display-subggraph-agent-in-the-ux-ui/837/1 "2025-07-30T20:39:02Z")

</div>

I have a node of my agent like this:

`planner_agent = `_`await`_` make_planner_agent(TOOLS)`  
`response = `_`await`_` planner_agent.ainvoke()`

`When I run 'langgraph dev' I can only see the node name and I want to expand the node and see the subgraph in the ux/ui`

---

<div class="post-metadata">

**Author:** ![AbdulBasit](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/abdulbasit/32/72_2.png) [@AbdulBasit](https://forum.langchain.com/u/AbdulBasit)\
**Post date:** [July 31, 2025, 11:43am UTC](https://forum.langchain.com/t/display-subggraph-agent-in-the-ux-ui/837/2 "2025-07-31T11:43:44Z")

</div>

LangGraph Studio doesn’t automatically expand subgraphs in the UI visualization. You need to explicitly define your subgraph structure for it to be visible.

Instead of calling `planner_agent.ainvoke()` within a node, add the planner as a proper subgraph:

```python
# Define your main graph
main_graph = StateGraph(state_schema)

# Add the planner as a subgraph node
main_graph.add_node("planner", planner_agent)

# Compile with subgraphs parameter
app = main_graph.compile(subgraphs={"planner": planner_agent})

```

This should make the planner subgraph expandable in LangGraph Studio. If the subgraph still doesn’t show properly, check that your planner agent is also a compiled StateGraph, not just a function that invokes an agent.

For detailed subgraph visualization documentation, refer to the LangGraph Studio docs on graph composition and visualization.
