An outbox event is a persistent database record describing an external side effect that a worker must deliver after a transaction commits. Writing it in the same transaction as the core change closes the crash gap between COMMIT and an external API call. section 8.4
A reliable handoff follows this sequence:
- Save the core record and its outbox_event row in one database transaction. section 8.4
- Commit the transaction and return the API response without waiting for external side effects. section 8.4
- Let a separate worker drain the outbox asynchronously, retrying failed deliveries when appropriate. section 8.4
Booking confirmation
A booking transaction saves the reservation and an outbox_event row for a calendar webhook. If the server crashes immediately after COMMIT, the worker can still deliver the webhook instead of silently losing it. section 8.4
