---
schema_version: "1"
id: 1dae2afe6ad0ba79f1b66c37f7a2861c8801ca8d21eefd9d39d8b8920e194cf0
title: Understanding When a Screen Flow Finishes
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_concepts_finish.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_concepts_finish.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 9554c132108b7bdce29be1b660c6e3e19e268d5b82079aafac4803e0bf9dee04
description: Screen flows restart automatically when finished, redirecting users to the first screen. Override this behavior by adding local actions or configuring distribution settings like retURL parameters.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Understanding When a Screen Flow Finishes

Screen flows restart automatically when finished, redirecting users to the first screen. Override this behavior by adding local actions or configuring distribution settings like retURL parameters.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note For smooth finish behavior, don't create records before the first screen in the flow. You don’t want any CRUD operations running unintentionally.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:50%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d107443e69">Distribution Method</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d107443e72">Default Finish Behavior</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d107443e75">Override Options</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">URL (direct URL, web tab, custom button, custom link)</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">
              <ul>
                <li>Add a local action to the flow</li>

                <li>Set the <code>retURL</code> parameter</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">Lightning page</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">Add a local action to the flow</td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">Experience Builder page</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">Add a local action to the flow</td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">Flow Quick Action (Does not apply to LWC quick actions that have flows
              embedded.)</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Closes dialog</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">Add a local action to the flow</td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">Utility bar</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">Add a local action to the flow</td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">lightning:flow Aura component</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">
              <ul>
                <li>Add a local action to the flow</li>

                <li>Set the <code>onstatuschange</code> action</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">lightning-flow LWC component</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">
              <ul>
                <li>Define whether the flow restarts using <code>flowfinishbehavior</code></li>

                <li>Add a local action to the flow</li>

                <li>Set the <code>onstatuschange</code> action</li>

              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Distribution Method" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e69 ">flow:interview Visualforce component</td>

            <td data-label="Default Finish Behavior" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e72 ">Starts new interview</td>

            <td data-label="Override Options" class="slds-cell-wrap" style="vertical-align:top;" headers="d107443e75 ">
              <ul>
                <li>Add a local action to the flow</li>

                <li>Set the <code>finishLocation</code> attribute</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

#### See Also

- [Customize a Flow URL to Control Finish Behavior](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_internal_url_returl.htm&release=264.0.0&type=5 "By default, after a user finishes a screen flow, the screen flow redirects the user to the first screen. If you want to redirect users to another page within Salesforce when they click Finish, use the retURL parameter in the flow URL.")
- [Customize a Visualforce Component to Control the Flow's Finish Behavior](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_internal_vf_finish.htm&release=264.0.0&type=5 "By default, users who click Finish start a new interview and see the first screen of the flow. After you embed a flow in a Visualforce page, configure the finishLocation attribute to route users to another page in Salesforce.")

## Redirect Flow Users with a Local Action

By default, when a flow finishes, a new interview starts and the user sees the first screen of the flow. To instead redirect the user to another page, build or install a local action that does so. Then add the action to your flow with a Core Action element. For example, a local action can open a record, list view, or URL or to show a toast message. Or it can use the Lightning Console JavaScript API to close a console tab.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note Local actions that fire `force` or `lightning` events often don’t work properly when you run the flow from:

- Flow Builder
- Flow detail pages or list views
- Web tabs
- Custom buttons and links

Instead, test and distribute the flow with a Lightning page, Experience Builder page, flow action, or utility bar. Your developer can also add the appropriate event handlers directly to the component.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_example.png)

Example

A flow creates a lead using information entered in the Lead Info screen. The Lead Info screen stores the value of the lead ID in the leadId variable that was manually created. Then it runs the Open Lead local action, which passes the lead ID into an Aura component by using the Record ID attribute. The component uses a Lightning event to open the created lead.

![Example flow that creates a lead and then opens that lead in another tab](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_finish_override_ex.png)

![The inputs on the Local Action pass the leadId variable into the Record ID attribute in the Aura component](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/platform_automation/images/flow/flow_finish_override_inputs.png)

Let’s look at the Aura component that the local action calls: `c:navigateToRecord`.

Component Markup

```
<aura:component implements="force:lightningQuickAction, lightning:availableForFlowActions">
   <aura:attribute name="recordId" type="String" />
</aura:component>
```

Design Resource

The `recordId` attribute is declared in the design resource so that it’s configurable in the local action.

```
<design:component>
   <design:attribute name="recordId" label="Record ID" />
</design:component>
```

Client-Side Controller

When the local action runs, the flow calls the `invoke` method, which uses the `force:navigateToSObject` event to navigate to the created record.

```javascript
({    invoke : function(component, event, helper) {
   // Get the record ID attribute
   var record = component.get("v.recordId");
   
   // Get the Lightning event that opens a record in a new tab
   var redirect = $A.get("e.force:navigateToSObject");
   
   // Pass the record ID to the event
   redirect.setParams({
      "recordId": record
   });
        
   // Open the record
   redirect.fire();
}})
```

#### See Also

- [_Lightning Aura Components Developer Guide_: Runtime Considerations for Flows That Include Aura Components](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_flow_tips_runtime.htm)