# Subgraph state variables not accessible

**URL:** <https://forum.langchain.com/t/subgraph-state-variables-not-accessible/774>\
**Category:** LangGraph\
**Tags:** intro-to-langgraph, python-help\
**Created:** [July 28, 2025, 4:42pm UTC](https://forum.langchain.com/t/subgraph-state-variables-not-accessible/774 "2025-07-28T16:42:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahil0094](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/sahil0094/32/312_2.png) [@sahil0094](https://forum.langchain.com/u/sahil0094)\
**Post date:** [July 28, 2025, 4:42pm UTC](https://forum.langchain.com/t/subgraph-state-variables-not-accessible/774/1 "2025-07-28T16:42:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ishish222](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/ishish222/32/1269_2.png) [@ishish222](https://forum.langchain.com/u/ishish222)\
**Post date:** [October 15, 2025, 4:44pm UTC](https://forum.langchain.com/t/subgraph-state-variables-not-accessible/774/2 "2025-10-15T16:44:36Z")

</div>

Honestly I’m a bit shocked how difficult it is to access subgraphs’ states. I’m trying to access with SDK (client.threads.get\_state(thread\_id, subgraphs=True)) and the behaviour differs between local deployments (subgraphs’ states accessible via tasks) and LGP cloud deployments (tasks are empty). I’ve been trying to solve this for entire day, via manual snapshot retrieval with get\_history (only states from root graph), via join\_stream (historic states not supported).

I mean, this seems to me basic functionality that many developers assume to be provided for multi-agent hierarchies… Maybe I’m missing something but it’s quite a surprise that this is so challenging…

---

<div class="post-metadata">

**Author:** ![ishish222](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/ishish222/32/1269_2.png) [@ishish222](https://forum.langchain.com/u/ishish222)\
**Post date:** [October 16, 2025, 12:52pm UTC](https://forum.langchain.com/t/subgraph-state-variables-not-accessible/774/3 "2025-10-16T12:52:48Z")

</div>

I found some suggestions that the problem w/ subgraph’s state access is in setups based on Postgres-based checkpointers and it has to do with isolating checkpoints’ namespaces. So I tried to reproduce the cloud setup and try and find at which point the decision not to share subgraph’s state is made. Set up own data plane, Postgres, Redis, docker image, etc. according to [this tutorial](https://docs.langchain.com/langsmith/deploy-standalone-server). And with this setup turns out the state of subgraphs is shared.

Not sure how much time I can spend to investigate further but it seems the problem is not generally with Postgres but maybe with some lib versions, my langgraph.json/LGP deployment configuration or some runtime components on LGP cloud’s site.

Not sure if it helps you because it sounds like you’re not using LGP server / cloud, just the library?
