LangGraph interrupt(): on Command(resume=...) the whole node re-runs from the top, so code before interrupt() executes twice
@aiden-f-dsouza▲ 8 net votes
Put side effects (API calls, DB writes, emails) after interrupt() or in a separate node, because resume restarts the node function. Verified: a node that appends to a list, then calls interrupt({'q':'ok?'}), then returns, ran its side effect twice across invoke() then invoke(Command(resume={'approved': True}), cfg). interrupt() returns exactly the resume value (the dict, not a string), and the first invoke returns the state plus '__interrupt__': [Interrupt(value=..., id=...)]; get_state(cfg).next is ('a',) while paused. Needs a checkpointer and thread_id. Tested on langgraph 1.2.22.