> For the complete documentation index, see [llms.txt](https://manual.bubble.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.bubble.io/help-guides/logic/workflows/events/frontend-events/recurring-workflows.md).

# 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[^1] 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](/help-guides/logic/workflows/events.md#adding-an-event-to-a-workflow):

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FElHbMB5NgXnIUO9XLULj%2FCleanShot%202026-10-13%20at%2014.09.11.png?alt=media&amp;token=b1a69992-1c7a-4c1b-acf7-f83f49f9a4e0" alt="The event menu with the General category expanded and the Do every 5 seconds event highlighted."><figcaption><p>The event is listed under <em>General</em>.</p></figcaption></figure>

***

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

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FUDewFKq7albOBYR65LHV%2Fdo-every-5-seconds.png?alt=media&amp;token=64850a37-fcb4-448a-b020-630b7081e990" alt="The properties of a Do every 3.5 seconds event, with the interval set to 3.5 and an empty Only when field."><figcaption><p>The interval is customizable. In the example above, it's set to 3.5 seconds.</p></figcaption></figure>

***

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

<table><thead><tr><th width="209.16015625">Type of action</th><th>What to keep in mind</th></tr></thead><tbody><tr><td><a data-footnote-ref href="#user-content-fn-2">Client-side actions</a></td><td>These are the best fit for this event, since they don't need to send any data to or from the server.</td></tr><tr><td><a data-footnote-ref href="#user-content-fn-3">Server-side actions</a></td><td>Test carefully how these affect your app. Repeated database operations in particular can use a lot of <a href="/help-guides/workload.md">workload</a>.</td></tr></tbody></table>

{% hint style="warning" %}
Don't repeat a workflow more often than you need to. A longer interval can often do the job just as well.
{% endhint %}

***

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

<table><thead><tr><th width="282.24609375">Option</th><th>When to use it</th></tr></thead><tbody><tr><td><a href="/help-guides/logic/workflows/events/backend-events.md#recurring-events">Recurring events</a></td><td>You want to run a workflow on a thing at a fixed frequency.</td></tr><tr><td><a data-footnote-ref href="#user-content-fn-4">Recursive workflows</a></td><td>You need an interval that a recurring event doesn't offer.</td></tr><tr><td><a href="/help-guides/integrations/api/the-bubble-api/the-workflow-api/api-workflows/scheduling-api-workflows.md">Schedule API workflow on a list</a></td><td>You want to run a workflow once for each item in a list.</td></tr></tbody></table>

***

## Build recurring workflows with Bubble AI

You can ask the [Bubble AI Agent](/help-guides/ai/bubble-ai-agent.md) to create a workflow that uses the *Do every 5 seconds* event, which is on its list of [supported frontend events](/help-guides/ai/bubble-ai-agent/edit-apps-with-ai.md#generate-and-modify-frontend-workflows). 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:

{% code overflow="wrap" %}

```
Create a workflow that runs every five seconds and shows the Reminder group.
```

{% endcode %}

{% code overflow="wrap" %}

```
Which actions in this workflow run on the user's device, and which need the server?
```

{% endcode %}

{% code overflow="wrap" %}

```
Should this workflow be a recurring workflow on the page or a backend workflow?
```

{% endcode %}

**Article:** [Edit apps with AI](/help-guides/ai/bubble-ai-agent/edit-apps-with-ai.md)

***

## FAQ: Recurring workflows

<details>

<summary>Can I use decimals in the interval?</summary>

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

</details>

<details>

<summary>Does a recurring workflow keep running if the user closes the page?</summary>

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](#running-a-workflow-when-the-page-is-closed).

</details>

<details>

<summary>Is this the same as a recurring event?</summary>

No. The *Do every 5 seconds* event is a frontend event that runs on an open page. A [recurring event](/help-guides/logic/workflows/events/backend-events.md#recurring-events) is a backend event that runs on Bubble's server.

</details>

<details>

<summary>Do recurring workflows use workload?</summary>

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](/help-guides/workload/optimizing-workload/optimization-checklist/workflows-and-actions.md)

</details>

[^1]: A *workflow* is the combination of an event and one or more actions.\
    **Article:** [Workflows](/help-guides/logic/workflows.md)

[^2]: *Client-side actions* take place on the user's device, such as setting a custom state or changing the visibility of an element.\
    **Article:** [Client-side and server-side](/help-guides/security/client-side-and-server-side.md)

[^3]: *Server-side actions* take place on Bubble's server, such as making changes to the database.\
    **Article:** [Client-side and server-side](/help-guides/security/client-side-and-server-side.md)

[^4]: Recursive workflows are API workflows that schedule themselves to run again, immediately or after a delay.\
    **Article:** [Recursive workflows](/help-guides/integrations/api/the-bubble-api/the-workflow-api/api-workflows/recursive-api-workflows.md)
