> 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/actions.md). Agents can also search and read this documentation through its [MCP server](https://manual.bubble.io/~gitbook/mcp).

# Actions

Actions are the steps in a workflow that do the work. Learn how to add them, control when they run, use data between steps, and use native mobile actions.

Actions are what **make things happen** in your app. They're the part of a workflow[^1] that does the actual work, such as changing something in the database, showing or animating an element, or sending the user to another page.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FydGrp362nPwWbAV4rsIi%2Factions-schema.jpeg?alt=media&amp;token=cdf183d1-c529-4383-a96f-74c1523fa077" alt="A diagram of a workflow, with an event pointing to actions."><figcaption><p>An event starts the workflow, and the actions do the work.</p></figcaption></figure>

Actions run as the result of an event[^2], and together they make up the workflow.

> Events decide **when** to do something, and actions decide **what** to do.

You can chain actions together to perform a set of tasks in sequence, and each step can use information from a previous step. You can also add a condition to any step, so it only runs when something is true.

***

## Working with actions

In the **Workflow** tab, a workflow's actions appear as soon as you create or open it, listed in order underneath the event.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2Fsi3RJsAk1DEBVP4F1kaT%2FCleanShot%202026-11-06%20at%2018.36.13.png?alt=media&amp;token=c17db0b7-887a-47d0-9ff5-a7546be75250" alt="The workflow canvas showing a Button Sign up is clicked event labeled Event, and a Sign the user up action below it labeled Action."><figcaption><p>The event sits at the top of the workflow, with its actions underneath.</p></figcaption></figure>

### Creating actions

To add the first action to a workflow, click the *+* icon underneath the event. You'll see a list of actions sorted into categories.

{% hint style="info" %}
You can add more actions to use across your app by installing [plugins](https://manual.bubble.io/help-guides/integrations/api/plugins-that-connect-to-apis.md), or by adding API calls in the API Connector with *Use as* set to *Action*.

**Article:** [The API Connector](https://manual.bubble.io/help-guides/integrations/api/the-api-connector.md)
{% endhint %}

When you add or click an action, Bubble shows its properties in the workflow property editor. Here's the [**Make changes to a thing**](#user-content-fn-3)[^3] action:

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FgivzGKny06NjHBBiBFsu%2Fmake-changes-to-user.png?alt=media&amp;token=f31e3a1f-3f07-468b-bea1-98f4c5bb0b52" alt="A Make changes to User action, with Thing to change set to Current User and the Name field set to Jane Doe."><figcaption><p>This action changes the current user's name to Jane Doe.</p></figcaption></figure>

*Thing to change* sets the [data source](#user-content-fn-4)[^4] of the thing you want to change. Once you've picked it, Bubble shows the fields[^5] on that [data type](#user-content-fn-6)[^6]. In the example above, we change the user's name to a static text value.

### Setting conditions for running an action step

A workflow can have as many steps as you need, but sometimes a step should only run in certain situations. For example, a step might require the user to be logged in, and if they aren't, you can show an error message instead.

That's what the *Only when* field is for. As the name suggests, it tells Bubble to *only run this action when* a condition is true. Conditions are [dynamic expressions](#user-content-fn-7)[^7] that return a *yes* or *no* value.

{% hint style="info" %}
This step uses dynamic expressions to set up conditions. If you're new to these, it can help to read these articles first:

**Article:** [Dynamic expressions](https://manual.bubble.io/help-guides/logic/dynamic-expressions.md)\
**Article section:** [Conditions](https://manual.bubble.io/help-guides/logic/conditions.md#only-when-conditions-workflow-conditions)
{% endhint %}

To stop an action from running at all without deleting it, you can turn on its *Disable Action* toggle.

**Article section:** [Disabling workflows and actions](https://manual.bubble.io/help-guides/logic/workflows.md#disabling-workflows-and-actions)

***

## The order in which actions are triggered

{% hint style="warning" %}
A workflow is built as a list of steps, but a lot happens behind the scenes when it runs, and steps don't always finish in the order you placed them.

Some actions run in the user's browser, others, like database operations, run on Bubble's server, and some run in both places. When a workflow mixes these, the order things happen in can differ from the order in the workflow.
{% endhint %}

To keep things fast, workflows run in parallel across the user's device and the server. Even though steps are numbered, a step doesn't necessarily wait for the previous one to finish before the next one starts. These rules explain how workflows run:

<table><thead><tr><th width="277.44921875">Rule</th><th>What it means</th></tr></thead><tbody><tr><td>Frontend actions start in order</td><td>Actions start in the order you placed them, but an action doesn't wait for the previous one to finish.</td></tr><tr><td>Backend workflows start right away</td><td>A <strong>Schedule API workflow</strong> action starts as soon as the workflow runs, even if it's the last action in the workflow.</td></tr><tr><td>Custom events run in sequence</td><td>If a workflow triggers a <a href="https://manual.bubble.io/help-guides/logic/workflows/events/frontend-events/custom-events.md">custom event</a>, the custom event finishes before the rest of the workflow continues.</td></tr><tr><td>Searches may lag behind</td><td>A search may not include a thing you just created or changed, so don't rely on it in a later step. Getting the thing from <code>Result of step X</code> is safe.</td></tr></tbody></table>

These tips can help your workflows run the way you expect:

| Situation                                                         | What to do                                                                                                                                                    |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| One trigger can lead to different results depending on conditions | Create separate workflows with conditions on the workflow itself, instead of one workflow with conditions on each action.                                     |
| Step 2's condition depends on a search affected by step 1         | Move step 1 into a custom event, so it finishes before step 2 runs.                                                                                           |
| A backend workflow should start after other steps                 | Schedule it from a custom event placed after those steps.                                                                                                     |
| A step needs data from an earlier step                            | Use `Result of step X` instead of a search. See [Using data from a previous step](#using-data-from-a-previous-step).                                          |
| An action needs to wait for something                             | Bubble can't make an action wait for a workflow to finish, but the **Add a pause before next action** action often works. It only delays client-side actions. |

**Video:** [Understanding workflow execution rules](https://youtu.be/IbhCrciOKHM)

***

## Using data from a previous step

Sometimes an action needs data from an earlier step in the same workflow. If you get that data *indirectly*, for example with a search, the change from the earlier step may not have caught up yet. The `Result of step X` data source gives you the result of that step directly.

Let's say you use [**Make changes to a thing**](https://manual.bubble.io/pages/-MTujs88N9W-2FUmQGag#make-changes-to-thing...) to change a product's name in step 1. In step 2, you use [**Set state of an element**](#user-content-fn-8)[^8] to save that name in a custom state.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FLLkt7eBvT2dtiEmcv27M%2Fset-state-from-previous-step.png?alt=media&amp;token=a6a5901c-bb31-41ab-850c-a86fb71a3b2e" alt="A workflow with a Make changes to Product action as step 1, and a Set states action as step 2 that saves Result of step 1&#x27;s Name in the Product name custom state."><figcaption><p>The numbers match the table below.</p></figcaption></figure>

| Number | What's set up                                                                                                    |
| ------ | ---------------------------------------------------------------------------------------------------------------- |
| 1      | Step 1 changes the product's name.                                                                               |
| 2      | Step 2 saves `Result of step 1's Name` in a custom state, which is the product as it looks after step 1 has run. |

***

## Native mobile actions

If you're using [Bubble for native mobile apps](https://manual.bubble.io/help-guides/getting-started/building-for.../native-ios-and-android.md), you also get actions that use the features of a phone, such as navigating between views[^9], sending push notifications, and getting the user's location.

**Reference:** [Native mobile actions](https://manual.bubble.io/core-resources/bubble-workflows/bubble-actions/native-mobile-actions.md)

### Navigation

Mobile apps don't have pages. Instead, users move between views, and there are a few ways to take them there.

#### Go to view

The **Go to view** action takes the user to another view. Its *Navigation type* decides how the view opens: as part of a stack, or as a modal.

#### Stack

Stack navigation is a pattern where users move through a "stack" of screens as they go deeper into your app. Take the Spotify app as an example. When you're on a tab, such as Home or Your Library, and open a playlist, you're looking at a new screen while the original tab stays active underneath. The new view is "stacked" on top of the base view, which is the tab itself. To go back, you tap the back arrow in the upper-left corner.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FkEzrbvS4hOMfChI1WQFQ%2FCleanShot%202024-09-11%20at%2014.31.58.png?alt=media&amp;token=64af1cc4-3402-4f5c-a8bd-bacd604106ee" alt="The top bar of a mobile view, with a back arrow next to the title Check in." width="563"><figcaption><p>The presence of a back button in the top left is an indicator that you’re navigating through a stack of views.</p></figcaption></figure>

#### Reset navigation stack

When the user navigates to a new view, the original stack stays active, so they can go back with the built-in back button or by swiping. If you don't want them to go back, turn on *Reset navigation stack* in the **Go to view** action. This clears the navigation history completely.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FYV2zzCQwYBpUpTALrjNf%2Freset-navigation-stack-bubble.png?alt=media&amp;token=015f7d2c-81ab-45e1-880b-0ecc3c933339" alt="A Go to view action with Navigation type set to Stack, and the Reset navigation stack checkbox highlighted." width="380"><figcaption><p>Resetting the navigation stack is performed within the <em>Go to view</em> action.</p></figcaption></figure>

For example, if a stack shows a login form and the user logs in, you probably don't want them to go back to the login screen. Resetting the stack lets them start fresh from the new view.

{% hint style="warning" %}
Resetting the stack removes the original stack from Bubble's memory. You can no longer use any data from the original view, such as form content, and actions that target that stack, like resetting the form, will fail.
{% endhint %}

#### Modal

A modal opens a view as a full-screen sheet over the current view. Use one when you want to give the user a focused task that needs the whole screen. A good example is the new message screen in the iOS Messages app. You don't need the messages underneath while you write, so the modal takes up the full screen, but you can quickly get back to your messages when you're done.

To open a view as a modal, use the **Go to view** action and set *Navigation type* to *Modal*. Users can swipe down to close a modal, but it's a good idea to add a close button too. To do that, add an app bar to the view you're opening as a modal, and add a trailing button with a **Go to previous mobile view** action.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2F3GlmNOczdigm1TL2oa64%2FCleanShot%202024-09-11%20at%2014.38.51.png?alt=media&amp;token=cb3edcd1-a882-40c7-a33f-a71e7dcf7e85" alt="An app bar with the title Current view title and a Done button highlighted on the right."><figcaption><p>A trailing button in the app bar gives users a clear way to close the modal.</p></figcaption></figure>

{% hint style="info" %}
Modals are similar to [sheets](https://manual.bubble.io/help-guides/design/elements/ios-and-android-app/containers/sheet-mobile.md), since both give the user a more focused experience. A modal is a whole view, so it works best when you don't need data from the view underneath, such as the data source of a group on that view.
{% endhint %}

#### Go to tab

The **Go to tab** action works like [Go to view](#go-to-view), but the target view has to be connected to a [tab](https://manual.bubble.io/help-guides/design/elements/ios-and-android-app/the-view.md#tab-navigation). When the action runs, the tab bar updates to show the new tab.

**Reference:** [Navigation actions in mobile apps](https://manual.bubble.io/core-resources/bubble-workflows/bubble-actions/navigation-actions-in-mobile-apps.md)

### Set current view's property

The **Set current view's property** action sets the value of a property on the view that's currently open. To use it, you first need to define one or more properties on the view.

### Push notifications

Push notifications let you send updates, reminders, and alerts straight to a user's device, even when they aren't using your app. Whether it's a personal message, an offer, or news about activity in the app, they help keep users connected to your app's content.

Push notifications use the built-in features of iOS and Android, and they only work in native mobile apps, not in web apps.

{% hint style="warning" %}
Before you can use push notifications, you need to add your push notification settings to your app.

**Article section:** [Push notification ID and key](https://manual.bubble.io/help-guides/publishing-your-app/native-mobile-app/ios-app-store.md#push-notifications) (iOS)\
**Article section:** [Play Store push notification settings](https://manual.bubble.io/help-guides/publishing-your-app/native-mobile-app/google-play-store.md#push-notification-settings-optional) (Android)
{% endhint %}

### The devices data type

Using push notifications adds a built-in data type to your app called *devices*. It holds key information about each user's devices, and you use it to tell the **Send push notification** action where to send a notification.

The *devices* data type is read-only, so you can't rename it, rename its fields, or add new fields. It's also protected by a built-in [privacy rule](#user-content-fn-10)[^10], since the push notification token it holds is sensitive.

The data type is added as a field on the user, so you can reach it with expressions such as:

```
Current User's devices
```

```
Do a search for:User's devices
```

#### Overriding the built-in privacy rule

The push notification token is sensitive, so it generally shouldn't be shared. If you need to send it outside your app, for example to a third-party system, you can use a backend workflow and check *Ignore privacy rules when running this workflow*.

### Requesting permission to send push notifications

Both iOS and Android need the user's permission before you can send them push notifications. Ask for it with the **Request push notification permissions** action, which opens the operating system's standard prompt. The prompt is the same in every app, so you can't customize it.

Set this up before you start sending notifications.

### Sending push notifications

Once the user has given permission, you can send push notifications with the **Send push notification** action, which you'll find in the *Emails and notifications* category.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FY2DdsUjxTb0P6sAwbkXa%2Fsend-push-notifications.png?alt=media&amp;token=1ac52e55-492f-452b-928e-d508a7bf6e2e" alt="The properties of a Send push notification action, with a title, subtitle, body, devices, tap destination fields, and an Only when condition." width="278"><figcaption><p>The properties of the <strong>Send push notification</strong> action.</p></figcaption></figure>

| Property            | What it does                                                                                                                                             |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title               | The main header                                                                                                                                          |
| Subtitle            | The sub-header                                                                                                                                           |
| Body                | The main message                                                                                                                                         |
| Devices             | The [devices](#the-devices-data-type) to send the notification to, from one or more users. To send it to the current user, use `Current User's devices`. |
| On tap, navigate to | The view to open when the user taps the notification. See [Configuring a tap destination](#configuring-a-tap-destination).                               |

Your app icon is shown in the notification, and you can't change it for individual notifications. The properties work the same way on iOS and Android, and the notification looks much the same on both.

#### Configuring a tap destination <mark style="color:$info;">(optional)</mark> <a href="#configuring-a-tap-destination" id="configuring-a-tap-destination"></a>

By default, tapping a push notification opens your app as it normally starts. You can also send the user straight to a specific view:

<table><thead><tr><th width="192.8671875">Property</th><th>What it does</th></tr></thead><tbody><tr><td>On tap, navigate to</td><td>The view to open. The dropdown lists all the views in your app, and the default is the root view. Picking a view turns on the other fields.</td></tr><tr><td>Overlay (optional)</td><td>A sheet or floating group on the destination view to open after navigating. The dropdown only lists those elements, and the field is disabled if the view has none. Picking an overlay overrides any conditions on it that would otherwise hide it.</td></tr><tr><td>Navigation type</td><td>Appears when the destination isn't a tab view. <em>Stack</em> pushes the view onto the navigation stack, and <em>Modal</em> opens it over the current context. If the destination is a tab view, the app switches to that tab instead.</td></tr><tr><td>Base view (optional)</td><td>Appears when the navigation type is <em>Stack</em> or <em>Modal</em>. A user who arrives from a notification has no navigation history, so this sets where the back button leads. The app builds a stack of the base view and then the destination view. If you leave it empty, the back button goes to the root view.</td></tr><tr><td>View parameters</td><td>Appears when the destination or base view has view properties, with a field for each property. Values can be static or dynamic expressions.</td></tr></tbody></table>

{% hint style="info" %}
View parameters are evaluated when the notification is sent, and the resulting values are included in the notification. Nothing is evaluated on the device when the user taps it.
{% endhint %}

#### How tap destinations work at runtime

<table><thead><tr><th width="261.2109375">Situation</th><th>What happens</th></tr></thead><tbody><tr><td>The app is closed</td><td>The app launches, reads the destination, navigates to the view, opens the overlay if one is set, and fills in the view parameters.</td></tr><tr><td>The app is in the background</td><td>The app comes to the foreground and does the same. If the user is already on the destination view, the parameters are refreshed and the overlay opens again. If they're on the base view, the destination view is added to the stack.</td></tr><tr><td>The app is already open</td><td>The destination view and its base view are used no matter where the user is in the app, and they're stacked on top of the current navigation.</td></tr></tbody></table>

If something goes wrong, the app falls back like this:

<table><thead><tr><th width="272.296875">Situation</th><th>What happens</th></tr></thead><tbody><tr><td>The destination view can't be found</td><td>For example, if it was deleted after the notification was sent. The app goes to the root view.</td></tr><tr><td>The user's session has expired</td><td>The app goes to its default logged-out state, and the destination isn't kept through the login flow. This is uncommon, since push notifications are only sent to logged-in users.</td></tr><tr><td>The destination is a tab view</td><td>The app switches to that tab and marks it as active in the tab bar.</td></tr></tbody></table>

#### Example: deep linking to a detail view

A common use is telling a user about a new comment and taking them straight to the post:

{% stepper %}
{% step %}

#### Create the backend workflow

Create a backend workflow that runs when a new comment is created, and add the **Send push notification** action.
{% endstep %}

{% step %}

#### Write the notification

Set the title and body, such as *New comment on your post*.
{% endstep %}

{% step %}

#### Set the destination

In *On tap, navigate to*, pick your *post\_detail* view, and set *Navigation type* to *Stack*.
{% endstep %}

{% step %}

#### Set the base view

Set *Base view* to your main feed view, so the back button takes the user to the feed.
{% endstep %}

{% step %}

#### Pass the post

In *View parameters*, pass the post's unique ID to the destination view's property.
{% endstep %}
{% endstepper %}

When the user taps the notification, they land on the post. Tapping back takes them to the feed.

#### Deep linking limitations

* **Payload size:** iOS and Android limit the size of a notification to about 4KB, so a lot of view parameters can push it over the limit. Keep parameter values short.
* **No deferred deep linking:** If the user has uninstalled the app, the destination isn't kept if they install it again.
* **No resume after login:** If the user has to log in again, the destination isn't kept, and they land on the default logged-out state.

### Scheduling push notifications

To send a push notification at a later time, use the **Send push notification** action in an API workflow in the [**Backend workflows** tab](#user-content-fn-11)[^11], and schedule it with the [**Schedule API workflow**](#user-content-fn-12)[^12] action.

### Testing push notifications

Push notifications can't be tested in web preview, and they can't be sent to a simulated device. To test them on a real device, use a dev build, or deploy your app and add it to TestFlight.

**Article:** [Previewing a mobile app](https://manual.bubble.io/help-guides/previewing-your-app/previewing-a-mobile-app.md)

### Create a mobile deep/universal link

The **Create a mobile deep/universal link** action creates a URL that opens a specific view in your native mobile app. You can use the URL in any later step: save it in the database, include it in an email or text message, copy it to the clipboard, or show it to the user.

The action creates one of two kinds of links, depending on its *Fallback* property:

| Link type      | When you get it                  | How it works                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Universal link | Any *Fallback* other than *None* | A standard `https://` link on your app's domain. If the app is installed, it opens the app to the destination view. Since it's a regular web link, email apps, text messages, and social media handle it well, and it falls back to the option you choose when the app isn't installed. Use it for links shared outside your app. Universal links need some [one-time setup](https://manual.bubble.io/help-guides/publishing-your-app/native-mobile-app/global-native-mobile-settings.md#universal-links). |
| Deep link      | *Fallback* set to *None*         | A link that uses your app's custom scheme, such as `myapp://`. It opens the app if it's installed, but it has no fallback: If the app isn't installed, or the link is opened on a computer, nothing happens.                                                                                                                                                                                                                                                                                               |

Use this action whenever you need a shareable link that opens your app in a specific place, for example:

* A link to a new message or an order confirmation in an email
* A link users can copy to share the content they're looking at
* An invite or onboarding link that opens a specific view
* A link saved in the database to use later

#### Setting the destination

The action uses the same destination properties as a [push notification tap destination](#configuring-a-tap-destination): *On tap, navigate to*, *Navigation type*, *Overlay*, *Base view*, and *View parameters*. For links, *Base view* appears whenever the destination isn't a tab.

View parameters are evaluated when the action runs, and the values are saved in the URL. The link is a snapshot of the data at that moment, not when someone opens it.

#### Choosing a fallback

The *Fallback* property decides what happens when the link is opened on a device that doesn't have your app, or on a computer:

<table><thead><tr><th width="185.00390625">Option</th><th>What happens</th></tr></thead><tbody><tr><td><em>None</em> (default)</td><td>The action creates a deep link with no fallback.</td></tr><tr><td><em>Web app page</em></td><td>The link opens a page in your Bubble web app, which you pick in the <em>Page</em> field. If the page has a content type, a <em>Data to send</em> field appears too, like in the <strong>Go to page</strong> action, and it's evaluated when the link is created. This option is only available if your project has a web app.</td></tr><tr><td><em>External webpage</em></td><td>The link opens the URL you enter in the <em>URL</em> field, starting with <code>http://</code> or <code>https://</code>.</td></tr><tr><td><em>App store</em></td><td>The link sends iOS users to your App Store listing and Android users to your Google Play Store listing. For iOS, this needs your iOS App Store ID. On a computer, there's no app store, so the link shows a not-found page.</td></tr></tbody></table>

{% hint style="warning" %}
The fallback options need the *Universal linking* device permission. If it's turned off in the **Settings** tab, the *Fallback* field is disabled, and the issue checker flags workflows that use one.

Universal links also need the [store setup](https://manual.bubble.io/help-guides/publishing-your-app/native-mobile-app/global-native-mobile-settings.md#universal-links) and a new build of your app. Until then, a universal link opens in the browser like any other web link.
{% endhint %}

#### The result

The action returns one value: the URL, as text. You can use it in later steps with `Result of step X`.

A deep link uses the app scheme you've set up for your app, and a universal link uses your app's live domain, which is your custom domain if you have one. Both kinds of links also carry the destination, overlay, base view, and view parameters. Use the result as it is, rather than building or editing these URLs yourself, since the format may change.

#### Where you can use the action

| Workflow type                                     | Notes                                                                                                                                         |
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Frontend workflows, on web pages and mobile views | Create links from button clicks, page loads, or any other event.                                                                              |
| Backend workflows                                 | Create links in API workflows, scheduled workflows, and recurring events. Creating a link doesn't need a mobile device, only opening it does. |

#### How links work when they're opened

If the app is installed, a link opens the same way as a push notification tap destination. See [How tap destinations work at runtime](#how-tap-destinations-work-at-runtime).

If a universal link is opened without the app, on a device that doesn't have it or on a computer, it opens in the browser and follows the fallback you picked.

#### Example: shareable content link

Here's how to let users share a link to the content they're looking at:

{% stepper %}
{% step %}

#### Add a share button

Add a *Share* button to your detail view, and add the **Create a mobile deep/universal link** action to its workflow.
{% endstep %}

{% step %}

#### Set the destination

Set *On tap, navigate to* to your detail view, set *Navigation type* to *Stack*, and set *Base view* to your main feed or home view, so the back button leads somewhere useful.
{% endstep %}

{% step %}

#### Pass the content

In *View parameters*, pass the content's unique ID to the destination view's property.
{% endstep %}

{% step %}

#### Set a fallback

Set *Fallback* to *Web app page* and pick the content's web page, or to *App store* if your project has no web app. That way the link still works for people who don't have the app.
{% endstep %}

{% step %}

#### Share the link

In the next step, use an action like **Copy to clipboard** or **Send email** with `Result of step X`.
{% endstep %}
{% endstepper %}

When someone taps the link, they land on the content with the right item loaded, and tapping back takes them to the feed.

#### Example: link in a backend email workflow

{% stepper %}
{% step %}

#### Create the backend workflow

Create a backend workflow that runs when a new order is placed, and add the **Create a mobile deep/universal link** action.
{% endstep %}

{% step %}

#### Set the destination

Set *On tap, navigate to* to your *order\_detail* view, and pass the order's unique ID in *View parameters*.
{% endstep %}

{% step %}

#### Set a fallback

Set *Fallback* to any option other than *None*. Email apps often strip deep links, so links in emails should be universal links.
{% endstep %}

{% step %}

#### Send the email

Add a **Send email** action, and include the link in the body with `Result of step X`.
{% endstep %}
{% endstepper %}

When the user taps the link in their email, they land on the order in the app.

#### Link limitations

* **Deep links have no fallback:** Some email apps, such as Gmail and Outlook, may block or strip deep links, and some social media platforms may not show them as tappable links. If the app isn't installed, or the link is opened on a computer, a deep link does nothing. Use a universal link for anything shared outside your app.
* **No deferred deep linking:** If someone without the app follows a universal link to the app store, installs the app, and opens it, they land on the app's first view, not the destination.
* **No login:** The URL doesn't include any credentials, so you can't use it for magic link logins or guest access on its own.
* **View parameters don't update:** Parameters are set when the link is created, so values that depend on data that hasn't finished loading on the page may be empty or out of date.

### Location services

Native mobile apps have two actions for location services:

* [Get current location](https://manual.bubble.io/help-guides/logic/device-resources/location-services.md#workflows)
* [Request location permissions](https://manual.bubble.io/help-guides/logic/device-resources/location-services.md#workflows)

Native mobile apps can also take photos and pick images from the user's photo library.

**Article:** [Camera and photo library](https://manual.bubble.io/help-guides/logic/device-resources/camera-photo-library.md)

***

## Build actions with Bubble AI

You can ask the [Bubble AI Agent](https://manual.bubble.io/help-guides/ai/bubble-ai-agent.md) to add and change actions in your workflows. Select the workflow or action you're working on, describe what should happen, and then check the result in the **Workflow** tab.

The Agent supports a [set list of action categories in frontend workflows](https://manual.bubble.io/help-guides/ai/bubble-ai-agent/edit-apps-with-ai.md#generate-and-modify-frontend-workflows): account, navigation, data, email and notification, element, and plugin actions. In [backend workflows](https://manual.bubble.io/help-guides/ai/bubble-ai-agent/edit-apps-with-ai.md#generate-and-modify-backend-workflows), it can add common actions, such as creating, changing, and deleting things, API calls, and **Schedule API workflow**, and it can add *Only when* conditions to individual actions. It declines very complex workflows, and it can still explain how to set up things it can't build.

Here are a few prompts to try:

{% code overflow="wrap" %}

```
Add an action to this workflow that sends the user to the dashboard page after they sign up.
```

{% endcode %}

{% code overflow="wrap" %}

```
Create a workflow that runs when the user clicks the Save button. It should create a new Task using the value from the Task name input, then show the Saved group.
```

{% endcode %}

{% code overflow="wrap" %}

```
Explain the order the actions in this workflow run in.
```

{% endcode %}

{% code overflow="wrap" %}

```
Why isn't the second action in this workflow using the updated data from the first one?
```

{% endcode %}

{% code overflow="wrap" %}

```
How do I send a push notification when someone comments on a post?
```

{% endcode %}

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

***

## FAQ: Actions

<details>

<summary>What's the difference between an event and an action?</summary>

The event decides when a workflow runs, such as when a button is clicked. The actions decide what happens next, such as saving data or showing an element.

**Article:** [Events](https://manual.bubble.io/help-guides/logic/workflows/events.md)

</details>

<details>

<summary>Do actions always run in the order I place them?</summary>

They start in that order, but an action doesn't always wait for the previous one to finish. See [The order in which actions are triggered](#the-order-in-which-actions-are-triggered).

</details>

<details>

<summary>How do I use data from an earlier step?</summary>

Use the `Result of step X` data source. It's more reliable than a search, which may not have caught up with the change yet.

</details>

<details>

<summary>How do I skip an action or stop a workflow?</summary>

To skip an action in some situations, add a condition in its *Only when* field. To skip it every time without deleting it, turn on its *Disable Action* toggle. To end the whole workflow at a certain point, use the **Terminate this workflow** action.

**Reference:** [Terminate this workflow](https://manual.bubble.io/core-resources/bubble-workflows/bubble-actions/navigation-actions-in-mobile-apps.md#terminate-this-workflow)

</details>

<details>

<summary>Do actions use workload?</summary>

Actions that run on Bubble's server, such as changing data or sending emails, use workload. Actions that run only on the user's device, like showing an element, don't.

**Article:** [Workflows and actions](https://manual.bubble.io/help-guides/workload/optimizing-workload/optimization-checklist/workflows-and-actions.md)

</details>

<details>

<summary>Can I use native mobile actions in a web app?</summary>

Most of them, like **Go to view** and **Send push notification**, only work in native mobile apps. **Create a mobile deep/universal link** is an exception, since you can use it in workflows on web pages, mobile views, and in the backend.

</details>

<details>

<summary>Is the push notification token secure?</summary>

The token is stored in the *devices* data type, which a built-in privacy rule protects. If you need to send the token to another system, you can do it from a backend workflow that ignores privacy rules. See [Overriding the built-in privacy rule](#overriding-the-built-in-privacy-rule).

</details>

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

[^2]: An event is what starts a workflow, such as a button being clicked.\
    **Article:** [Events](https://manual.bubble.io/help-guides/logic/workflows/events.md)

[^3]: *Make changes to a thing* saves changes to a specific thing in the database, such as a user's name or a product's image.\
    **Article:** [Creating, saving and deleting data](https://manual.bubble.io/help-guides/data/the-database/creating-saving-and-deleting-data.md)\
    **Reference:** [Make changes to a thing](https://manual.bubble.io/pages/-MTujs88N9W-2FUmQGag#make-changes-to-thing...)

[^4]: A data source is any place from which Bubble can retrieve data, such as the database, the current user, or an external API.\
    **Article:** [Dynamic expressions](https://manual.bubble.io/help-guides/logic/dynamic-expressions.md)

[^5]: *Fields* are where a data type stores its information. You can create as many fields as you need, and each one has a type, such as text, number, or image.\
    **Article:** [Data types and fields](https://manual.bubble.io/help-guides/data/the-database/data-types-and-fields.md)

[^6]: *Data types* are like containers for a specific kind of information, made up of fields. *User* is a built-in data type, and you can add your own, like *Product* or *Blog post*.\
    **Article:** [Data types and fields](https://manual.bubble.io/help-guides/data/the-database/data-types-and-fields.md)

[^7]: Dynamic expressions are like live formulas that update based on user input, database changes, and other things happening in your app.\
    **Article:** [Dynamic expressions](https://manual.bubble.io/help-guides/logic/dynamic-expressions.md)

[^8]: *Set state of an element* sets the value of a custom state on an element. Custom states are like variables that store information temporarily, until they're updated or the page is reloaded.\
    **Article:** [Custom states](https://manual.bubble.io/help-guides/data/temporary-data/custom-states.md)

[^9]: A view is the top-level element in a native mobile app, serving the same role that a page does in a web app.\
    **Article:** [The view element (mobile)](https://manual.bubble.io/help-guides/design/elements/ios-and-android-app/the-view.md)

[^10]: Privacy rules decide which data each user is allowed to see, before anything is sent to their device.\
    **Article:** [Protecting data with privacy rules](https://manual.bubble.io/help-guides/data/the-database/protecting-data-with-privacy-rules.md)

[^11]: Backend workflows run on Bubble's server, so they don't need anyone to have your app open.\
    **Article series:** [Backend events](https://manual.bubble.io/help-guides/logic/workflows/events/backend-events.md)

[^12]: The *Schedule API workflow* action runs an API workflow at a time you choose.\
    **Reference:** [Schedule API workflow](https://manual.bubble.io/core-resources/actions/custom.md#schedule-api-workflow)
