Checkpointing is in early release. APIs may change in future versions.
Overview
Checkpointing automatically saves execution state during a run. If a crew, flow, or agent fails mid-execution, you can restore from the last checkpoint and resume without re-running completed work.
Quick Start
Checkpoint files are written to ./.checkpoints/ after each completed task.
Configuration
Use CheckpointConfig for full control:
CheckpointConfig Fields
Inheritance and Opt-Out
The checkpoint field on Crew, Flow, and Agent accepts CheckpointConfig, True, False, or None:
Resuming from a Checkpoint
Pass a CheckpointConfig with restore_from to any kickoff method. The crew restores from that checkpoint, skips completed tasks, and resumes.
Remaining CheckpointConfig fields apply to the new run, so checkpointing continues after the restore.
You can also use the classmethod directly:
Forking from a Checkpoint
fork() restores a checkpoint and starts a new execution branch. Useful for exploring alternative paths from the same point.
Each fork gets a unique lineage ID so checkpoints from different branches don’t collide. The branch label is optional and auto-generated if omitted.
Works on Crew, Flow, and Agent
Crew
Default trigger: task_completed (one checkpoint per finished task).
Flow
Agent
Storage Providers
CrewAI ships with two checkpoint storage providers.
JsonProvider (default)
Writes each checkpoint as a separate JSON file. Simple, human-readable, easy to inspect.
Files are named <timestamp>_<uuid>.json inside the location directory.
SqliteProvider
Stores all checkpoints in a single SQLite database file. Better for high-frequency checkpointing and avoids many small files.
WAL journal mode is enabled for concurrent read access.
Event Types
The on_events field accepts any combination of event type strings. Common choices:
Using ["*"] or high-frequency events like llm_call_completed will write many checkpoint files and may impact performance. Use max_checkpoints to limit disk usage.
Manual Checkpointing
For full control, register your own event handler and call state.checkpoint() directly:
The state argument is the RuntimeState passed automatically by the event bus when your handler accepts 3 parameters. You can register handlers on any event type listed in the Event Listeners documentation.
Checkpointing is best-effort: if a checkpoint write fails, the error is logged but execution continues uninterrupted.
CLI
The crewai checkpoint command gives you a TUI for browsing, inspecting, resuming, and forking checkpoints. It auto-detects whether your checkpoints are JSON files or a SQLite database.
The left panel is a tree view. Checkpoints are grouped by branch, and forks nest under the checkpoint they diverged from. Select a checkpoint to see its metadata, entity state, and task progress in the detail panel. Hit Resume to pick up where it left off, or Fork to start a new branch from that point.
When a checkpoint is selected, the detail panel shows:
- Inputs — if the original kickoff had inputs (e.g.
{topic}), they appear as editable fields pre-filled with the original values. Change them before resuming or forking.
- Task outputs — completed tasks show their output in editable text areas. Edit a task’s output to change the context that downstream tasks receive. When you modify a task output and hit Fork, all subsequent tasks are invalidated and re-run with the new context.
This is useful for “what if” exploration — fork from a checkpoint, tweak a task’s result, and see how it changes downstream behavior.
Subcommands