Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent workflows

Drive a long-running task through webhooks and resume human approval

Return quickly from HTTP requests, receive run events by webhook, pause for review, and resume the session.

Goal

Build an asynchronous human-approval loop without holding a long-lived connection.

Steps

  1. After creating a session, persist its ID against the business task; the HTTP handler submits events and returns accepted promptly. [operate]
  2. Register a Managed Agents webhook for idle/custom-tool events; verify signatures and deduplicate event IDs. [operate]
  3. Queue the pending decision for a reviewer; after approval, use events.send with the user/custom-tool result to resume the same session. [operate]
  4. Archive the session and clear its mapping at terminal state; bound webhook retry and timeout handling. [operate]

How to verify

Replaying an event does not duplicate approval/actions, the review resumes the original session, and terminal resources are archived per policy.

Troubleshooting

If the session does not resume, inspect webhook event ID, signature, and session state; do not create a second task to hide the first.

Permissions

Prerequisites

Permissions

Limitations

The notebook shows a production webhook pattern but does not implement your app’s authentication, idempotency store, or approval policy.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/managed_agents/CMA_operate_in_production.ipynb

Repository
anthropics/anthropic-cookbook
File path
managed_agents/CMA_operate_in_production.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources