# Stream stops midway to backend, but completes on LangSmith

**URL:** <https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493>\
**Category:** Deployment\
**Tags:** self-hosted, python-help\
**Created:** [July 16, 2025, 11:38am UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493 "2025-07-16T11:38:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kundanRao8507](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/kundanrao8507/32/127_2.png) [@kundanRao8507](https://forum.langchain.com/u/kundanRao8507)\
**Post date:** [July 16, 2025, 11:38am UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493/1 "2025-07-16T11:38:17Z")

</div>

## Description

- **Affects version** : langgraph 0.4.8
- **Symptom** : When streaming a graph run, streaming to my backend client stops midway. However, when I inspect the run on LangSmith, the stream is shown as complete. It usually stops in two points, one while streaming the last run of my subgraph or last run of my entire graph
- **Expectation** : The stream to my backend should complete as it does on LangSmith.
- **Environment** : I have set up 2 langgraph deployments, one in cloud run, another one in self hosted cloud run
- **Backend** : We are using client.stream to receive the streaming chunks

```auto
async for chunk in client.runs.stream(
                    thread_id,
                    assistant_id=assistants[0]["assistant_id"],
                    input=input_data,
                    stream_mode=["events"],
                    stream_subgraphs=True,
                    },
                ):

```

---

<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 17, 2025, 4:18pm UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493/2 "2025-07-17T16:18:40Z")

</div>

This is a known issue that can occur when streaming runs using `stream_subgraphs=True`, particularly with `stream_mode=["events"]`. LangGraph sometimes fails to emit the final few chunks when subgraphs complete, even though the full output is correctly registered in LangSmith. This isn’t typically a network issue, but a limitation in how the stream cursor is managed internally for nested runs.

To work around this:

- Try switching to `stream_mode=["values"]` to see if the final state is delivered correctly.
- Alternatively, avoid `stream_subgraphs=True` if you don’t need per-subgraph updates.
- Check if the issue persists with the latest version of LangGraph, as streaming has been actively evolving.

Also verify that your backend doesn’t close the connection too early, but given that LangSmith shows full output, the issue is likely upstream. Hope it Helps.

---

<div class="post-metadata">

**Author:** ![hash3liZer](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@hash3liZer](https://forum.langchain.com/u/hash3liZer)\
**Post date:** [July 21, 2025, 4:43pm UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493/3 "2025-07-21T16:43:04Z")

</div>

Hey @AbdulBasit . Did you get to to solve the issue? For me the issue happens in langsmith UI. For example, i’ve a subagent like you mentioned and the subagent returns response from LLM. If i expand on the node thats generating the response of LLM on the way, it sometimes hangs in the middle. Altough i can see the agent has progressed further in the langsmith traces.

---

<div class="post-metadata">

**Author:** ![kundanRao8507](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/kundanrao8507/32/127_2.png) [@kundanRao8507](https://forum.langchain.com/u/kundanRao8507)\
**Post date:** [July 25, 2025, 5:59pm UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493/4 "2025-07-25T17:59:19Z")

</div>

Tried all of the methods mentioned, yet the issue isnt still mitigated

---

<div class="post-metadata">

**Author:** ![scrowder](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/scrowder/32/305_2.png) [@scrowder](https://forum.langchain.com/u/scrowder)\
**Post date:** [July 29, 2025, 5:35pm UTC](https://forum.langchain.com/t/stream-stops-midway-to-backend-but-completes-on-langsmith/493/5 "2025-07-29T17:35:43Z")

</div>

If you are just using LangGraph and running on cloud run, that could be a question for the `LangGraph` category as opposed to `LangGraph Platform`.

If you are using the LangGraph Server container and deploying to cloud run, it should be noted that LangGraph Platform was not designed for serverless environments and will not function in this kind of environment. More docs on that here: [Standalone Container](https://langchain-ai.github.io/langgraph/concepts/langgraph_standalone_container/?h=serverless#overview)
