Skip to main content
Webhooks can arrive more than once, late or out of order. When an agent acts on them by sending a confirmation, updating a record or charging a card, a redelivered event must not repeat the action, and a stale one must not act on a world that has moved on.

One action per event

Key the action to the webhook’s event id. A redelivery is the same action:
The second delivery of the same event resolves with status: "duplicate" and the original receipt. The customer gets one email.
Tool names depend on how your workspace connects to your email provider. Run invoke gateway tools to see the tools your workspace has.

Check state before acting on an old event

A payment.succeeded event can arrive after the payment was refunded. Before acting, confirm the state the event describes is still true:
Here the payment was refunded, so the answer is "status": "replan_required". Don’t send the confirmation.

Next steps