Scheduling jobs allows you to schedule code to run at specified intervals. If you have code you need to run on a recurring basis, you can automate the process and prevent the need for human intervention by scheduling a recurring job. You can create jobs to run on any backend function.
For example, you might create jobs that:
You can schedule recurring jobs using:
You can schedule jobs to run on an hourly, daily, weekly, or monthly basis.
All times in jobs are scheduled according to UTC time. To calculate the UTC equivalent of your local time, find your location's UTC time offset. Then either add or subtract to your local time based on the offset.
For example, the Eastern Time Zone has an offset of -5, meaning it's 5 hours behind UTC time. To convert Eastern Time to UTC, add 5 hours.
The job runs within 5 minutes of the specified time.
The number and frequency of jobs you can schedule depends on whether you have a free site or a premium plan:
To simplify the process of building your jobs.config
file, you can use this third-party Jobs Config tool. It allows you to enter the details of your jobs and builds the jobs object for you. The tool also includes a validator that can check your existing jobs.config
file for errors.