Hi All
I’m building a multi-agent system using LangGraph with a supervisor-slave architecture.
Each sub-agent is implemented as a subgraph, with its own workflow and independent state schema. Some variables are shared between the main (supervising) graph and its subgraphs, while others are local to individual subgraphs.
Problem
When I call get_state() on the main graph after invoking it, I only see the variables defined in the main graph’s state schema. I do not see:
- Any state variables that are local to the subgraphs (slave agents), even when they are returned from the final node of the subgraph.
- Even when using set_return_values([…]) inside the subgraph, the state doesn’t seem to “bubble up” unless the variable is explicitly defined in the main graph’s state schema.
This makes it difficult to track or debug full system state snapshots when using nested subgraphs (as agents) in a complex multi-agent architecture.
What I’ve Tried
- Each subgraph defines its own state schema and workflows independently.
- I use set_return_values([…]) inside each subgraph to return desired outputs.
- The returned variable names do match the main graph’s schema (for shared state).
- Final state from the main graph execution (via invoke(…)) shows only main graph variables.
- Calling get_state() from inside the subgraph doesn’t persist outside
What I’d Like to Request
- Ability to access or log state variables of subgraphs (agents) from the main graph, even if they are not part of the main schema.
- Or a built-in utility to fetch nested subgraph state snapshots for inspection/logging.
Please let me know if this feature already exists or if I am missing something? I created separate workflows for each sub agent for modularity and i do not want to have same state schema for main agent and sub agents