Agent Wranglers

Webhooks and events Recommended

Don't rely on event order

Include a timestamp or sequence number in every event, and let receivers fetch the current state instead of trusting arrival order.

How to do it

Keep payloads small, with the ID and type. Receivers read the latest resource from the API when they need the full state.

How to check

Deliver order.shipped before order.paid in a test. The receiver ends with the correct final state.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers api design playbook: https://agentwranglers.se/playbook/api-design/webhooks-and-events/event-order.