How it works
Restate provides durable promises that survive crashes and restarts. For this callback pattern, you create one with the awakeable API:- The agent creates a durable promise and gets a unique callback ID
- The agent sends this ID to whoever needs to approve (Slack, email, dashboard)
- The agent suspends, freeing compute resources (no idle billing on serverless)
- When the approver responds, they resolve the promise through Restate’s HTTP API
- The agent resumes from the exact point it paused
Example: approval tool for an agent
- Vercel AI
- OpenAI Agents
- Google ADK
- Pydantic AI
- LangChain
- Restate TS
- Restate Py
human-approval-agent.ts
Try out human approval
Try out human approval
Install Restate and launch it:Get the example:Export your OpenAI API key and run the agent:Register the agents with Restate:Use 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.
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.
curl with the send verb to start the claim asynchronously, without waiting for the result:




