Node.js › Background Jobs & Queues
What is the difference between a delayed job and a scheduled (repeatable) job in a Node.js job queue?
BeginnerAnswer
A delayed job runs once, after a specified delay from when it was added (like 'send this reminder email in 24 hours') -- it's a one-time future execution. A scheduled or repeatable job runs on an ongoing recurring basis according to a cron pattern or fixed interval (like 'run this cleanup task every night at 2 AM'), continuing indefinitely until explicitly removed.
// Delayed job: runs once, 24 hours from now
await reminderQueue.add('send-reminder', { userId }, { delay: 24 * 60 * 60 * 1000 });
// Repeatable job: runs every night at 2 AM, indefinitely
await cleanupQueue.add('nightly-cleanup', {}, { repeat: { pattern: '0 2 * * *' } });Real-world example An e-commerce platform uses a delayed job to send a 'complete your purchase' reminder email exactly 24 hours after a user abandons their shopping cart, while separately using a repeatable job to run inventory reconciliation every night, illustrating the two distinct use cases within the same queue system.