Hi team, thank you for the great work on LangGraph! I’m working on a project and need some help understanding how to properly use interrupt in combination with the astream function.
Setup
-
Frontend: Streamlit app with a simple streaming chat interface.
-
Backend: LangGraph agent with the following node flow:
-
generate_plan -
human_decision— this is where I useinterrupt -
execute_plan— this executes tools based on the approved plan
-
The flow looks like this:
generate_plan -> human_decision (interrupt) -> [user approves] -> execute_plan
|
[user rejects]
↓
back to generate_plan with user feedback
My Question
I’m unclear on how to handle the interrupt inside an astream call so that:
-
The
interruptcan pause and wait for user input from the frontend. -
The frontend can properly receive and respond to the interrupt (e.g. show a message, buttons, or form for user feedback).
-
I can then resume the graph flow once the user responds.
What I’d like to understand is:
-
What is the recommended way to yield/return the interrupt back to the frontend when using
agraph.astream()? -
What object/type should I expect or listen for on the frontend side to know when an interrupt has occurred?
-
How do I resume the LangGraph flow after the user provides their input?
Any examples, tips, or best practices would be hugely appreciated!
#help:langgraph