How to Create a Scheduled Job
In this document, you’ll learn how to create a scheduled job in Medusa.
Tip
v1.18 of @medusajs/medusa introduced a new approach to create a scheduled job. If you're looking for the old guide, you can find it here. However, it's highly recommended you follow this new approach, as the old one is deprecated.
Overview
Medusa allows you to create scheduled jobs that run at specific times during your backend's lifetime. For example, you can synchronize your inventory with an Enterprise Resource Planning (ERP) system once a day.
This guide explains how to create a scheduled job on your Medusa backend. The scheduled job in this example will simply change the status of draft products to published.