A delayed job is a background job that is scheduled to execute at a specific time in the future rather than immediately. Instead of "do this now," you're saying "do this in 30 minutes" or "do this on March 15th at 9 AM."
There are three ways to schedule a background job:
| Type | When it runs | Example |
|---|---|---|
| Instant | As soon as a worker is free | Send order confirmation email |
| Delayed | At a specific future time | Send trial expiry reminder in 14 days |
| Recurring | On a fixed schedule | Generate daily report at 8 AM (cron) |
Delayed jobs run once at a future time. Recurring jobs run repeatedly on a schedule. If you need something to happen exactly once, at a specific moment — that's a delayed job.
When you create a delayed job, you specify a "run at" timestamp. The job sits in the job queue but isn't visible to workers until that timestamp arrives. Once the time comes, the queue makes the job available and a worker picks it up like any other job.
Under the hood, most queue systems use one of two approaches:
Delayed jobs deal with absolute timestamps, and timezones are a common source of bugs:
A delayed job is a background task scheduled to run at a specific future time. It sits in a queue invisibly until its scheduled time arrives, then executes like a normal job.
Specify a timestamp or a delay duration when creating the job. With Recuro, send a POST to /api/jobs with a delay parameter (in seconds) or a run_at timestamp. The job will execute at that time, with full retry and alerting support.
A delayed job runs once at a specific future time. A cron job runs repeatedly on a fixed schedule defined by a cron expression. Use a delayed job for one-off future work. Use a cron job for recurring work.
Delayed jobs are a type of background job. For recurring schedules, use a cron expression instead. Like all background jobs, delayed jobs must be idempotent in case of retry, and they sit in a queue until their run time arrives.
Recuro handles cron scheduling, retries, alerts, and execution logs -- so you can focus on building your product.
No credit card required