🔔 Webhook Processing
📖 Overview
The Webhook module handles outgoing webhook notifications with retry logic and delivery tracking.
Environment Flag: QM_WEBHOOK=true
Source Location: queue-manager/crons/webhook/
🗄️ Collections Used
webhook-notification
- Operations: Read/Update
- Model:
shared/models/webhook-notification.js - Usage: Webhook delivery queue and status
webhook-endpoint
- Operations: Read
- Model:
shared/models/webhook-endpoint.js - Usage: Customer webhook endpoint configurations
🔧 Job: Webhook Notification
Cron Schedule: Every 30 seconds
Key Features
- Event Notifications: Delivers webhooks for system events
- Retry Logic: Exponential backoff for failed deliveries
- Signature Verification: Signs webhooks with HMAC
- Delivery Tracking: Records delivery attempts and results
- Rate Limiting: Respects endpoint rate limits
- Timeout Handling: Configurable request timeouts
Supported Events
- Deal created/updated
- Contact created/updated
- Subscription changed
- Invoice paid
- Report generated
- Lead captured
- Campaign status change
Delivery Process
- Query pending webhook notifications
- Load endpoint configuration
- Build webhook payload
- Sign with HMAC secret
- POST to customer endpoint
- Record delivery result
- Schedule retry if failed
Retry Strategy
- Max Attempts: 5 retries
- Backoff: Exponential (1m, 5m, 30m, 2h, 12h)
- Success Codes: 200-299
- Failure Handling: Mark failed after max attempts
Module Status: Active
Execution Pattern: High-frequency polling
Last Updated: 2025-10-10