Imagine you have built an AI agent that can analyze a request, call multiple tools, delegate tasks to other agents, and eventually produce a result.
Everything works perfectly in development.
Then, in production, the server restarts halfway through a workflow.
What happens?
Does the agent continue where it stopped? Does it repeat all previous operations? Does it lose the user's approval? Or worse, does it execute an operation twice?
This is one of the problems that checkpointing solves.
As AI systems move from simple chat interfaces to long-running, tool-using workflows, checkpointing becomes an important part of production architecture.
Let's look at why.
1. What Is Checkpointing?
A checkpoint is a persisted snapshot of an agent's execution state at a particular point in time.
It allows the system to restore its progress instead of starting the entire workflow from scratch.
Think of it like saving your progress in a game.
You don't want to start from the first level every time the application closes.
An agent needs something similar.
For example, imagine a customer support agent handling a refund request.
Its workflow looks like this:
- Identify the customer.
- Retrieve the order.
- Check the refund policy.
- Calculate the refund amount.
- Request manager approval.
- Execute the refund.
- Notify the customer.
Suppose the server restarts after step 5.
Without checkpointing, the agent may need to repeat the entire workflow.
With checkpointing, it can restore the previous state and continue from the approval stage.
The important point is that we are not simply saving the conversation. We are saving the actual progress of the task.
2. Conversation Memory Is Not Workflow State
This distinction is easy to miss.
Conversation memory tells us what the user and agent discussed.
Workflow state tells us what the system has actually completed.
Consider this example:
A user asks:
"Please analyze this repository and create a pull request with the necessary fixes."
The agent:
- Analyzes the repository.
- Identifies three issues.
- Generates the required changes.
- Runs tests.
- Creates a pull request.
Now imagine the application crashes after the tests pass.
Having the previous conversation doesn't necessarily tell the agent:
- Which files were modified?
- Which tests were executed?
- Did the tests pass?
- Was the pull request actually created?
- Which commit belongs to this task?
These are execution-state questions.
A useful distinction:
| Concept | What it stores |
|---|---|
| Conversation memory | What was discussed |
| Workflow state | What has been completed and what remains |
| Checkpoint | A persisted snapshot of workflow progress |
| External system state | What actually happened in another system |
A reliable agent needs to understand all of them.
3. What Happens When an Agent Crashes?
Let's use a more realistic scenario.
Imagine an AI agent responsible for processing payments.
Its workflow:
Receive payment request | v Validate customer | v Check account balance | v Execute payment | v Send confirmation The agent successfully executes the payment.
But immediately afterward, the application crashes before saving its next checkpoint.
When the application restarts, the last persisted checkpoint says:
"Payment execution is pending."
The agent may execute the payment again.
Now the customer has been charged twice.
This is where checkpointing alone is not enough.
We also need idempotency.
For example, every payment operation should have a unique operation ID:
{ "operationId": "payment-12345", "customerId": "customer-789", "amount": 250, "status": "COMPLETED" } Before executing the payment again, the system checks whether payment-12345 has already been processed.
If it has, the previous result is returned instead of executing the payment again.
This gives us an important architectural principle:
Checkpointing preserves workflow progress. Idempotency protects external operations from being repeated.
For production systems, these two concepts should work together.
4. Checkpointing in Multi-Agent Workflows
Checkpointing becomes even more interesting when multiple agents collaborate.
Imagine a software development workflow:
Task Planner | +-------+-------+ | | | Backend Frontend Security Agent Agent Agent | | | +-------+-------+ | Test Agent | Review Agent | Final Result Each agent has a different responsibility.
Now imagine the Backend Agent finishes its work, but the Security Agent fails.
Should we execute everything again?
Probably not.
We should persist the completed work and resume only the unfinished parts.
For example:
{ "workflowId": "task-1001", "status": "RUNNING", "agents": { "planner": { "status": "COMPLETED" }, "backend": { "status": "COMPLETED", "output": "backend-result.json" }, "frontend": { "status": "COMPLETED", "output": "frontend-result.json" }, "security": { "status": "FAILED" }, "testing": { "status": "PENDING" } } } After recovery:
- Planner does not need to run again.
- Backend does not need to run again.
- Frontend does not need to run again.
- Security resumes according to its recovery policy.
- Testing starts when its dependencies are ready.
This is especially important when agents perform expensive operations such as repository analysis, large document processing, or multiple LLM calls.
However, the orchestration layer must also handle dependencies, partial failures, and parallel execution correctly. Simply restoring a shared state object does not guarantee that every completed worker will be handled correctly.
5. Human-in-the-Loop: Checkpoints as Approval Boundaries
Not every workflow should run autonomously from beginning to end.
Sometimes the agent needs human approval before continuing.
Consider an AI agent that reviews a software architecture.
Its workflow:
- Analyze the architecture diagram.
- Identify services and dependencies.
- Generate security findings.
- Request human approval.
- Generate the final report.
At step 4, the workflow pauses.
The agent saves its current state and waits.
The engineer reviews the findings and approves them the next morning.
The workflow resumes from that checkpoint.
There is no need to repeat the architecture analysis or generate everything again.
A simplified state transition could look like this:
RUNNING | v WAITING_FOR_APPROVAL | +---- REJECTED ----> CANCELLED | +---- APPROVED ----> RESUMED | v COMPLETED One important design decision: approval boundaries should be defined by the application or orchestrator, not left entirely to the LLM.
For example, an agent should not independently decide whether it needs approval before executing a high-impact financial operation.
The application should enforce that boundary.
6. When Should We Create a Checkpoint?
Saving after every tiny operation might introduce unnecessary storage and performance overhead.
Saving too rarely increases the amount of work lost after a failure.
The right approach depends on the workflow.
Some useful checkpoint boundaries:
- After an expensive LLM operation.
- After a successful tool execution.
- After completing an agent's responsibility.
- Before waiting for external input.
- Before a human approval step.
- After receiving an external event.
- Before executing a high-impact operation.
A practical example:
For a document-processing agent, saving after every processed document chunk makes sense.
For a simple classification agent, saving after the final classification may be sufficient.
Checkpoint granularity should match the cost of repeating work and the consequences of losing progress.
7. What Should a Checkpoint Contain?
A checkpoint should contain enough information to recover the workflow reliably.
A practical structure could look like this:
{ "workflowId": "workflow-1001", "version": 2, "status": "WAITING_FOR_APPROVAL", "currentStep": "security_review", "completedSteps": [ "repository_analysis", "dependency_scan" ], "pendingSteps": [ "security_review", "final_report" ], "artifacts": { "analysis": "storage/analysis.json", "scan": "storage/scan.json" }, "approval": { "required": true, "status": "PENDING" }, "updatedAt": "2026-11-29T10:00:00Z" } A few things are worth considering:
- Completeness: Store the information required to continue, not just the last LLM response.
- Versioning: Workflow definitions and state schemas can change between deployments.
- Agent identity: Know which agent produced each result.
- Idempotency: Make repeated operations safe.
- Storage: Use durable storage instead of relying on process memory.
- Retention: Avoid storing unnecessary sensitive information indefinitely.
Also, don't blindly persist every raw LLM message. Store structured outputs, references to artifacts, execution metadata, and the minimum context needed for recovery.
8. Frameworks and Real-World Implementations
Several agent frameworks and infrastructure projects provide mechanisms for persistence and recovery.
A few examples:
LangGraph
Provides checkpoint-based persistence for graph execution. It supports restoring workflow state, interrupts, human approval, and resuming execution.
Microsoft Agent Framework
Provides workflow checkpointing to persist execution state and restore workflows after process restarts. This is particularly useful for long-running workflows that wait for external events or user approval.
Spring AI
Can be used to implement pause-and-resume patterns with an orchestrator and persisted workflow state, including human approval boundaries.
checkpointd by NTT
An interesting infrastructure-level approach. It focuses on recovering stateful agents running on Kubernetes using memory checkpoints. It demonstrates how checkpointing can extend beyond application-level workflow persistence.
These approaches solve related problems at different layers. Framework-level checkpoints and infrastructure-level recovery are not interchangeable.
Conclusion
Building an AI agent that can complete a task is one challenge.
Building an AI agent that can reliably complete a task despite crashes, deployments, network failures, and human interruptions is a different challenge.
As agentic systems become more autonomous and workflows become longer, we need to think beyond prompts, tools, and model selection.
We need to design for failure.
My takeaway is simple:
A production-ready agent should not only know what to do next. It should also know what it has already done, what is still pending, and what it is safe to execute again.
That's where checkpointing becomes an essential part of agentic system architecture.
