# Salesforce setup for the Agentforce & Flows connector

> This guide outlines the essential Salesforce setup required for using the Integration
Service Salesforce Agentforce & Flows connector.

This guide outlines the essential Salesforce setup required for using the Integration
Service Salesforce Agentforce & Flows connector.

## Prerequisites

Before you begin, ensure the following:

* You have a System Administrator
  profile access with API enabled.

* Your Salesforce edition is
  Enterprise, Unlimited, or Developer Edition.

You can use your current Salesforce org or set up a new Agentforce Developer Edition
following the installation instructions on the [Salesforce Agentforce developer tools](https://www.salesforce.com/agentforce/dev-tools/) page.

## Installing and configuring the Salesforce Flow Agents managed package

:::note
This step is required for the integration with Salesforce
Flows. For integration with Salesforce Agentforce, skip this step entirely and
proceed directly to [Configuring a connected app in Salesforce](https://docs.uipath.com/integration-service/automation-cloud/latest/user-guide/salesforce-setup-for-the-agentforce--flows-connector#configuring-a-connected-app-in-salesforce).
:::

### Accessing and installing the AppExchange listing

Follow these steps to install the UiPath Maestro Connector for Salesforce Flow managed
package:

1. In a web browser, access the
   following web page: [Salesforce
   AppExchange](https://appexchange.salesforce.com/).
2. In the search bar, type:
   **UiPath Maestro Connector for Salesforce Flow**.
3. Select the app listing, then
   select **Get It Now**.
4. Log in using your Salesforce
   credentials to continue the installation.
5. Choose your installation
   environment:
   1. Production: For live
      Salesforce environments.
   2. Sandbox: For testing
      before production use.
      **Note**: While the UiPath connector is in
      preview, environment selection is not available.
6. Select **Install for Admins
   Only**.
   This selection grants access to the package only to system
   administrators. Alternatively, you can choose to make the managed package
   available to a specific user with appropriate permissions.
7. Check the box acknowledging the
   installation of a non-Salesforce application.
8. Select **Install**.
9. After a successful installation,
   select **Done**.
10. Verify the installation by
    checking the **Installed Packages** list for "UiPath Maestro Connector for Salesforce Flow".

### Assigning permission sets

To grant necessary permissions to users with access to the managed package:

1. Navigate to **Setup** \>
   **Users** \> **Permission Set**.
2. Locate **Agentforce Default
   Admin**.
3. Select **Manage
   Assignments**.
4. Select **Add
   Assignments**.
5. Select the required users.
6. Select **Next**, then
   **Assign**.

## Configuring a connected app in Salesforce

### Creating a connected app

1. Open **App Manager**,
   select the gear icon in the top-right corner of the window, and select
   **Setup**.
2. In the **Quick Find** box
   located on the left sidebar, type and select **App Manager**.
   The list
   of apps already available in your Salesforce org is displayed.
3. Select the **New Connected
   App** button in the top-right corner of the window.

   Figure 2. Creating a
   new connected app
     

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559071-f61608b6.webp)
4. Select **Create a Connected
   App**, then **Continue**.

   Figure 3. The Create
   a Connected App window
     

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559077-e048c69b.webp)
5. Fill in the **Basic
   Information** section for the new connected app:
   1. Provide a name. For
      example, UiPath Salesforce Agentforce Flows Connector.
   2. API name: This field
      is auto-filled based on the provided app name.
   3. Provide a contact
      email: enter your email for any support communication.
6. To enable OAuth settings for
   the new app, scroll to the **API (Enable OAuth Settings)** section.
   1. Select the **Enable
      OAuth Settings** checkbox.
   2. Specify the
      **Callback URL** by providing the connector callback URL: `https://{baseURL}/provisioning_/callback` (for example, `https://cloud.uipath.com/provisioning_/callback` for Automation Cloud).
   3. Add the required
      **OAuth Scopes**:
      * For
        Salesforce Flows:
        + Full
          access (`full`)
        + Perform requests at any time
          (`refresh_token`,
          `offline_access`)
      * For
        Salesforce Agentforce:
        + Access chatbot services
          (`chatbot_api`)
        + Access the Salesforce API Platform
          (`sfap_api`)
        + Full
          access (`full`)
        + Manage user data via APIs
          (`api`)
        + Perform requests at any time
          (`refresh_token`,
          `offline_access`)
7. Manage the security settings
   for the connected app:
   1. Enable the following
      checkboxes:
      1. **Client
         Credentials Flow**: Once enabled, select **OK** in
         the following popup window to confirm that anyone with the
         consumer key and consumer secret can access your org on
         behalf of the selected user.
      2. **Issue JSON
         Web Token (JWT)-based access tokens for named users**
         – If you intend to use the OAuth 2.0 Authorization Code for
         authentication with the Integration Service connector, do
         not enable this checkbox.
   2. Disable the following
      checkboxes:
      1. **Require
         Proof Key for Code Exchange (PKCE) Extension for
         Supported Authorization Flows**
      2. **Require
         Secret for Web Server Flow**
      3. **Require
         Secret for Refresh Token Flow**

         Figure 4. Connected App API Settings
           

         ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559081-1a8f289f.webp)
8. Select **Save** to save
   the app. The following message is displayed: "Changes can take up to 10
   minutes to take effect. Deleting a parent org also deletes all connected
   apps with OAuth settings enabled."

### Retrieving the client ID and client secret

1. Go back to **App
   Manager**.
2. Find your app (UiPath
   Salesforce Agentforce Flows Connector), select the dropdown arrow on the
   right, and select **View**.

   Figure 5. Viewing
   the app details
     

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559086-7a6b6c40.webp)
3. Select **Manage Consumer
   Details**.
4. If prompted, complete the
   security verification steps. Salesforce may request a verification code sent
   to your registered email address. Enter the code when prompted to
   proceed.
5. The following credentials are
   displayed:
   * **Consumer Key** –
     Represents the Client ID.
   * **Consumer
     Secret** – Represents the Client Secret.Important: Copy and securely store
   both values. These credentials are required to configure the
   Integration Service connector.

### Configuring the connected App for JWT and Client Credentials Flow

1. Go to **Setup** \>
   **Manage Connected Apps**.
2. Find and select your
   connected app (UiPath Salesforce Agentforce Flows Connector).
3. Select **Edit
   Policies**:
   1. Under **Client
      Credentials Flow**, configure the **Run as** user field.
      The connector impersonates this user to invoke the APIs for Flows
      and Agents.
      Note: This is the service account for the
      connector. Ensure you choose a user who has the required
      permissions (API Only access or is API enabled).
   2. Under **JWT-Based
      Access Token Settings for Named Users**:
      * Enable the
        **Issue JSON Web Token (JWT)-based access tokens**
        checkbox.
      * Set the
        **Token Timeout** to a value of 30 minutes.

        Figure 6. JWT-Based Access Token Settings for Named
        Users
          

        ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559093-6b273db2.webp)
4. Select **Save**.

### Enabling UiPath connector access to your custom Agentforce agents

:::note
This step is not required for the AgentForce (Default)
agent.
:::

For each custom agent, follow these steps:

1. Go to **Setup** and search
   for "agent".
2. Select **Agentforce
   Agents**.
3. In the  **Give Users Access
   to the Agentforce (Default) Agent** section, select the name of your
   custom agent (for example, My Agentforce Service Agent).

   Figure 7. Giving
   users access to Agentforce agent
     

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559097-d9acf139.webp)
4. Select the **Connections**
   tab, then select **Add**.

   Figure 8. Configuring connections for your custom Agentforce
   agent
     

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559101-32ad401e.webp)
5. In the **Add Connection**
   window:
   1. Set the
      **Connection** field to **API**.
   2. Provide an
      integration name, such as UiPath Connector.
   3. Under **Connected
      App**, select the connected app you previously created (UiPath
      Salesforce AgentForce Flows Connector).

      Figure 9. UiPath
      Salesforce AgentForce Flows Connector
        

      ![docs image](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-docs-image-559106-94011a1b.webp)
   4. **Save** the
      connection.

### Configuring remote site settings

1. From **App Manager**,
   select the gear icon in the top-right corner of the window and select
   **Setup**.
2. In the **Quick Find** box
   located on the left sidebar, enter **Remote Site Settings**.
3. Under Security, select
   **Remote Site Settings**.
4. Select **New remote site**
   to create a new site.
5. Configure the new site by
   providing the following information:
   * **Remote Site
     Name**: Enter an alphanumeric string, with no spaces, such as
     `UiPathRemoteSite`.
   * **Remote Site
     URL**: Enter the base URL, for example:
     `https://cloud.uipath.com`.
   * **Description**:
     Enter a description, for example: "UiPath integration base URL for
     Flow invocation". This field is optional.
   * **Active**: Ensure
     the checkbox is selected.
6. Select **Save** to confirm
   and activate these settings.

Your UiPath connector can now access your custom Salesforce agent. Ensure the agent
you want to invoke is activated.

Next, configure the Salesforce AgentForce & Flows connector in Integration
Service. Go to [Salesforce Agentforce & Flows authentication](https://docs.uipath.com/integration-service/automation-cloud/latest/user-guide/uipath-salesforce-agent-authentication) to create a connection.

## Common issues and troubleshooting

The following section lists common issues you may encounter when configuring the
Salesforce Flow Agents managed package or a connected app, and how to fix them.

### Issue: Installing the managed package fails due to missing dependencies

1. Ensure that all required Salesforce features (like API access and Einstein
   AI) are enabled.
2. Check package dependencies in the installation logs.

### Issue: Users cannot access certain features

* Verify that the correct profiles and permission sets have been assigned to the
  service account user and end users of the agent.
* Ensure you have activated the agent.

### Issue: External system fails to connect to Salesforce

* Check API settings and ensure the OAuth authentication is configured for
  the connected app.

### Monitoring and verifying the execution status of auto-launched flows triggered via the UiPath Connector

Follow these steps to access the custom Flow Execution log object in Salesforce:

1. Navigate to the **App Launcher** (the grid icon in the top-left
   corner).
2. Search for **Flow Execution** in the search bar.
3. Select the **Flow Execution** tab or object name that appears in the search
   results. This action opens the list view of Flow Execution records. A new record
   is created for each flow that is triggered via the UiPath Connector.

   Figure 10. Flow Execution records
     

   ![Flow Execution records](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-flow-execution-records-565081-4379a764.webp)
4. Select a particular Flow Execution name to view the details of that
   execution.

   Figure 11. Flow Execution details
     

   ![Flow Execution details](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-flow-execution-details-565077-14470883.webp)
