Technical document

Boundaries and Retransmission Design for Message Webhook Integration

When integrating webhooks from external message services into business applications, we organize how to design signature verification, idempotency, queues, and notification scope.
External Integration / Webhook~10 minPublication Date September 22, 2026Update date September 22, 2026
Boundaries and Retransmission Design for Message Webhook Integration

Summary

Key points of this document

  • Where are the design challenges?
  • How to define boundaries
  • Details that make a difference in implementation

Overview

In message service integration, attempting to complete all processing the moment a webhook is received makes it vulnerable to retransmission on failure and duplication. It is crucial to separate the boundaries between reception and business processing. Although message webhooks appear real-time, they should be designed as asynchronous boundaries, assuming retransmission, out-of-order delivery, duplication, and external API limitations.

Where are the design challenges?

Synchronously executing DB updates, notifications, replies, and file retrieval within a webhook can sometimes lead to external service timeouts. If retransmitted upon failure, there's a risk of the same notification or registration being executed twice.

Webhooks from external services have constraints on signatures, retries, event formats, and response times. The application side also needs to handle the association between internal and external user IDs, as well as blocking and unlinking.

In message integration, there's a temptation to reply immediately to a received event. However, synchronous processing becomes fragile with retransmissions or timeouts from external services, or processing delays on the application side. It's important to first save the fact that it was received.

How to define boundaries

At the receiving endpoint, only signature verification, event ID storage, and minimal normalization are performed, and business processing is passed to a queue. In internal processing, handlers are separated by event type to maintain idempotency.

In design, we separate the webhook entry point, event storage, business processing, and reply sending. At the entry point, only signature verification and duplicate checks are performed, then passed to a processing queue. Business processing is designed to yield the same result even if re-executed.

Details that make a difference in implementation

The DB stores external events, external user associations, processing status, and final errors. Processes requiring a reply maintain a sending log to prevent duplicate replies for the same event.

On the Hono or Laravel side, event_id, source_id, type, payload_hash, received_at, and status are stored in the events table. Replies and external API calls are stacked in an outbox table, managing send success, failure, and retry counts.*Payloads with failed signature verification are not processed; only audit logs are kept to the necessary extent.*For retransmissions of the same event_id, check existing processing results to enable a successful response.*Reply sending is managed with an outbox pattern, placing business updates and send requests within the same transaction.*Observing failure modes

  • During verification, we check cases of invalid signatures, retransmission of identical events, mid-processing failures, unlinked external users, and blocked users. We also measure webhook reception response times.
  • During verification, we check for retransmission of identical events, out-of-order delivery, reply API failures, queue retries, and signature mismatches. Providing a CLI that can re-inject saved payloads locally facilitates troubleshooting.
  • Discarded options and tradeoffs

Separating into queues introduces delays until processing is complete. For operations requiring immediate replies, it's necessary to adjust the UX by limiting the message returned upon reception and deferring heavy processing to subsequent notifications.

While synchronous replies are simpler to implement and offer a straightforward user experience, they are susceptible to external API delays. Asynchronization increases state management but facilitates retries and auditing. For critical business processes, establishing an asynchronous boundary is valuable.

Decision-making criteria for the field

In Webhook integration, simply separating reception from processing increases robustness. By basing it on signature verification, event storage, and idempotent processing, it becomes easier to handle retransmissions from external services.

In Webhook integration, separate returning quickly from processing reliably. Simply having reception records and an outbox transforms it into a retransmission-resilient integration.

Boundaries and Retransmission Design for Message Webhook Integration

When integrating webhooks from external message services into business applications, we organize how to design signature verification, idempotency, queues, and notification scope.

Boundaries and Retransmission Design for Message Webhook Integration

When integrating webhooks from external message services into business applications, we organize how to design signature verification, idempotency, queues, and notification scope.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list