You can schedule recurring jobs to run on any backend function at specified intervals.
To schedule recurring jobs on your site:
Add an exported function to the backend that you want to run with a scheduled job. The function can be in any backend .js
, .web.js
, or .jsw
file.
The way that you add the jobs.config
file depends on which IDE you're using.
To add the jobs.config
file:
A jobs.config
file opens in the code editor. The file includes a sample JSON object for defining scheduled jobs.
jobs.config
file to the src/backend
folder.The jobs.config
file contains a JSON object which defines all the scheduled jobs for your site. Each object in the jobs
array contains the following properties:
functionLocation
functionName
description
(optional)executionConfig
Use the jobs JSON object reference for additional details on each property.
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.
Here is an example of a JSON object configured to send a status report every Monday morning at 8:00 AM UTC time:
Schedule multiple jobs in the jobs.config
file by adding additional objects to the jobs
array.
You must publish your site to save changes to your scheduled jobs.