Skip to main content
LTV.ai uses AWS SQS queues for asynchronous, decoupled processing of high-volume operations like email delivery, webhook processing, and catalog sync.

Queue Overview

QueueTypePurpose
SQS_QUEUE_EMAIL_ANALYTICSStandardEmail delivery tracking and analytics
SQS_QUEUE_WEBHOOK_EVENTSStandardInbound webhook event processing
SQS_QUEUE_SCHEDULESStandardEmail schedule processing
SQS_QUEUE_OUTGOING_WEBHOOKSStandardOutbound webhook delivery
SQS_QUEUE_SEGMENTATION_REQUESTSStandardCustomer segmentation jobs
SQS_QUEUE_CATALOG_UPDATESFIFOProduct catalog sync (ordered)
SQS_QUEUE_EXTERNAL_PROFILE_PUSH_SYNCStandardExternal profile sync
SQS_QUEUE_OUTREACH_INBOUND_EMAILSStandardInbound email processing
SQS_QUEUE_INBOX_INBOUND_EMAILSStandardInbox email processing

Email Delivery Pipeline

The email delivery system uses a multi-queue pipeline:
Schedule Request


┌─────────────────────┐
│ SQS_QUEUE_SCHEDULES │  ← Email scheduling
└─────────┬───────────┘


    Batch Processing
    (group into batches)


┌─────────────────────────┐
│ SQS_QUEUE_EMAIL_ANALYTICS│  ← Delivery + tracking
└─────────┬───────────────┘


    SendGrid API


    Delivery Events
    (opens, clicks, bounces)


┌─────────────────────────┐
│ SQS_QUEUE_WEBHOOK_EVENTS │  ← Event processing
└─────────────────────────┘

Catalog Sync (FIFO)

The SQS_QUEUE_CATALOG_UPDATES queue uses FIFO ordering to ensure product catalog updates are processed in the correct order:
  • Product creation before variants
  • Price updates in chronological order
  • Inventory changes applied sequentially

Queue Processing

Queues are consumed by the SqsModule which wraps AWS SDK v3:
@SqsMessageHandler(/* queue name */)
async handleMessage(message: SQS.Message): Promise<void> {
  // Process message
  // Auto-delete on success
  // DLQ on failure
}

Dead Letter Queues

Failed messages are routed to dead letter queues (DLQ) for investigation and retry. The application monitors DLQ depth for alerting.