Human-in-the-Loop Checkpoint
Repo MigrationThe Problem
Fully autonomous agent pipelines are powerful but risky for irreversible actions — pushing code, sending emails, modifying production data. You need to trust but verify: let agents do the work, but give a human the final say at specific moments before execution continues.
The Pattern
Stage 1 (automated)
│
▼
┌──────────────────┐
│ CHECKPOINT │ ← execution pauses here
│ "outline- │
│ approved" │
└────────┬─────────┘
│
┌─────┴──────┐
▼ ▼
Approve Reject
│ │
▼ ▼
Stage 2 Halt / retry
(automated)
When to Use
- Before any irreversible action (writing files, pushing to git, sending comms)
- When the output of Stage 1 needs human judgment before Stage 2 consumes it
- Multi-step migrations where you want to review the plan before execution
When NOT to Use
- Fully automated pipelines where the human isn't available to approve
- Tasks where the checkpoint adds more latency than value
- Low-stakes, easily reversible tasks
Code Example
import { QueueAI } from "@queueai/sdk"
const queue = new QueueAI({ apiKey: process.env.QUEUEAI_API_KEY })
const task = await queue.submit({
name: "repo-migration",
input: {
repoUrl: "https://github.com/your-org/your-repo",
migration: "pages-router-to-app-router",
},
model: { primary: "anthropic/claude-opus-4-8" },
budget: { maxCostUsd: 10.00 },
checkpoints: ["plan-approved", "diff-approved"],
})
// The task pauses at each checkpoint.
// Approve via the dashboard or the SDK:
await task.approveCheckpoint("plan-approved")
from queueai import QueueAI
queue = QueueAI(api_key=os.environ["QUEUEAI_API_KEY"])
task = queue.submit(
name="repo-migration",
input={
"repo_url": "https://github.com/your-org/your-repo",
"migration": "pages-router-to-app-router",
},
model={"primary": "anthropic/claude-opus-4-8"},
budget={"max_cost_usd": 10.00},
checkpoints=["plan-approved", "diff-approved"],
)
task.approve_checkpoint("plan-approved")
See it in action: This pattern powers the Repo Migration template in QueueAI.