Quickback Docs

Queues

Background processing with Cloudflare Queues in the Quickback Stack.

Cloudflare Queues provide reliable, at-least-once message delivery for background processing. Quickback uses queues for embedding generation, webhook delivery, and custom background jobs.

Built-in Queues

The compiler auto-configures queues when certain features are enabled:

FeatureQueue BindingPurpose
EmbeddingsEMBEDDINGS_QUEUEAsync embedding generation via Workers AI
WebhooksWEBHOOKS_QUEUEAsync webhook delivery with retry
CustomUser-definedYour own background processing

Queue Defaults

SettingDefault
Max batch size10 messages
Max batch timeout30 seconds
Max retries3

Custom Queues

Define custom queue handlers for background processing like data pipelines, batch jobs, and async workflows. Custom handlers integrate into the same queue consumer as built-in queues.

database: defineDatabase("cloudflare-d1", {
  binding: "DB",
  additionalQueues: [
    {
      name: "my-app-processing-queue",
      binding: "PROCESSING_QUEUE",
      maxBatchSize: 5,
      maxBatchTimeout: 60,
      maxRetries: 5,
    },
  ],
})

How It Works

All queues share a single Cloudflare Workers queue consumer. The consumer inspects each message's type field to dispatch to the correct handler:

Message arrives → Check type field
                  ├─ "embedding"         → Embedding handler
                  ├─ "inbound"/"outbound" → Webhook handler
                  └─ "process_material"   → Custom handler

Pages

On this page