The retry failure
- A LangChain or LangGraph agent invokes a consequential tool.
- The external provider performs the action.
- The response is lost, times out or becomes ambiguous.
- The workflow cannot prove whether the action happened.
- The tool is invoked again.
- A blind retry can duplicate the side effect.
The Once pattern
const operationId = Once.id("refund", orderId);
await once.execute({
operationId,
provider,
action: {
type: "refund",
order_id: orderId
}
});
The same logical refund receives the same operation ID on every retry. Another agent-tool invocation is therefore not automatically treated as permission to perform a new external action.
LangGraph checkpoint replay evidence
Inspect the deterministic local LangGraph JS replay proof and its limits: 2 unprotected provider effects, 1 with Once, using a shared same-machine SQLite authority. This does not reproduce LangGraph Cloud or its reported ~180s sweeper and does not establish universal exactly-once execution. One voluntary independent Cloud test is sought.
LangChain / LangGraph example
The Once repository includes a working JavaScript example using the LangChain tool pattern with @once-agent/sdk. The same execution-safety boundary can be used for consequential tools orchestrated through LangGraph workflows.
View the Once + LangChain / LangGraph example on GitHub
Add execution safety to agent tools
npm install @once-agent/sdk
Run the retry simulation · SDK package · LangChain / LangGraph example