Configure Your Salesforce Org

Configure a Salesforce org to develop and invoke Functions.

Enable Dev Hub

A Developer Hub (Dev Hub) org lets you create and manage scratch orgs. A scratch org is a source-driven and disposable deployment of Salesforce code and metadata, made for developers and automation.

Enable Dev Hub in a production, sandbox, or Developer Edition org.

Enable Functions

Enable Salesforce Functions to create an authenticated connection for requests between your org and Salesforce Functions.

After you enable Functions, every scratch or sandbox org created from this Dev Hub org has Functions enabled and authenticated.

You can also create compute environments connected to your Dev Hub org, deploy Functions to these compute environments, and invoke them from the org.

  1. In your org, from Setup, enter Functions in the Quick Find box and select Functions.

    Functions Setup screenshot

    This page is available only in orgs that have Lightning Experience enabled.

  2. Click Enable Functions.

  3. In the Salesforce login page, enter your Dev Hub admin login username and password.

    The connection process can take a few minutes.

    Green checkmark showing that Functions is connected.

    If the connection process isn't successful, click Try Again, or contact Salesforce.

  4. To use sandbox and scratch orgs, select Enable Test Space.

  5. To connect Functions to production orgs, select Enable Production Space.

Sandbox orgs that you created from your Dev Hub org before you enabled Functions aren't enabled for Functions. Enable Functions for each of those sandbox orgs.

Permission Sets for Functions Developers

Verify that developers working with Functions have the correct Salesforce permissions.

We recommend creating and assigning these permission sets.

Permission Set NameLets the user...Required System Permissions
FunctionsAccess
  • Use Functions services and functionality.
  • Access any functionality that relies on the Heroku platform including login through CLI.
  • Deploy Functions to Scratch and Sandbox Orgs.
  • Compute Access
FunctionsProdAccess
  • Perform any actions that require access to a production space.
  • Deploy Functions-related metadata in your Salesforce Org.
  • Compute Production Access
  • Customize Application
FunctionsAdminAccess
  • Manually deploy Functions to your Production Space.
  • Manage Permission Sets.
  • Compute Production Access
  • Manage Custom Permissions
  • Manage Session Permission Set Activations
SalesforceDXAccess
  • Create and manage scratch orgs.
  • Add new Apex classes for Functions.
  • API Enabled
  • Author Apex
  • Manage Sandboxes

See Create Permission Sets and Assign Permission Sets to a Single User in Salesforce Help.

Configure Session Timeout Settings

Set session timeout to at least 15 minutes to ensure that invoked functions complete execution. See Modify Session Security Settings.