Skip to main content
Reference vendor/cloudflare 1 min read

human-in-the-loop

Human-in-the-Loop

Choose the approval layer based on where execution must pause, then fetch its current documentation:

NeedDocumentation
Approve chat tool execution or run a browser-side toolChat agents — needsApproval, approval responses, client tools, and custom denial messages
Pause a durable background task or collect MCP inputHuman-in-the-loop patterns — workflow approval, timeout handling, and elicitation

Distinguish approval responses from client tool outputs. When returning a custom tool error, check whether an explicit continuation is needed. Handle workflow approval timeouts before executing the gated action. Check installed SDK versions before adapting examples.