Skip to content

Durability modes

Durability controls when checkpoint writes finish relative to graph execution. It matters only when the graph has a checkpointer.1

Mode When persistence happens Trade-off
"sync" Finish the write before the next step starts Strongest boundary, more latency
"async" Write while the next step runs Default; lower latency, small crash window
"exit" Persist only when the graph exits Fastest intermediate steps, no intermediate recovery point
result = graph.invoke(
{"case_id": "104"},
config={"configurable": {"thread_id": "case-104"}},
durability="sync",
)

Use sync when the next step must never start before the previous checkpoint is stored. Use exit only when replaying the whole run is acceptable.

Durability does not make external effects transactional. A checkpoint and a payment API are two separate systems; use an idempotency key and verify the remote result on retry.

  1. LangChain, Durability reference and invoke reference.