thread_id
to your client when you run your graph in order to keep track of prior runs through the persistent state implemented in LangGraph Platform. However, if you don’t need to persist the runs you don’t need to use the built in persistent state and can create stateless runs.
Setup
First, let’s setup our client:Stateless streaming
We can stream the results of a stateless run in an almost identical fashion to how we stream from a run with the state attribute, but instead of passing a value to thethread_id
parameter, we pass None
:
Waiting for stateless results
In addition to streaming, you can also wait for a stateless result by using the.wait
function like follows: