For example, let’s suppose that you have a workflow that creates a backup of some important data daily. Our workflow endpoint might look like this:To run this endpoint on a schedule, navigate to Schedules in your QStash dashboard and click Create Schedule:
Enter your live endpoint URL, add a CRON expression to define the interval at which your endpoint is called (i.e. every day, every 15 minutes, …) and click Schedule:
Your workflow will now run repeatedly at the interval you have defined. For more details on CRON expressions, see our QStash scheduling documentation.
In order to massively improve the user experience, many applications send weekly summary reports to their users. These could be weekly analytics summaries or SEO statistics to keep users engaged with the platform.Let’s create a user-specific schedule, sending a first report to each user exactly 7 days after they signed up:
This code will call our workflow every week, starting exactly seven days after a user signs up. Each call to our workflow will contain the respective user’s ID.
When creating a per-user schedule, pass a unique scheduleId to identify the schedule for better management and observability.