Display subggraph agent in the ux/ui

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

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:

# 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.