Skip to main content
When a campaign triggers, Trackly’s message execution system queues and delivers messages efficiently. This guide explains what happens behind the scenes.

Execution Flow

1

Campaign Triggers

At the scheduled time, the campaign begins processing
2

Audience Evaluation

The system queries matching contacts from your audiences
3

Message Queuing

Individual messages are created and queued
4

Delivery

The executor sends messages via your SMS provider
5

Status Tracking

Delivery status is tracked and updated

1. Campaign Trigger

When the scheduled time arrives:
  1. The scheduler picks up the campaign
  2. Validates configuration (sending list, audiences, creatives)
  3. Begins audience evaluation
For recurring campaigns, a new execution starts each scheduled occurrence.

2. Audience Evaluation

The system queries all selected audiences:
Audience A: 5,000 contacts
Audience B: 3,000 contacts
Overlap: 500 contacts
-----
Total unique: 7,500 contacts
Filters applied:
  • Exclude unsubscribed contacts
  • Apply frequency capping (skip if sent recently)
  • Verify phone numbers are valid

3. Message Queuing

For each contact:
  1. Select the message variant (based on percentage split or ML selection)
  2. Resolve any placeholders (, personalization)
  3. Create a QueuedTextMessage record
  4. Set the sendtime
Messages are bulk-inserted for efficiency.

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:
  1. Polls the queue for pending messages
  2. Batches messages for efficiency
  3. Sends via the configured SMS provider (Infobip, Twilio, etc.)
  4. Handles rate limiting and retries

Provider Integration

Each sending list has a provider configuration:
ProviderHow Messages Are Sent
InfobipREST API batch submission
TwilioMessaging API
CMBatch 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:
StatusMeaning
queuedMessage created, waiting to send
sentSubmitted to provider
deliveredConfirmed delivery to handset
failedDelivery failed

Delivery Webhooks

Providers send delivery status updates via webhooks:
{
  "messageId": "msg_abc123",
  "status": "DELIVERED",
  "doneAt": "2024-01-15T10:30:00Z"
}
See Delivery Status Webhook for details.

Execution Timeline

Typical timeline for a 10,000 message campaign:
TimeEvent
0:00Campaign triggers
0:01Audience evaluated (10,000 contacts)
0:02Messages queued
0:02 - 0:10Messages sent (~100/sec)
0:10+Delivery confirmations arrive
Actual timing depends on:
  • Audience size
  • Queue depth
  • Provider capacity
For messages with tracked links:
  1. Original URLs are replaced with short links
  2. MessageShortLink records are created
  3. When clicked, the link service logs the click
  4. User is redirected to the destination
See Link Tracking for details.

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)
These are logged as failed status.

Alerts

Failures can trigger alerts in Discord:
  • Delivery failures
  • Spam complaints
  • High error rates
See Discord Alerts to configure.

Monitoring Execution

Dashboard

View campaign progress in real-time:
  1. Go to Schedules
  2. Click on an active campaign
  3. See live stats: sent, delivered, failed

Metrics

MetricDescription
Send RateMessages per second
Delivery Rate% successfully delivered
Failure Rate% that failed
Click Rate% that clicked a link

Troubleshooting

Check:
  • Is the campaign scheduled and not paused?
  • Is the sending list active?
  • Are provider credentials valid?
  • Is there a queue backlog?
Common causes:
  • Invalid phone numbers in list
  • Provider issues
  • Carrier blocks
  • Rate limiting exceeded
Review failed messages for error codes.
Possible reasons:
  • Large queue from concurrent campaigns
  • Provider rate limits
  • Network issues
Contact support if delivery is significantly delayed.

Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Scheduler  │────▶│   Queue     │────▶│  Executor   │
│ (triggers)  │     │  (MongoDB)  │     │  (worker)   │
└─────────────┘     └─────────────┘     └─────────────┘


                                        ┌─────────────┐
                                        │   Provider  │
                                        │ (Infobip)   │
                                        └─────────────┘
The executor runs on dedicated infrastructure for reliable, high-throughput delivery.

Next Steps