Last Updated on February 10, 2022 by Rakesh Gupta
An inline Visualforce page allows us to embed a Visualforce page to standard page layouts. A Visualforce page would be available for embedding in the standard page layouts provided the page is using the standard controller of that particular object. You can auto-launch a flow without user interaction, using the following methods
- Process Builder
- The Apex start() method
- Invoke a Flow from the Force.com REST API
- Inline Visualforce page
The Process Builder has its own set of limitations, for example, it is not available for all objects. One real use case from Success Community and credit goes to Kristine Curington
This article will help you to understand, how you can auto-launch a Flow from the Inline Visualforce page. Another use case triggers a Flow as soon as Contact Role is added to an opportunity. Let’s start with a business use case
Business Use case
John Hickey is working as a System administrator at Universal Container. He has received a requirement to auto add the user to a Public Group if Permission Set Lightning Experience is assigned to them.
Solution for the above business requirement
Before going ahead with the solution, you have to understand PermissionSetAssignment Object. It represents the association between a User and a Permission Set. Below are the key fields from PermissionSetAssignment object
Field Name | Details |
PermissionSetId | The Id of the PermissionSet to assign to the user-specified in AssigneeId. |
AssigneeId | The Id of the User to assign the permission set specified in PermissionSetId. |
GroupMember represents a User or Group that is a member of a public group.
There are few alternatives (Using Apex or Force.com REST API) for the above business scenario, but we will use the Flow and Inline Visualforce page to solve this. Follow the below instructions to create a Flow and Visualforce page for the above business requirement
1. First of all, create a Permission Set (Lightning Experience) and a Public Group (Lightning Experience User), as shown in the following screenshot
2. Click on Setup | Build | Create | Workflows & Approvals | Flows
3. Click on New Flow button, and it will open the Flow canvas for you. Now follow the instructions mentioned in the following video
4. Save the Flow (Type: – Flow) with name Add user to a Public Group and close the canvas. Don’t forget to Activate the Flow.

–> If the Flow doesn’t have a start point, then you will not get an activate link on the Flow detail page.
Launch a Flow from Visualforce Page
Our next task is to create a Visualforce page using the standard controller User. To create a Visualforce page, follow the below instructions
1. To embed the Flow in a Visualforce page, Click on Setup | Build | Develop | Visualforce Pages and click on the New button below is the sample code for your reference:
<apex:page standardController="User">
<flow:interview name="Add_User_to_a_Public_Group">
<apex:param name="VarT_UserID" value="{!User.Id}"/>
</flow:interview>
</apex:page>
After this, this page should show in the Page Layout editor and can be embedded on a page layout for User.
2. The next step is to embed the Visualforce page into standard user page layouts. Click on Setup | Build | Customize | Users | Pages Layouts and click on Edit link. Follow the instructions mentioned in the following screenshot

3. Once you’re done, click on the Save button.
It’s time to test the Flow
Note: – The limitation is you have to assign the permission set from user’s detail page.
The version of the flow in the video is old. Could you please update it?
visualforce code is missing
Thanks. I’ve updated the Visualforce Page code.