Configure Your Salesforce Org

Configure a Salesforce org to develop and invoke Salesforce Functions. Develop your functions in scratch orgs with Dev Hub or in sandbox orgs.

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 or Developer Edition org.

Only enable Dev Hub if you want to use scratch orgs. Skip this step if you're using sandbox orgs for development.

We occasionally perform space refreshes as part of our standard scheduled maintenance. If your space is empty with no compute environments or deployed functions, you must re-enable your space when the maintenance is complete.

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

After you enable Salesforce Functions, your sandbox org or any of the scratch orgs created from the enabled Dev Hub has Salesforce Functions enabled and authenticated.

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

You can also create compute environments connected to your Dev Hub org, deploy your 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.

    Enable Test Space is already enabled in your Salesforce Functions-enabled org.

    Green checkmark showing that Functions is connected.

    • This page is available only in orgs that have Lightning Experience enabled.
    • If you can’t find the Functions page, contact your Salesforce Administrator and make sure your org has a Salesforce Functions license.
  2. Toggle Enable Production Space, to connect Salesforce Functions to production orgs. You can’t undo this action.

Verify that developers working with Salesforce Functions have appropriate 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 Dev Sandboxes (Developer or Developer Pro only) or Manage Sandboxes (all sandbox types)

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