Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Manage Users and Data Access
Create a Flow That Can Activate or Deactivate a Session-Based Permission Set

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.

Important
Important You can run queries, however, don’t make data or object updates in flows that also activate session-based permission sets.

You can’t both activate and deactivate a session-based permission set in the same flow. You must create separate flows for these actions.

  1. Create a permission set and make sure to select Session Activation Required.
  2. Assign the permission set to users.
  3. Create a flow in Flow Builder.
    1. Use a Get Records element to look up the permission set.
    2. In the Get Records element, store the permission set’s name in a variable, so that you can use the name in the action.
    3. Drag a Core Action element onto the canvas, and choose either Activate Session-Based Permission Set or Deactivate Session-Based Permission Set.
  4. Activate your flow.
  5. Distribute your flow to users who must run it.
Example
Example

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.

Tip
Tip Make sure that users who run your flow have the Run Flows permission.

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.

 
Loading
Salesforce Help | Article