Subgraph state variables not accessible

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.


:red_exclamation_mark: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.

:white_check_mark: 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

:light_bulb: 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

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…

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