Configuring HITL interrupts
HITL attaches to individual steps, not to the workflow root. Each gated step declares an approval_key that approvers use in the approve URL, plus an optional timeout. This guide covers workflow specification fields, server interrupt payloads, and a support workflow pattern you can copy.
Step definition fields
| Field | Required | Purpose |
|---|---|---|
approval_key | yes | Stable string passed in POST.../approve/{approval_key} |
timeout_seconds | no (default 3600 in SDK) | Seconds until HumanTimeout if no decision |
interrupt | no (default true) | When false, step skips the gate (rare; used in tests) |
workflow specification example on a step:
exec_config for the run must include "recovery_enabled": true. Python:
Python support workflow example
This pattern matches examples/hitl/expense_approval.py: submit, manager gate, accounting post.
When the manager step finishes agent work, the run stops at Interrupted. Downstream accounting does not run until approval.
Interrupt payload on GET /v1/runs/{id}
Poll run status while waiting for a human decision:
When status is Interrupted, the response includes an interrupt object (metadata only):
Build approver UIs from approval_key, expires_at, and step_index. Fetch business context from your own ticket store; do not expect full LLM transcripts in this payload.
Designing approval_key values
Use stable, human-meaningful keys per gate type, not per run:
| Pattern | Example key | Use |
|---|---|---|
| Role gate | manager_approval | One manager gate per workflow |
| Domain gate | clinical_disclaimer | Regulated content review |
| Action gate | trade_execute | Financial execution |
Multi-step approval in one workflow uses different keys on different steps (for example legal_review then cfo_signoff). The approve URL always includes the key that matches the step currently interrupted.
Avoid embedding PII or secrets in approval_key. Keys appear in URLs and audit logs.
Graph workflows
Graph steps reference the same hitl block on the underlying StepDefinition. The interrupted step index in the run payload helps UIs show which node is waiting. Graph recovery resume has a known partial gap (Graph recovery resume); validate HITL plus graph combinations in your environment before production.
Checklist before first HITL run
- Postgres reachable and migrations applied (
arcflow-serverreturns 503 without it). recovery_enabled: trueon the run.- Server API key on run creation and on approve calls.
- Approver tooling polls
GET /v1/runs/{id}or receivesWorkflowInterruptedErrorin SDK tests. - Timeout aligned with business SLA (
timeout_seconds).
Related pages
- HITL overview for the interrupt model and error codes
- Approve and reject for POST bodies and outcomes
- Quickstart server API for Docker stack setup