- Prepare dependencies once and reuse them in later sandboxes.
- Save a known-good state before running risky or expensive work.
- Start multiple sandboxes from the same captured environment.
- Keep a reusable state after the original sandbox is no longer needed.
Terminology
- Origin Sandbox: The sandbox instance used to create the snapshot.
- Snapshot: The saved state that can be used to create new sandboxes.
- New Sandbox: A sandbox created from the snapshot.
Create a snapshot
You can use thecreateSnapshot method in JavaScript or create_snapshot method in Python to create a snapshot from a running sandbox. The sandbox is paused while the snapshot is being created, then can continue running after the operation completes.
Create a sandbox from a snapshot
You can pass the snapshot ID tocreate to start a new sandbox from the captured state.
List snapshots
You can use thelistSnapshots method in JavaScript or list_snapshots method in Python when you need to find saved states for a sandbox or for your account.
Delete a snapshot
You can use thedeleteSnapshot method in JavaScript or delete_snapshot method in Python to delete snapshots you no longer need. A snapshot may not be deletable while running sandboxes are still using it as their source, so kill those sandboxes before deleting the snapshot.
Snapshot recommendations
- Snapshot after setup steps finish successfully.
- Keep snapshot IDs in your own database if jobs need to reuse them later.
- Use metadata on sandboxes to track where saved states came from.
- Delete unused snapshots to avoid keeping stale saved states.
- Use Sandbox Persistence instead if you only need to pause and resume the same sandbox.