You are here:
Add a Flow Link to a Record Page
Add a custom link to a record page that starts an active screen flow or autolaunched flow. Use the flow's web address (URL) to set up the link.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: | Manage Flow |
Create the Flow
Create an autolaunched flow or screen flow to launch from the link. Optionally, you can send the ID of the record where the link is clicked to the flow. To send the record ID to the flow, so the flow knows what record to work on, create a flow variable called recordId to hold the ID.
-
Open the Flows list view.
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
- From the Automation app, select the Flows tab.
- From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
-
Create an autolaunched flow or a screen flow.
- From the Automation app, click New. Then select the Autolaunched Flow (No Trigger) tile or the Screen Flow tile.
- From Setup, click New Flow. Then select the Autolaunched Flow (No Trigger) tile or the Screen Flow tile..
Flow Builder opens. -
Optionally, add a text variable to store the record ID.
-
To open the Toolbox, click
.
- Click New Resource, and then select Variable.
- For API Name, enter recordId.
- For Description, enter Stores the ID of the record that the link is located on. This value is passed into the flow.
- For Data Type, select Text.
- Select Available for input.
- Click Done.
-
To open the Toolbox, click
- Optionally, add more variables to store additional input values that are sent to the flow when it runs. Learn about adding input values, in addition to the record ID, to the URL in Send Variable Values to a Flow Using the Flow's URL.
-
Add elements to your flow to perform the actions you want.
For example, if the flow has the ID of the contact sent into the flow, you can use a Send Email action to email the contact by setting Record ID to the recordId variable.
- Save the flow.
- Test the flow by clicking Debug and using test data.
- Click Activate.
Get Your Flow's URL
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
-
For the flow that you want to run, click
, and select View Details and Versions.
-
Copy the flow's URL.
The format of the URL is /flow/My_Flow.
Create a Custom Link
- From Setup, click Object Manager.
-
Click the object that you want to add a record page link to. For example,
Contact.
The object window opens.
- Click Buttons, Links, and Actions.
- Click New Button or Link.
- Give the link a label and name.
- For Display Type, select Detail Page Link.
- Leave the default values for the remaining fields.
-
In the large text box, enter your flow's URL, and then add
/lightning to the start of the URL.
The full text looks like
/lightning/flow/My_Flow. -
If you want to pass the ID of the record that the button is located on, add the value of
the recordId input variable in the URL. For example, if the button is located on account
records, enter ?flow__recordId={Account.Id}. So the full URL is
/lightning/flow/My_Flow?flow__recordId={Account.Id}. - Save your work.
Note We recommend using Lightning experience and adding /lightning to the
beginning of your flow URL. However, if you don't add /lightning to the flow
URL, it still works, you just don't get the new benefits of running in Lightning. To learn
more, see Choosing Between Lightning and Non-Lightning Flow URL Formats.
Note Optionally, you can customize what happens when the flow ends. To learn more, see Customize Flow Finish
Behavior.
Add the Custom Link to the Page Layout
- Click Page Layouts.
- Click the page layout that you want to add the link to.
- Click Custom Links.
- Drag and drop your link from the custom links list to the Custom Links section.
- Save your work.
Now, users can go to a record, click the link you created, and start the screen or autolaunched flow. If you set up input variables, those values are sent to the flow when the user clicks the Next button on the screen flow or when the autolaunched flow starts.
Did this article solve your issue?
Let us know so we can improve!

