Skip to content

Add LangGraph workflow streams sample#315

Open
brianstrauch wants to merge 2 commits into
mainfrom
langgraph-streaming-sample
Open

Add LangGraph workflow streams sample#315
brianstrauch wants to merge 2 commits into
mainfrom
langgraph-streaming-sample

Conversation

@brianstrauch
Copy link
Copy Markdown
Member

What

Adds a Graph-API sample demonstrating the LangGraph plugin's recently-added Workflow Streams support, under langgraph_plugin/graph_api/streaming/.

It combines both streaming patterns in one workflow:

  • Node token streaming — the write_story node emits live tokens via LangGraph's get_stream_writer(), routed onto the tokens topic by the plugin's streaming_topic.
  • Workflow-side astream publish — the workflow drives the graph with app.astream(...) and publishes each node-completion chunk onto a progress topic it owns via WorkflowStream.topic().publish().

A single client subscribes to all topics with WorkflowStreamClient and demultiplexes on item.topic. The workflow waits on an ack_stream signal before returning so the stream survives until the client finishes consuming it.

Dependency changes

  • Bumps the langgraph group to temporalio>=1.28.0 (where workflow streams ship).
  • Drops the now-obsolete langsmith<0.7.34 uv constraint — 1.28.0 requires langsmith>=0.7.34, and the pin was specific to the 1.27.2 langsmith patch. Existing langgraph tests still pass on the resulting langsmith 0.8.9.

Also adds langgraph_plugin/ code owners.

Testing

  • Added tests/langgraph_plugin/streaming_test.py; the full tests/langgraph_plugin/ suite passes (12 passed) on temporalio 1.28.0 / langsmith 0.8.9.
  • ruff format/import checks and mypy are clean for the new files.

🤖 Generated with Claude Code

brianstrauch and others added 2 commits June 4, 2026 15:27
Demonstrate the LangGraph plugin's Workflow Streams support: a node emits
live tokens via get_stream_writer() (routed by the plugin's streaming_topic),
and the workflow publishes coarse astream progress to its own topic. A single
client subscribes to all topics and demultiplexes on item.topic.

Bumps the langgraph group to temporalio>=1.28.0 (where workflow streams ship)
and drops the now-obsolete langsmith<0.7.34 constraint, which was specific to
the 1.27.2 langsmith patch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant