Skip to content
Get started
Get started
Job Schedulers from the Queue
guide · queue

Recurring work, named.

The managed alternative to a repeat option buried in a job: a named schedule you can update in place and remove by id.

Named, updatable schedules (the managed alternative to repeat in job options):

await queue.upsertJobScheduler('daily-report', {
pattern: '0 9 * * *', // cron pattern
// or: every: 3600000, // interval in ms
}, {
name: 'generate-report',
data: { type: 'daily' },
});
const scheduler = await queue.getJobScheduler('daily-report');
const schedulers = await queue.getJobSchedulers(0, 99, true);
const count = await queue.getJobSchedulersCount();
await queue.removeJobScheduler('daily-report');

The Bun client orders schedulers by their next execution time. Pagination uses zero-based inclusive start and end offsets, so (0, 99) returns at most 100 entries; end: -1 means the rest of the list. asc defaults to false. Schedulers with the same next execution time are ordered deterministically by ID in the same direction.

Scheduler IDs are global to the broker. The Bun client applies prefixKey to the ID automatically; external SDKs do not, so prefix IDs explicitly when applications share a server. TypeScript and Python filter scheduler lists to the current queue. PHP, Go, and Elixir currently return the broker-wide list, so filter its queue field in application code. Rust exposes get/remove but no list or count helper yet.

Cron JobsThe scheduling guide these schedulers belong to
Cron RecipesIntervals, timezones, repeat-after-completion
Cron Expressions & OptionsEvery field of a cron pattern, and the options
Queue APICreate a queue in embedded or TCP mode
Adding Jobsadd, addBulk, priorities, delays, durability
Deduplication and Idempotent Job AddsIdempotent adds, dedup keys, custom job ids
Querying JobsFetch jobs, states, counts and results
Queue Control and MaintenancePause, drain, obliterate, clean and repair
Progress, Job Logs and DependenciesProgress, per-job logs and dependencies
Queue Rate Limiting and Global ConcurrencyRate limits and global concurrency caps
DLQ Operations from the Queue ObjectFailed-job operations from the Queue object
Workers, Stats and Metrics from the QueueRegistered workers, stats and metrics windows
Namespaces, Auto-Batching and Store-and-ForwardNamespaces, auto-batching, store-and-forward
JobOptions ReferenceEvery JobOptions field, with defaults