Agent Playground
Recipe: Rehearse a database migration
Runs a migration on a copy of the data, checks nothing was lost, restores and retries if it was, then asks a person. What it does, when to use it, how to make it yours, and what a run costs.
Rehearses a database change on a copy of the data: saves a restore point, runs the change, checks nothing was lost, restores and tries the next version if it was, and asks a person before anything is run for real.
| At a glance | Notes |
|---|---|
| Category | Safety |
| Shape | A loop with restore, then a person |
| Plan | Free and up |
| Needs a Claude key | No |
| Limits it comes with | 3 loops, 900 seconds, $0.05 |
When to use it
- Changing the structure of a database you can't afford to break.
- Any risky change you'd like to rehearse on a copy first: a bulk edit, an import, a cleanup.
- You want a written plan of a change that's already been proven on real-looking data.
Run it
- Open Agent Playground in the dashboard and find Rehearse a database migration under Start from a recipe. In the builder, Recipes in the toolbar lists them too.
- Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
- Choose Simulate to see the forecast, then Run.
- When the run waits for a person, approve or deny it from the banner, from Approvals, or from the approval email.
What you'll see: The first version of the change loses data, Anything lost? catches it, the data is restored, and the next version passes every check. Then the run waits at Run it for real?. Approve and plan.md is written with the change that passed. Nothing runs outside the sandbox.
Make it yours
- Load a recent, anonymized copy of your data in Load a sample.
- Put your change in Run the migration.
- Write checks that matter to you in Anything lost?: row counts, totals of money columns, a few known records.
- Keep No internet for this step on the migration and the checks, so a rehearsal can never touch the real database.
- Keep the approval. Have the last step write the plan, or hand it to the person who runs changes on the real database.
What a run costs
These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.
| Notes | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| Sandbox time | $0.0016 | $0.0023 | $0.01 |
| How long it takes | about 2 minutes | about 3 minutes | 900 seconds |
A typical run uses $0.0016 of sandbox time, so about 610 runs cost $1, and every plan includes $5 of usage a month. The time includes a person taking a minute or two to answer the approval. The clock, and the sandbox, keep running while the run waits. At most is the most a run could cost with these limits: it stops at $0.05 or 900 seconds, whichever comes first.