Supapost
Back to blog

Engineering

Why we run scheduled posts on Cloudflare Queues instead of a cron

A short write-up on the architecture behind Supapost's publishing pipeline — and why you almost never want a cron table.

· Michael
Why we run scheduled posts on Cloudflare Queues instead of a cron

When we first built scheduled publishing, the obvious design was a scheduled_posts table and a cron that polled it every minute. It worked — until it didn't.

The problems with a cron

  • Minute-level granularity means posts drift by up to 60 seconds from their scheduled time.
  • Retries are manual to implement and easy to get wrong.
  • A single slow job blocks every other post in the window.
  • Scaling across regions gets ugly fast.

Queues instead

We moved to Cloudflare Queues. When a post is scheduled we enqueue a delayed message with the publish time as the delay. Cloudflare delivers the message to a consumer worker at the right moment, retries on failure with exponential backoff, and lets us parallelise across thousands of posts without thinking about it.

Result: posts publish within seconds of their scheduled time, failures self-heal, and we deleted about 200 lines of cron bookkeeping code.