Webhook Processor
Service that processes incoming webhook events from external platforms (WhatsApp, Instagram, Facebook)
Overview
The Webhook Processor service handles incoming webhook events from external platforms including WhatsApp Business API, Instagram Direct Messages, and Facebook Messenger. It validates, routes, and processes these webhooks asynchronously.
Architecture diagram
Supported Platforms
- Processes webhooks from WhatsApp Business API
- Handles message events, status updates, and delivery receipts
- Uses
WhatsappChatServicefor processing
- Processes webhooks from Instagram Direct Messages
- Handles message events and status updates
- Uses
InstagramChatServicefor processing
Facebook Messenger
- Processes webhooks from Facebook Messenger
- Handles message events and page events
- Uses
MessengerChatServicefor processing
Processing Flow
How Webhook Processor Works
-
Receive Webhook
Webhook event is received from the Webhook Queue
-
Validate Payload
Webhook payload is validated against platform-specific schemas
-
Route by Type
Webhook is routed to the appropriate platform handler based on type
-
Process Event
Platform-specific service processes the webhook event
-
Queue Message
If the webhook contains a message, it’s queued to WhatsApp Message Queue for processing
Error Handling
The processor implements batch processing with individual message failure handling:
- Failed messages are reported individually
- Successful messages continue processing
- Failed messages are retried up to 3 times before moving to DLQ