# Connecting to Agentforce

The Salesforce Integration allows you to connect your Salesforce Agentforce agents with Wayfound, enabling comprehensive performance monitoring and management. This integration synchronizes your Salesforce agents with Wayfound's powerful analytics and evaluation tools, providing valuable insights to improve agent effectiveness.

### Before You Connect

**Salesforce Requirements** - What must be enabled in Salesforce before starting:

* Agentforce enabled with at least one active agent
* Data Cloud provisioned
* Agent Analytics enabled in Data Cloud

**Who Should Authorize the Connection?**

* A System Administrator role with have all of the required permissions
* For non-admin roles the following permissions are needed:
  * API Enabled
  * Data Cloud User permission set
  * Read access to BotDefinition
  * Approve Uninstalled Connected Apps or Use Any API Client

You need to be an active Wayfound user and admin as well as a Salesforce user with required permissions to connect Salesforce via OAuth.

### Connecting to Salesforce

To connect Salesforce to Wayfound, visit the **Agentforce** page in Wayfound's Settings tab:

<figure><img src="/files/jkea26cmQkAej43n3Zxz" alt=""><figcaption></figcaption></figure>

In the Agentforce page, click <img src="/files/kFxgICA9sHgU3r1JlJbA" alt="" data-size="line">. This will take you through Salesforce OAuth:

<figure><img src="/files/x1KBaB1CXlUcMF6iFcFQ" alt="" width="243"><figcaption></figcaption></figure>

Once you have logged into Salesforce and authorized Wayfound, you will be taken back to Wayfound's Agentforce page:

<figure><img src="/files/qJG1Nd9ZhNMfgoM97pRI" alt=""><figcaption></figcaption></figure>

### Salesforce Configuration

To connect Agentforce agents to Wayfound, agents must be enabled within Salesforce, in addition to agent analytics for Data Cloud. When Wayfound detects that each of these conditions are met, it will display a blue checkmark <img src="/files/VBABahpdJ3H01WnI5JHr" alt="" data-size="line"> next to them.

#### Enable Agentforce

If Agentforce is not turned on in Salesforce, visit the Agentforce Agents setup page by clicking <img src="/files/OC2zA7eMUOI3mCKAxHE5" alt="" data-size="line">. This will take you to the following page:

<figure><img src="/files/UtZt49SkOtP5loJHlzfD" alt=""><figcaption></figcaption></figure>

Here, take the following actions:

1. Turn on Agentforce
2. Either create a **New Agent** or enable the **Agentforce (Default) Agent**

After taking these actions, refresh Wayfound's Agentforce settings page you will see a blue checkmark <img src="/files/ixbatQUA8Toq0y5inKgJ" alt="" data-size="line">next to **Enable Agents**.

#### Enable Data Cloud

If Data Cloud is not enabled, click <img src="/files/iW7SPxCXNhimttRF9YEN" alt="" data-size="line"> to take you to visit the Einstein Feedback and Monitoring Setup page in Salesforce:

<figure><img src="/files/8jGxJCRkC0KsdsRue2tO" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**NOTE: Access to this page requires that you have already enabled Data Cloud**
{% endhint %}

Here, turn on **Agent Analytics**. It may take some time for Salesforce to update this setting. Return to Wayfound's Agentforce page to confirm that Agent Analytics have been activated. If so, Wayfound will display a blue check mark <img src="/files/ixbatQUA8Toq0y5inKgJ" alt="" data-size="line"> next to **Enable Data Cloud**.

### What Wayfound Accesses

When you authorize the connection, Wayfound requests three OAuth scopes from Salesforce:

| Scope           | What It Does                                                                 |
| --------------- | ---------------------------------------------------------------------------- |
| `api`           | Reads your list of Agentforce agents                                         |
| `cdp_api`       | Reads agent conversation transcripts from Data Cloud                         |
| `refresh_token` | Keeps the connection active so Wayfound can sync sessions in the background. |

All access is **read-only**.  Wayfound never writes data back to Salesforce.

### Syncing Agents with Wayfound

Once Salesforce is correctly set up in Wayfound, you can **activate** your agents on the platform. To do so, activate **Supervise in Wayfound** for each agent you would like to sync with Wayfound:

<figure><img src="/files/MQFmBmANNnoS6x4PMcrw" alt=""><figcaption></figcaption></figure>

Once an Agentforce agent is activated, it appear on [The Agents Page](/agents/the-agents-page.md) as any other agent. Now, you can add a role, goal, and guidelines to your agent to give the Wayfound AI Supervisor the context it needs for analyzing its performance:

<figure><img src="/files/oplfG5t1LeTDAvGD0Av2" alt=""><figcaption></figcaption></figure>

### Session Recordings with Wayfound

Every hour, Wayfound will sync with your Salesforce instance to pull your active agents' latest sessions.

{% hint style="warning" %}
Once the agent is activated it can take up to an hour for the first conversations to appear. In addition, conversations will only be pulled into Wayfound once they are in Data Cloud. This means it can take some time for conversations to appear. In the worst case, this may take several hours.
{% endhint %}

You can view your Agentforce Agents' session recordings in [Recordings](/sessions/recordings.md).

### Stop Syncing Agents

If you would like to disconnect an Agentforce agent from Wayfound, deactivate **Supervise in Wayfound** for the agent in Wayfound's Agentforce page. Disconnected agents can always be reconnected on this page. When reconnected, guidelines and previous sessions will be restored. You can always turn it back on again afterwards and you will not lose any guidelines or previous sessions synced to Wayfound.

{% hint style="info" %}
When an agent is reconnected, Wayfound will not download all sessions that have taken place during the period between the agent's deactivation and reactivation. Instead, Wayfound will only download agent sessions from the last six hours.
{% endhint %}

### Disabling Salesforce

To disconnect all Agentforce agents, click <img src="/files/aqq07PiNypNkNms8Bww9" alt="" data-size="line"> in Wayfound's Agentforce page. This will deactivate all agents and Wayfound will no longer be able to sync any agents unless Salesforce is reconnected.

<figure><img src="/files/qJG1Nd9ZhNMfgoM97pRI" alt=""><figcaption></figcaption></figure>

### Troubleshooting

| Problem                                  | Likely Cause                                                                |
| ---------------------------------------- | --------------------------------------------------------------------------- |
| OAuth authorization fails immediately    | User doesn't have API Enabled or lacks permission to approve connected apps |
| Connection succeeds but no agents appear | Agentforce isn't enabled or no agents are active                            |
| Agents appear but no conversations sync  | Data Cloud or Agent Analytics isn't enabled                                 |
| "Access Denied" or scope errors          | User is missing the Data Cloud User permission set                          |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wayfound.ai/agents/connecting-to-agentforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
