suggestion: add a property to recognize whether the graph instance is interrupted #148

Closed
opened 2026-02-15 17:16:19 -05:00 by yindo · 2 comments
Owner

Originally created by @vianvio on GitHub (Dec 23, 2024).

Thanks for the great update of implementing intrerrupt and Command resume, I have integrated these features in my app, but found it unclear to figure out whether the instance is interrupted.

currently I'm using next node for check

const nextNode = (await flowInstance.getState(config)).next;
if (Array.isArray(nextNode) && nextNode.length > 0) {
  // do something
}

and I find the test case is using number of tasks on state for check

const currTasks = (await graph.getState(config)).tasks;
expect(currTasks[0].interrupts).toHaveLength(1);

Both should work but not good I think, can we have a property like isInterrupted or interruption: true, that would be more friendly to use

Originally created by @vianvio on GitHub (Dec 23, 2024). Thanks for the great update of implementing intrerrupt and Command resume, I have integrated these features in my app, but found it unclear to figure out whether the instance is interrupted. currently I'm using next node for check ``` const nextNode = (await flowInstance.getState(config)).next; if (Array.isArray(nextNode) && nextNode.length > 0) { // do something } ``` and I find the test case is using number of tasks on state for check ``` const currTasks = (await graph.getState(config)).tasks; expect(currTasks[0].interrupts).toHaveLength(1); ``` Both should work but not good I think, can we have a property like isInterrupted or interruption: true, that would be more friendly to use
yindo closed this issue 2026-02-15 17:16:19 -05:00
Author
Owner

@jacoblee93 commented on GitHub (Jan 3, 2025):

Hey @vianvio, I think what you're doing is fine for now!

Some computed method could be nice in the future, so will leave this open.

@jacoblee93 commented on GitHub (Jan 3, 2025): Hey @vianvio, I think what you're doing is fine for now! Some computed method could be nice in the future, so will leave this open.
Author
Owner

@dqbd commented on GitHub (Jun 17, 2025):

We now return the interrupts in state with @langchain/langgraph 0.3.x!

@dqbd commented on GitHub (Jun 17, 2025): We now return the interrupts in state with `@langchain/langgraph 0.3.x`!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#148