You are here:
Create a Flow That Can Activate or Deactivate a Session-Based Permission Set
You can create a session-based permission set and then create a flow that users can run to activate or deactivate the permission set themselves.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create permission sets: | Manage Profiles and Permission Sets |
| To assign permission sets: | Assign Permission Sets |
| To open, edit, or create a flow in Flow Builder: | Manage Flow |
Before beginning, check out Session-Based Permission Sets to learn when to use them.
You can’t both activate and deactivate a session-based permission set in the same flow. You must create separate flows for these actions.
- Create a permission set and make sure to select Session Activation Required.
- Assign the permission set to users.
-
Create a flow in Flow Builder.
- Use a Get Records element to look up the permission set.
- In the Get Records element, store the permission set’s name in a variable, so that you can use the name in the action.
- Drag a Core Action element onto the canvas, and choose either Activate Session-Based Permission Set or Deactivate Session-Based Permission Set.
- Activate your flow.
- Distribute your flow to users who must run it.
Create a flow to pass a permission name to the Activate Session-Based Permission Set core action. First, add a Get Records element to your flow to look up the PermissionSet object. Set the Name field to the name of your session-based permission set. Then add the Activate Session-Based Permission Set core action, and set the input to your permission set name.
When the flow activates the session-based permission set, the running user obtains access to the permissions specified in your permission set during the current user session. If the flow deactivates the session-based permission set, the permissions are no longer available to the user.

