New Tool Radar

AI Agents & Automation

How to Stream LangGraph Graph Events to Show Progress While an Agent Runs

Stream a LangGraph graph run so the user sees each node and tool step as it happens instead of waiting for the final answer.

Schematic diagram with three steps: Switch invoke to stream, Read each event, then Show progress to the user.

A graph run that returns only at the end leaves the user staring at a blank screen while the agent works. LangGraph supports event streaming, so the application can see every transition in real time and show progress as the agent moves through nodes and tools.

Before you start

You need a working LangGraph StateGraph. Decide what the user should see: the node names and tool calls are enough, and the full tool arguments are usually too much detail.

Stream the run instead of invoking it once

Replace the single invoke call with a stream call on the same graph and config. Read each event as it arrives: the node that ran, the tool that was called, and the state update it produced. Show a short progress line per event, for example the node name and a one-line summary.

Check the streamed run matches the normal run

Run the same question twice, once streamed and once with a plain invoke, and compare the final answers. They should match. If the streamed run behaves differently, the streaming code is changing the state, not just reading it.

Worked example: Streamed events for one support question

Northwind Support is a fictional help desk. Its graph checks an order with one tool. The table shows the events a user should see.

Event What the user sees
Model node Reading your question
Tool node Looking up order 1042
Model node Writing the reply
End Reply: order 1042 is out for delivery

Expected result (UNTESTED): the user sees four progress lines in order, and the final reply matches the plain invoke result. We checked the LangGraph documentation summary, which lists event streaming among the framework features, but we did not stream a run on this machine.

Limits

Streaming shows progress, it does not speed the run up. A dropped stream loses the progress lines, so the client should handle a partial stream and still show the final answer when it arrives.

Sources

See all