For the complete documentation index, see llms.txt. This page is also available as Markdown.

Recurring workflows

Use the Do every 5 seconds event to run a frontend workflow over and over at an interval you choose, for as long as the page is open.

Some things in your app need to happen again and again while a user is on the page. The Do every 5 seconds event runs a workflow at a set interval, for as long as the page is open.

You'll find it in the General category when you add an event:

The event menu with the General category expanded and the Do every 5 seconds event highlighted.
The event is listed under General.

Setting the interval

The 5 is flexible. You can set the interval to any number of seconds, including decimals, which need to use a dot rather than a comma. The workflow then keeps running until the page is closed, and you can use the event's Only when property to control when it runs.

The properties of a Do every 3.5 seconds event, with the interval set to 3.5 and an empty Only when field.
The interval is customizable. In the example above, it's set to 3.5 seconds.

Keeping an eye on performance

Repeating a workflow can slow down your app, depending on what the workflow does, especially as your app grows and gets more users.

Type of action
What to keep in mind

Client-side actions

These are the best fit for this event, since they don't need to send any data to or from the server.

Server-side actions

Test carefully how these affect your app. Repeated database operations in particular can use a lot of workload.


Running a workflow when the page is closed

This event stops when the page closes. To repeat something whether or not anyone has your app open, you can use a backend workflow instead. Keep in mind that backend workflows can only run server-side actions.

Option
When to use it

You want to run a workflow on a thing at a fixed frequency.

Recursive workflows

You need an interval that a recurring event doesn't offer.

You want to run a workflow once for each item in a list.


Build recurring workflows with Bubble AI

You can ask the Bubble AI Agent to create a workflow that uses the Do every 5 seconds event, which is on its list of supported frontend events. You can also ask it which actions in a workflow need the server, which can help you decide whether a workflow is a good fit for this event.

Here are a few prompts to try:

Article: Edit apps with AI


FAQ: Recurring workflows

Can I use decimals in the interval?

Yes. Decimals need to use a dot rather than a comma, like 3.5.

Does a recurring workflow keep running if the user closes the page?

No. It only runs while the page is open. To keep something running without the page, see Running a workflow when the page is closed.

Is this the same as a recurring event?

No. The Do every 5 seconds event is a frontend event that runs on an open page. A recurring event is a backend event that runs on Bubble's server.

Do recurring workflows use workload?

It depends on the actions. Actions that run only on the user's device don't add to your workload. Repeated database operations can use a lot of it.

Article: Workflows and actions

Last updated

Was this helpful?