FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
ScalingArchitecture
Scheduler Engine Architecture
DocsscalingArchitectureScheduler Engine Architecture
GitHub Live Sync

Scheduler Engine Architecture

Live technical documentation fetched from GitHub repository omghante/metapilot/docs/architecture/scheduler-engine.md

Broadcast Scheduler Engine Architecture

The Broadcast Scheduler Engine processes large-scale WhatsApp marketing campaigns with strict Meta Graph API rate-limiting compliance.

Broadcast Processing Flow

Rendering diagram...

Token Bucket Rate Limiting Algorithm

To respect Meta WhatsApp Tier limits and prevent account blocks, MetaPilot implements a Redis-backed Token Bucket Algorithm:
  • Capacity: 50 tokens (messages) per second per tenant.
  • Refill Rate: 50 tokens per second.
  • Enforcement:
    python
    if token_bucket.consume(tenant_id, count=1):
        send_whatsapp_message(recipient)
    else:
        task.retry(countdown=1)
    

Error Handling & Exponential Retries

  • Transient Failures (HTTP 429, 503): Retried automatically up to 3 times with exponential backoff (
    SCHEDULER_RETRY_DELAYS = [60, 300, 900]
    seconds).
  • Permanent Failures (Invalid phone number, unsubscribed): Marked as
    FAILED
    immediately without retrying.