Scheduled Workflows

While the Workflow API is useful for building workflows that can be exposed and triggered by outside services, API Workflows can also be used to schedule workflows in your application.

Scheduled workflow use cases

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 ("Backend Workflows" page in the page navigator in the topnav).

Scheduling a workflow

First, you build an API workflow as per your needs. Next you schedule your API workflow to run at the current date-time or in the future by using the action 'Schedule API Workflow'.

You 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.

You can also schedule an API workflow on a list of things, and schedule more than one workflow at once. For performance reasons, Bubble may space in time the different executions of the workflows.

To schedule an API Workflow on a list, make sure to define your endpoint with a parameter for a particular thing. Then, when you schedule the API workflow on a list, you'll choose the type of thing, the list to run on, and for the parameter you'll be able to choose "this thing". The API workflow well then run in the context of this thing for each thing in the list.

Canceling a scheduled workflow

Schedule API Workflow action returns an ID, that can be used to cancel the scheduled workflow with the action described here. 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

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.

Viewing future workflows

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.