When you run a screen flow from a URL, you can choose between using Lightning or the non-Lightning URL format, which uses Lightning Out. We recommend using Lightning for a faster, more consistent experience. However, there are times when you need to use the non-Lightning format.
Required Editions
| View supported editions. |
When you distribute a screen flow by using a URL, such as from a button, or link, you have two options for how the flow runs.
- Add
/lightningto the beginning of the flow URL. For example,/lightning/flow/My_Flow. The flow runs inside Lightning Experience. - Use the flow URL without
/lightning. For example,/flow/My_Flow. The flow runs using Lightning Out.
We recommend adding /lightning to your flow URLs because running your flow
in Lightning gives you several benefits.
Faster Performance
When you run a flow in Lightning, most of the required components are already loaded in the browser. This setup eliminates the need for a full page load, so your flow screen loads faster.
Keep Users in Their Current Context
Running the flow in Lightning keeps users where they are in Salesforce. If users are working in Lightning Console, for example, they can keep their existing tabs open while the flow runs. Users can even switch to other tabs in Lightning Console while a flow is running, which is useful when they're working on a case or ticket and need to reference other details.
If you don't use Lightning, users navigate away from their current page, which can disrupt their workflow.
Avoid Browser Navigation Issues
If a flow runs in Lightning, there's no risk of breaking the browser's history state. Users can use the back and forward buttons as expected. When you go to a different page outside of the current Lightning app, it can cause unexpected behavior with browser navigation.
Consistent Behavior with Lightning Experience
Running flows in Lightning makes sure that your flow behaves consistently with the rest of Lightning Experience and Lightning Console. Your flow also matches the look and feel of your org's styling. You can also use local actions in your screen flow, such as showing toast notifications or opening records in the same window.
Avoid Lightning Out Limitations
If your screen flow uses standard screen components, and does run in Lightning, it's impacted by Lightning Out limitations that can affect how your flow works. Learn more about Lighting Out limitations in the Lightning Web Components Developer Guide.
When to Not Use Lightning
There are some cases when you can't add /lightning to the URL. In both
cases, don't include /lightning or the flow__ prefix in
your URL.
- You want to set values for items in a collection variable, other than sending a list of IDs from a list view to a collection variable called ids. Sending IDs from a list view to the ids collection variable is supported in Lightning. To learn more, see Send Variable Values to a Flow Using the Flow's URL.
- You want to run a flow from a navigation tab (web tab). To learn more, see Embed a Screen Flow in a Navigation Tab in Your Org.