Workflows

This section covers workflows - the engine in your app that makes stuff happen.

Workflows are the engine of your application – they are how you instruct Bubble to respond to what the user does, such as clicking a button, with a set of actions that can do anything from hiding/showing or animating things on the page to making changes in the database and make external API calls.

A workflow is the combination of an event that triggers one or more actions.

Events

An event is anything that tells a workflow to run, such as:

  • A button being clicked

  • An input's value being changed

  • A condition being true

  • A user logging in or out

  • Changes in the database

Events can run on a page, or they can be triggered (which doesn't require that a user has a page open).

Article series: Events

Actions

Actions are the operations that take place when a workflow is triggered by an event. You can place as many actions as you need inside one workflow. Actions can do things like:

  • Creating, updating and deleting things in your database

  • Hiding, showing and animating elements on the page

  • Creating user accounts and logging users in/out

  • Sending emails

  • Navigating to a different page

  • Loading data

  • Using plugins, such as making a payment

This is not an exhaustive list, but as you can see, the actions in a workflow is how you make your app respond to a user's actions or changes in conditions.

Article: Actions

Organizing workflows

Workflows in the workflow editor can be categorized in two ways for easier navigation: by creating folders and adding colors to workflows. There are no rules or best practices on how to best organize your workflows, but we recommend giving some thought as to how you can combine colors with folders to efficiently navigate pages with a lot of workflows.

Colors

Each workflow you add can be given one of the following colors:

  • Gray (default)

  • Blue

  • Red

  • Green

  • Orange

  • Purple

  • Cyan

  • Brown

Folders

You can also organize workflows into folders, available by expanding the workflow folder navigator on the left-hand side of the workflow editor. There are no folders by default, but you can create as many as you need. Workflows can belong to one folder, and workflows that are in no folders will be visible in the All workflows view or No folder assigned view.

In the example above we have created a folder called Page load where we can place anything related to the page loading. Also notice the Workflow tree underneath the Workflow folders, which will reflect whichever folder you have open to leat you navigate workflows on complex pages.

Errors in workflows

Workflows can hit errors in different scenarios. For example:

  • A user tries to log in using the wrong credentials

  • A user tries to sign up using an email that already exists in the database

  • A credit card payment fails because the card is declined

If a workflow runs into an error, it will stop running on the action where the error happened. Any previous actions will not be reverted.

Note that the errors we are discussing in this section are related to system errors, and not to errors that are flagged by Bubble's issue tracker.

Handling errors

Bubble's default way to communicate most errors is to show the error in the browser's standard message popup. You can instruct Bubble to handle errors on specific elements or more broadly on a page by using two different events. The links below point to guides for each type:

An element has an error running a workflow

This event will catch errors that happen related to a specific element. For example, if a Log in button connected to a workflow containing the Log the user in action generates an error, the error will be connect to that button.

Article section: Using the An element has an error running a workflow event

An unhandled error occurs

This event will catch errors more broadly: any error on the page will trigger it unless it's caught by another error event.

Video tutorial: How to use the Unhandled Error Occurs event

Workflow timeouts

In rare instances, workflows can , generally indicating that the server has been overwhelmed with tasks that it cannot complete within a five-minute window. Bubble may also halt processing to preserve system stability, or timeouts may occur due to technical issues like lost server connections.

Timeouts are more likely with or those processing large volumes of data. For instance, operations like Make changes to a list of things are efficient for up to 1,000 records but may slow down or time out beyond that number. For handling lists approaching or exceeding 10,000 records, it's highly recommended to use backend operations better suited for large data volumes.

If you want to learn more about bulk operations, you can have a look at the article below:

Article: Bulk operations

We also explore optimizing your app for performance and in the article below. This can be helpful if you plan to work with large amounts of data or particularly demanding server processes:

Article series: Optimizing for workload

Last updated