Execution Flow
1. Campaign Trigger
When the scheduled time arrives:- The scheduler picks up the campaign
- Validates configuration (sending list, audiences, creatives)
- Begins audience evaluation
2. Audience Evaluation
The system queries all selected audiences:- Exclude unsubscribed contacts
- Apply frequency capping (skip if sent recently)
- Verify phone numbers are valid
3. Message Queuing
For each contact:- Select the message variant (based on percentage split or ML selection)
- Resolve any placeholders (, personalization)
- Create a
QueuedTextMessagerecord - Set the sendtime
Queue Priority
Messages are processed in order:- FIFO (first-in, first-out)
- All messages from a campaign are queued together
4. Message Delivery
The Message Executor is a dedicated worker that:- Polls the queue for pending messages
- Batches messages for efficiency
- Sends via the configured SMS provider (Infobip, Twilio, etc.)
- Handles rate limiting and retries
Provider Integration
Each sending list has a provider configuration:| Provider | How Messages Are Sent |
|---|---|
| Infobip | REST API batch submission |
| Twilio | Messaging API |
| CM | Batch API |
Rate Limiting
Providers impose rate limits. The executor:- Respects per-second limits
- Backs off on errors
- Distributes load across time
5. Status Tracking
After sending, the system tracks:| Status | Meaning |
|---|---|
queued | Message created, waiting to send |
sent | Submitted to provider |
delivered | Confirmed delivery to handset |
failed | Delivery failed |
Delivery Webhooks
Providers send delivery status updates via webhooks:Execution Timeline
Typical timeline for a 10,000 message campaign:| Time | Event |
|---|---|
| 0:00 | Campaign triggers |
| 0:01 | Audience evaluated (10,000 contacts) |
| 0:02 | Messages queued |
| 0:02 - 0:10 | Messages sent (~100/sec) |
| 0:10+ | Delivery confirmations arrive |
- Audience size
- Queue depth
- Provider capacity
Link Tracking
For messages with tracked links:- Original URLs are replaced with short links
MessageShortLinkrecords are created- When clicked, the link service logs the click
- User is redirected to the destination
Failure Handling
Retry Logic
Transient failures are retried:- Provider timeout → retry in 30 seconds
- Rate limit hit → back off and retry
- 5xx error → retry with exponential backoff
Permanent Failures
Some failures are not retried:- Invalid phone number
- Blocked/blacklisted number
- Carrier rejection (spam)
failed status.
Alerts
Failures can trigger alerts in Discord:- Delivery failures
- Spam complaints
- High error rates
Monitoring Execution
Dashboard
View campaign progress in real-time:- Go to Schedules
- Click on an active campaign
- See live stats: sent, delivered, failed
Metrics
| Metric | Description |
|---|---|
| Send Rate | Messages per second |
| Delivery Rate | % successfully delivered |
| Failure Rate | % that failed |
| Click Rate | % that clicked a link |
Troubleshooting
Messages not sending
Messages not sending
Check:
- Is the campaign scheduled and not paused?
- Is the sending list active?
- Are provider credentials valid?
- Is there a queue backlog?
High failure rate
High failure rate
Common causes:
- Invalid phone numbers in list
- Provider issues
- Carrier blocks
- Rate limiting exceeded
Slow delivery
Slow delivery
Possible reasons:
- Large queue from concurrent campaigns
- Provider rate limits
- Network issues