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:

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.

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.
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.
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
Last updated
Was this helpful?