Your app should answer the customer right away and do the slow work in the background.

I made this video in November 2025 for my Vibe Coding Foundations 101 series. It's for non-technical founders and builders who want to vibe code on Cloudflare, though the idea works on any provider. If you're a developer, you already know this one.

In the video I said background jobs run the internet, second only to databases. That's my framing, but you use them every day. The calendar reminder that pings your phone and the email that tells you an order failed both come from background jobs.

The business case

You've probably had this happen. You buy something online, the site says it went through, and an hour or two later an email says your card didn't go through or the order failed. That email came from a background service. The site took your order, answered you, and did the real work afterward.

The same thing happens with a calendar. You set a reminder in your calendar app for next week, and when the time comes a notification shows up on your phone or in your inbox. Nobody is sitting there waiting to send it. A background job does.

For a founder, this decides whether customers wait on a spinning wheel or get an answer straight away. People close the window when a page hangs, and abandoned carts are lost sales.

How a queue works

You put a piece of work on a queue, and something picks it up off the queue later and does it.

The shoe checkout

Say you're buying shoes. You hit the buy-now button, and your browser sends a request to the server. The server keeps track of what's in your cart. In the video I stored that cart in Workers KV, from an earlier episode.

Then the card has to be charged. The order goes to a payment processor, in my example Stripe. Stripe goes to the card network, and the network checks with the bank that issued your card. If it's approved, the order goes to the warehouse, and from there to a delivery driver.

That's a lot of steps, and every one of them takes time and can fail.

Jump to

I draw the whole flow on a whiteboard in the full video on my channel: When your app needs a background job on YouTube.

Don't make them wait

You don't want the customer sitting through all of that. Stripe could be slow. The bank could decline. There might not be enough money on the card. If the page makes them wait for every step, a lot of people give up and close the window.

Answer first, work later

With a queue, the server takes the order, drops it on the queue and answers the customer right away with a confirmation. The customer is done. The slow part happens behind the scenes.

The background process that picks jobs off the queue is called a consumer. It runs the steps one by one: Stripe, the card network, the bank, the warehouse. If something goes wrong, it can trigger an email to tell you, which is the "your order failed" email from earlier.

Retries and dead letters

Steps fail. Stripe might be down for a few minutes. When that happens, the job goes back on the queue and gets tried again later, maybe in a minute, maybe in five minutes, maybe in an hour.

If it keeps failing, the job doesn't loop forever. After enough tries, it's moved to a dead-letter queue. That's a holding area for jobs that couldn't finish, set aside so a person can look at what went wrong.

Why queues matter

The value of a queue is that the work gets done. The job gets processed at least once, and retries take care of the bumps along the way. You don't lose an order because one service hiccuped.

Queues also let you schedule work. You can drop a job on the queue and keep it hidden from the consumer until later. In the video I joked about next year or five months from now. Real queue services set their own limits on how long a job can wait, so check the docs for whichever one you use.

In the video I said the entire back end of the internet runs on queue services. That's me exaggerating, but not by much. Once you see the pattern, you'll notice it in every app that tells you "we'll email you when it's ready."

Disclosure: in April 2026 I said Cloudflare gave me a $25,000 credit as sponsorship. No affiliate links.

If you want to build apps like this, take my free Cloudflare course. If you're still deciding whether Cloudflare fits, read Cloudflare for non-technical founders.

About Dwain

Dwain Browne

I'm Dwain Browne, Founder of LeadScore AI and SnapSuite. I'm a Toronto-based software architect with 25+ years across software, sales, operations and entrepreneurship. SnapSuite helps contractors and trades teams get paid faster, and LeadScore AI shows you which leads deserve your next call. I also run Vibe Code to Profit, a community helping people build software with AI.

YouTube · LinkedIn · Book a call