I’m building a React Agent with multiple tools. Inside one of the tools, I use interrupt() to pause the workflow and send a confirmation message to the UI — that part works correctly.
Now, after the user provides input, I want to resume the workflow from where it left off. I saw that command(go_to=...) can be used to direct the flow to a node, but I’m not sure:
Can I use command(go_to=...)to resume execution inside a tool?
Or should I route it to a node that manually re-invokes the tool logic? (In my case, the React Agent only has a start and end node, so I’m unsure how to handle this.)
I’m a bit unclear on how command() interacts with tools and nodes in this case.
Any guidance or examples on the best pattern to resume after an interrupt() in a React Agent would be greatly appreciated!
You can’t use command(go_to=...) to resume inside a tool - it only works with nodes. The standard pattern is to store the tool’s state and progress in your graph state when calling interrupt(), then use command(resume=True) to continue from the same node. When the node resumes, check the state to see where you left off in the tool execution. Alternatively, create a separate “confirmation handler” node that processes user input and updates state, then routes back to your main agent node to continue. The key is storing enough context in your graph state during the interrupt so you can pick up where you left off.
Actually, I’ve implemented my entire agent workflow using tools within a React Agent (created using the prebuilt create_react_agent). Now if I have to incorporate human-in-the-loop concept , shouldn’t I need to restructure the entire workflow to nodes instead of react agent? . Or is there a way to handle this within the current tool-based setup — for example, by creating a conditional edge or branching logic from inside a tool?
Also..if possible can you share any example code for your comment above.
create_react_agent creates a graph under the hood that consists of nodes and edges, so you don’t need to change the implementation unless you need to add some custom functionality.
Please take a look at this guide for instructions how to resume a human in the loop workflow: