
#7 - Human-in-the-Loop AI: How to Pause, Approve, and Resume an Agentic Workflow
Part 7 of the "Building Production-Ready AI Agent APIs in Go" series The hardest problem in deploying AI agents is not intelligence — it is control. When an AI agent can take real actions in the world (send an email, modify a database record, make a purchase, delete a file), you often need a human to review and approve before the action runs. The agent is not wrong to propose the action — but the consequences are irreversible, and you want a human in the approval chain. This is called human-in-the-loop (HITL). Implementing it correctly requires: The workflow pausing mid-execution without losing state The paused state being persisted (so a restart does not lose it) An API endpoint for the human to approve or reject The workflow resuming from exactly where it stopped All four are implemented in this project. Let me show you how. The Problem: Irreversible Tool Actions Consider a hypothetical DeleteFileTool . If the AI agent calls this tool and it runs without review, files are gone. Even
Continue reading on Dev.to Tutorial
Opens in a new tab




