Your AI workflow retrieves documents, selects a route, and starts generating an answer.

Then the process crashes.

When the application restarts, does it know what already happened—or does it repeat the entire request?

Today’s next step is testing whether progress survives an interruption.

The focus: persist execution checkpoints and demonstrate restart-and-resume behavior.

1. What should survive a restart?

Consider a small RAG workflow:

  1. Validate the request.
  2. Retrieve relevant documents.
  3. Generate an answer.
  4. Check the answer before returning it.

If generation fails after retrieval finishes, repeating retrieval may be unnecessary—provided its results were durably saved.

A useful checkpoint should let the application reconstruct its execution state. For this example, that means preserving:

State Purpose
Request identifier Find the correct execution
Original question Preserve the task being answered
Selected route Continue the intended workflow
Retrieved evidence or durable references Reuse completed retrieval
Pending step Identify unfinished work
Remaining budget Keep execution limits across restarts

This is a proposed state design for the example, rather than a universal checkpoint schema.

Saving only the conversation messages may leave the application without enough information to continue the workflow correctly.

2. Persistence must outlive the process

An in-memory checkpoint can support experiments within one process, but it disappears when that process restarts.

LangGraph’s documentation makes this distinction explicit: InMemorySaver stores checkpoints in RAM, while persistent alternatives include SQLite for local development and PostgreSQL for production use.

For a local restart demonstration, a file-backed SQLite database keeps the setup small.

The essential requirement is that the restarted application reconnects to the same persisted execution state.

3. Design a restart-and-resume demonstration

Start with a controlled failure at the beginning of the generation step, after the retrieval checkpoint has been committed.

Then:

  1. Submit a question under a stable execution identifier.
  2. Let validation and retrieval finish.
  3. Trigger the generation failure.
  4. Exit the application.
  5. Start a fresh process using the same checkpoint database.
  6. Resume the unfinished execution.

The following is an illustrative expected trace, not a measured result:

FIRST PROCESS request=demo-23 validate: completed retrieve: completed generate: simulated failure process exited SECOND PROCESS request=demo-23 saved state: loaded pending step: generate generate: completed check_answer: completed workflow: finished 

The evidence to look for is specific: validation and retrieval should not execute again in this scenario.

For LangGraph, continuing after an error uses graph.invoke(None, config) with the existing thread_id. Submitting fresh input has different semantics; reusing the identifier alone does not mean “resume.”

4. Resume happens at an execution boundary

A checkpoint does not preserve a running Python function at an arbitrary line.

Recovery depends on where progress was saved. An unfinished step may run again from its beginning.

LangGraph saves full checkpoints at super-step boundaries. Its synchronous durability mode waits for checkpoint writes before starting the next step, which makes the persistence boundary clearer for this demonstration.

That is why the failure location matters.

A crash after a committed retrieval checkpoint tests something different from a crash halfway through retrieval.

5. Test more than successful completion

A final answer alone does not prove that recovery behaved correctly.

For this demonstration, I would check:

  • State continuity: Was the original question restored?
  • Work reuse: Did retrieval execute only once?
  • Route continuity: Did execution continue on the saved branch?
  • Budget continuity: Did the remaining allowance survive?
  • Isolation: Did another request remain separate?
  • Completion: Did the resumed workflow reach its terminal state?

These checks turn “it resumed” into something observable.

6. Add a separate test for external actions

Retrieving documents is one case. Sending an email or creating an order introduces another problem:

What if the external action succeeds, but the process crashes before its result is checkpointed?

A retry could repeat that action.

For workflows with external writes, add a separate failure test around that gap. Use a stable operation identifier and a destination that supports deduplication or idempotency, then verify that recovery produces only one intended effect.

Checkpoint recovery and duplicate-action prevention both need evidence.

Today’s takeaway

A useful recovery test starts a new process, loads durable state, and verifies exactly which work runs again.

For Day 23, the practical goal is small:

Save progress, interrupt execution, restart, and prove that the workflow continues from the intended boundary.

Have you tested your AI workflow after a process restart—and checked which steps it repeats?