Skip to main content
Some agent actions need human approvals for dangerous actions: deploying code, sending money, modifying user accounts. With Restate, your agent can pause execution, wait on a durable approval promise, and resume exactly where it left off, even if the process restarts in the meantime.

How it works

Restate provides durable promises that survive crashes and restarts. For this callback pattern, you create one with the awakeable API:
  1. The agent creates a durable promise and gets a unique callback ID
  2. The agent sends this ID to whoever needs to approve (Slack, email, dashboard)
  3. The agent suspends, freeing compute resources (no idle billing on serverless)
  4. When the approver responds, they resolve the promise through Restate’s HTTP API
  5. The agent resumes from the exact point it paused

Example: approval tool for an agent

human-approval-agent.ts
Install Restate and launch it:
Get the example:
Export your OpenAI API key and run the agent:
Register the agents with Restate:
Use curl with the send verb to start the claim asynchronously, without waiting for the result:
You can restart the service to see how Restate continues waiting for the approval.If you wait for more than a minute, the invocation will get suspended.
Invocation overview
Simulate approving the claim by executing the curl request that was printed in the service logs, similar to:
See in the UI how the workflow resumes and finishes after the approval.
Invocation overview