Human-in-the-Loop Resume
Goal. Handle an ask pause safely: detect the paused thread, gather the
operatorβs input, and resume execution.
When to use. Approval gates, manual data confirmation checkpoints, and risk-sensitive branches where automation must wait for a person.
How the script pauses
An ask step pauses the thread durably and waits for
structured input β possibly for hours β then resumes exactly where it left off.
A typical approval gate:
ask "Approve deployment"
prompt = "Deploy {deploy_version} to production?"
options = ["approve", "reject", "defer"]
timeout = "24h"
max_retries = 3
-> approval
check "Was it approved?" approval.value == "approve"
on pass: continue
on fail: fail "Deployment not approved"The result object exposes .value (the answer) plus .provided_by,
.provided_at, and .attempt.
1. Observe the pause (CLI)
# Follow execution; the stream surfaces the pause transition
dodil scriptum thread watch thr_paused_01
# Confirm the paused status
dodil scriptum thread get thr_paused_01 -o json
# Read step detail to see exactly what input is expected
dodil scriptum thread steps thr_paused_01 --detail2. Resume (API)
The CLI has no thread resume command, so resume through the API. The override
JSON must satisfy the pending input contract β its type and any options are
enforced.
grpcurl \
-H "authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID" \
-d '{
"thread_id":"thr_paused_01",
"step_input_override_json":"{\"value\":\"approve\",\"comment\":\"reviewed by analyst\"}"
}' \
rpc.dev.dodil.io:443 dodil.scriptum.v1.ScriptumService/ResumeThreadHTTP gateway equivalent:
curl -sS -X POST "https://api.dev.dodil.io/v1/scriptum/threads/thr_paused_01/resume" \
-H "Authorization: Bearer $DODIL_TOKEN" \
-H "x-organization-id: $SCRIPTUM_ORG_ID" \
-H "Content-Type: application/json" \
-d '{"step_input_override_json":"{\"value\":\"approve\"}"}'3. Continue monitoring
dodil scriptum thread watch thr_paused_01
dodil scriptum thread result thr_paused_01 --save ./out/thr_paused_01Verification checklist
- The resume call returns a non-failed status.
- The thread leaves paused and progresses.
- The terminal state and output are recorded.
- The submitted input payload is archived for audit.
Common failure reasons
- The override valueβs type does not match the pending contract.
- The value is not one of the allowed
options. - Retry or expiration limits were exceeded.
- The thread is already terminal or no longer resumable.
See also
askβ human-in-the-loop input β the step.- CLI Guide β API Gaps & Workarounds β why resume is API-only.
- API Reference β Threads & Results β
ResumeThread.