Queue
Send background jobs through Platformatic, Cloudflare, Vercel, Netlify, Upstash QStash, or Memory.
Use Queue to move work out of the current request. Define queue handlers once, publish jobs with runQueue(), and switch providers without rewriting your application code.
What Queue is
Queue gives you one portable way to define background jobs and send them later.
- Put queue definitions in
server/queues/**. - Register a queue with
defineQueue(handler, options?). - Publish work with
runQueue()ordeferQueue().
Queue names come from the file path, so welcome-email.ts becomes welcome-email across providers.
When Queue fits
Queue is a good fit when you want to:
- move slow work out of the request path
- retry failed jobs
- delay or rate-limit delivery
- keep one job definition while swapping between hosted and local providers
Use When to use Queue when you need to choose between Queue, Workflow, and Cron.
What stays portable
These parts stay the same when you switch providers:
- the discovery directory:
src/queues/**orserver/queues/** - the queue definition API:
defineQueue()andcreateQueue()where supported - the runtime API:
runQueue(),deferQueue(), andgetQueue() - the queue name derived from the file path
Provider-specific setup, callback delivery, bindings, and advanced native methods live on the provider pages.