Human in the loop
Pause a run for a person to approve, reject or edit a value with the Human Approval node, durably and across restarts.
The Human Approval node pauses a run until a person decides. The pause is durable: no thread, task or connection is held while it waits, and the run survives a server restart.
Example: draft and approve
Template Draft and approve (human in the loop):
Topic→ Text Template → LLM writes a customer announcement.- Human Approval receives the draft (
value). Settings:title,instructionsfor the reviewer,allow_edit(let the reviewer change the text),require_comment_on_reject(default on). - The
approvedbranch triggers the Published output (with the possibly edited value); therejectedbranch triggers Rejection reason (with the comment).
Run it. The run ends with status waiting, the node shows waiting for you, and Chat shows Paused for approval.
Approving
- Open the Approvals tab (its badge counts pending approvals).
- Read the title, instructions and value.
- Optionally edit the value (if
allow_edit), add a comment, and click Approve or Reject (a rejection needs a comment by default). - The run resumes from its checkpoints: nodes that already finished are restored, not re-run. Outputs:
value,decision(approved/rejected),comment,reviewer.
How it works
- A node that declares
can_suspendmay raise a suspension with a request (what to show) and a response schema (what a valid answer looks like). - The engine marks the node
waiting, lets independent branches finish, then ends the run aswaiting. The request is stored as a wait (the approval inbox). POST /api/runs/{id}/resumewithresponsesvalidates each response against its schema (422otherwise) and claims the run atomically (waiting → running), so a double click gets409.- The plan is rebuilt from the run’s IR snapshot and original run targets; secrets are resolved again.
- Cancel works on waiting runs; pending waits become
cancelled.
Rules and limits
- Human Approval cannot be inside a loop body (
SUSPEND_IN_LOOP). - An Agent cannot yet pause before an individual tool call.
- There is no approval expiry, reminders or assignee yet.
- In an exported standalone app, an approval pause answers
409(durable approvals need the AgenticMind server).
API
| Endpoint | Purpose |
|---|---|
GET /api/projects/{id}/approvals?status=pending |
The approval inbox. |
GET /api/runs/{run_id}/waits |
A run’s pause points (pending, answered, cancelled). |
POST /api/runs/{run_id}/resume |
{"responses": {"<node_id>": {"decision": "approved", "comment": "", "value": "..."}}} |
See Production AI systems for why durable suspension matters.

