API Workflows can be used to schedule workflows in your application. If you need to schedule some actions in the future, for instance terminate a trial one month after a user signs up, or send a reminder a week before an event, or if you need to set up some recurring events, such as sending a weekly newsletter, you'll be using Scheduled Workflows. While this is not an API per se, scheduled workflows use the same interface as API workflows to set up the different workflows that you can run the background of your application.
Setting up such workflows should be done as described above; this section explains how to set up the scheduling actions in your workflows.
You schedule an API workflow in the future by using the action 'Schedule API Workflow'. You should pick the API workflow you want to schedule and define the time of the scheduling. You'll be prompted to fill the different parameters that have been defined at the API workflow level.
This action returns an ID, that can be used to cancel the scheduled workflow with the action described below.
You can also schedule an API workflow on a list of things, and schedule more than workflow at once. For performance reasons, Bubble may space in time the different executions of the workflows.
You can use the 'Cancel a scheduled API Workflow' or the 'Cancel a list of scheduled API Workflows' actions to cancel a future workflow execution. This action takes a scheduled ID.
Setting up a recurring event starts by creating a specific type of endpoint in the API page of your app. You should pick the type 'Recurring event'. This type of events is similar to the regular endpoint, with one notable difference. Instead of defining a list of parameters, you need to define a type of things that the workflow will take as a workflow thing.
Once you have defined your recurring event, you can use the 'Set/cancel a recurring event' action to schedule the recurring event. This action takes an event, a thing, a frequency and a start date. Note that the same action is used to cancel a recurring workflow, just pick 'none' for the frequency.
If you want to update the frequency of a recurring event, you can apply the same action to a thing, and the scheduling will get updated for the following occurrences.
The Logs Tab has a scheduling section that lets you see the scheduling event after a date. You can cancel upcoming events by clicking on cancel in each row. This is equivalent as using the Cancel action shown above.