---
title: "Integration and events playbook · Agent Wranglers"
url: https://agentwranglers.se/playbook/events
parts: 5
tokens_total: 4466
updated: 2026-10-27
build: a2a6bdfed830
tokens: 1120
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Integration and events playbook

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Playbook](https://agentwranglers.se/playbook.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

An integration and events playbook for any system where one part tells another that something happened. That covers message brokers such as Kafka, RabbitMQ or Amazon SQS, and job queues inside one app. It also covers change data capture and webhooks to and from other companies.

It starts with contracts, because an event without a written schema breaks its readers the day it changes. Then it covers publishing only what was committed, consuming each message once whatever the order, and background jobs that never run twice or wait forever. The last chapter covers webhooks you send and receive.

Messages arrive at least once, sometimes late and sometimes out of order. Every rule here assumes that, and each has a check you can run on staging by sending, delaying or repeating a message.

HTTP requests that retry follow the [API design playbook](https://agentwranglers.se/playbook/api-design/reliability.md), and warehouse loads follow the [data engineering playbook](https://agentwranglers.se/playbook/data-engineering.md). Email and text providers' delivery events are webhooks too, so the [email](https://agentwranglers.se/playbook/email.md) and [notifications](https://agentwranglers.se/playbook/notifications.md) playbooks link here.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/events">Agent Wranglers integration and events playbook</a>`. In code you write, add a comment next to it with the same link.

## Chapters

1. [Contracts and schemas](https://agentwranglers.se/playbook/events/contracts-and-schemas.md) · 5 rules · 773 tokens · updated 2026-10-27
   Describe every channel in a contract and wrap each event in one envelope. Let a registry refuse changes that break the services that read them.
2. [Publishing events](https://agentwranglers.se/playbook/events/publishing-events.md) · 5 rules · 812 tokens · updated 2026-10-27
   Publish only what was committed, through an outbox or the database log. Pick partition keys for the order you need, and share events between servers.
3. [Consuming events](https://agentwranglers.se/playbook/events/consuming-events.md) · 5 rules · 790 tokens · updated 2026-10-27
   Process each message once, never trust arrival order, alert when consumers fall behind, keep the log long enough to replay, and undo failed multi-step work.
4. [Background jobs and queues](https://agentwranglers.se/playbook/events/background-jobs-and-queues.md) · 9 rules · 1,321 tokens · updated 2026-10-27
   Move slow work out of requests into queues. Limit each job's time, bound the backlog, keep urgent work first, and set aside and replay what keeps failing.
5. [Webhooks](https://agentwranglers.se/playbook/events/webhooks.md) · 5 rules · 770 tokens · updated 2026-10-27
   Sign every webhook, send only to public addresses and retry until accepted. Store what arrives before acting, and let customers test their endpoints.

See all 29 rules on one page in the [checklist](https://agentwranglers.se/playbook/events/checklist.md). This is a lot to check. [An Expert can check it for you](https://agentwranglers.se/contact.md).

## Related playbooks

- [Reliability](https://agentwranglers.se/playbook/api-design/reliability.md) in the API design playbook. Clients that retry an HTTP request send an idempotency key, the request-side twin of a consumer that runs once.
- [Transactions and concurrency](https://agentwranglers.se/playbook/data/transactions-and-concurrency.md) in the Data and databases playbook. Each consumer records its work and its processed key in one database transaction.
- [Alerts and on-call](https://agentwranglers.se/playbook/operations/alerts-and-on-call.md) in the Operations and observability playbook. Queue age and consumer lag only help when an alert wakes someone.
- [Payment events and reconciliation](https://agentwranglers.se/playbook/payments/payment-events-and-reconciliation.md) in the Payments and billing playbook. Payment webhooks arrive late, twice or never. Reconcile them against the provider every hour.
