Skip to main content

Overview

RepeatableOptions (also exported as RepeatOptions) defines configuration for jobs that repeat at specified intervals.
For new implementations, use queue.upsertJobScheduler() instead of the deprecated repeat option on jobs.

Interface

Properties

pattern

pattern
string
Cron pattern for scheduling (e.g., ‘0 * * * *’ for every hour)

every

every
number
Interval in milliseconds between job executions
Use either pattern or every, not both.

limit

limit
number
Maximum number of iterations to execute

startDate

startDate
number | Date | string
Timestamp when the repeat should start

endDate

endDate
number | Date | string
Timestamp when the repeat should end

tz

tz
string
Timezone for cron patterns (e.g., ‘America/New_York’)

offset

offset
number
Offset in milliseconds to apply to the calculated next run time

immediately

immediately
boolean
If true, runs the job immediately then schedules repeats

Examples

Cron Pattern

Fixed Interval

With Timezone

Limited Iterations

With Start and End Dates

Run Immediately

With Offset

Cron Pattern Format

Cron patterns use the following format:

Common Patterns

Timezone Support

Timezones use IANA timezone identifiers:

Migration from Deprecated API

Old (Deprecated)