The video tutorial demonstrates how to use Wix Velo's Job Scheduler to automate backend functions on a timed schedule. It begins with an overview of the scheduler’s purpose—automating tasks such as data imports, backups, report generation, or periodic data cleanup. A concrete example is presented: a property‑listing site that needs to delete listings older than three months. The presenters walk through creating a backend cleaning function (clearOldListings) in a file named databasejobs.jsw, then adding a Jobs Config file under Site Structure. They explain the JSON structure of the Jobs Config, detailing the jobs array and key properties—functionLocation, description, executionConfig (including time, dateInMonth, dayOfWeek). The configuration is set to run the cleanup on the first day of each month at 09:00 UTC. After publishing the site, the scheduler automatically executes the function each month, removing outdated entries. The tutorial concludes with a reminder to consult Wix’s API reference for further details.
In this video, we'll show you how to use the Job Scheduler tool to execute timed tasks, allowing you to automate your workflow. With the Job Scheduler, we can automate useful tasks such as importing data, backing up a database to an external source, sending monthly reports, or deleting outdated items from a database on a daily, weekly, or monthly basis.
Let's take this property listing site, for example. All of the properties are listed in the database, but old and outdated properties create clutter in the database rather than manually cleaning it. We'll create a cleaning function and then set the job scheduler to run the function on a monthly basis. To get started, go to the editor
and enable code on the top bar. To use the Job Scheduler, we first
need a function that we want to repeat. In this example, we'll use a database cleaner and place it under backend in a file we'll name databasejobs jsw. This will hold our example function, which we've named clearoldlistings. You can use your own function or import our example code from the link in the description. Now, using the database clearing function, we'll set the Job Scheduler to dynamically execute this operation on a monthly basis.
Under Site Structure, hover over back end, click the plus sign and select Job Scheduler. A new file will be added called Jobs Config, as well as the template for the Job Scheduler. The Job Scheduler is a JSON object with a jobs array where each object in the array represents one scheduled job to be executed. Each scheduled job object has properties that, after being set up, will determine which function to run and at what intervals. Let's set the first property function location to database jobs, period. Clear old listings in order to indicate the path and name of the web module as well as the name of the function. Set the description Property to clean 3 month old listings to help you keep track of each scheduled jobs function. The third property, executionconfig, is an object whose properties will determine the time interval of job execution. In this example, we'll set the time property to 9 o'. Clock. Day of week is used to set the day of the execution property for jobs that are recurring weekly, this can be deleted. Since we want to run our cleanup job on a monthly basis, then we'll set the dateinmonth property to one, so our function will run on the first day of each month at 9:00 o' clock UTC. At any time in the future, we can add another scheduled job by adding objects like this to the jobs array. When we're finished setting up our jobs. We just need to click Publish for the changes to take effect. Now, when we monitor our Collection on the 1st of each month at 9:00 UTC, we'll see that any items uploaded more than 3 months ago were cleared from the database collection and that's it. Now you're ready to use the Job Scheduler tool to automatically call backend functions at specified time intervals. Go to wix.com for a fully detailed API reference or articles, examples and more videos.