LangGraph streaming with workflow streams#1500
Open
brianstrauch wants to merge 10 commits intomainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an experimental integration path between LangGraph’s get_stream_writer() streaming mechanism and Temporal “Workflow Streams”, so activity-wrapped LangGraph nodes can publish incremental chunks that external subscribers can tail via WorkflowStreamClient.
Changes:
- Add
streaming_topicandstreaming_batch_intervaloptions toLangGraphPluginand thread them into the activity wrapper. - Extend LangGraph runtime config restoration to accept an optional
stream_writer, enabling activity invocations to install a per-call writer. - Add tests covering (1) activity-side
get_stream_writer()streaming to workflow streams and (2) workflow-side forwarding ofastream()chunks to an external topic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/contrib/langgraph/test_streaming.py |
Adds workflow-stream-backed streaming tests (activity-side writer + workflow-side republish of astream() chunks). |
temporalio/contrib/langgraph/_plugin.py |
Introduces plugin-level streaming configuration and passes it into the activity wrapper. |
temporalio/contrib/langgraph/_langgraph_config.py |
Adds stream_writer plumbing to set_langgraph_config so activities can inject a writer into the reconstructed Runtime. |
temporalio/contrib/langgraph/_activity.py |
Uses WorkflowStreamClient.from_within_activity() to back the injected writer with workflow-stream topic publishes when streaming is enabled. |
temporalio/contrib/langgraph/__init__.py |
Minor export ordering change (no functional changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test plan