> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

> Connect Salesforce Service Cloud and Sales Cloud for customer support and CRM workflows

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: OAuth 2.0.
* **Connection**: A user authorizes the connection in the provider's consent screen.
* **Scopes**: `api`, `refresh_token`, `offline_access`.

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.

| Variable                   | Required | Description                                                                                                                               |
| -------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `SALESFORCE_CLIENT_ID`     | Yes      | Salesforce OAuth Consumer Key (from your Connected App) [Docs](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm). |
| `SALESFORCE_CLIENT_SECRET` | Yes      | Salesforce OAuth Consumer Secret [Docs](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm).                        |

## Setup

1. **Create a Salesforce test org**: Use a sandbox or free Developer Edition org for staging. Enable Service Cloud, Cases, and Knowledge if the demo needs support workflows.
2. **Create a Connected App**: In Salesforce Setup, create a Connected App with OAuth enabled. Add the Veryfront callback URL for the target environment.
3. **Configure OAuth scopes**: Add api, refresh\_token, and offline\_access scopes. Use the Web Server Flow with a client secret for Veryfront API environments.
4. **Store Veryfront environment credentials**: Set SALESFORCE\_CLIENT\_ID and SALESFORCE\_CLIENT\_SECRET for the matching Veryfront environment. Keep staging and production credentials separate.
5. **Grant least-privilege Salesforce permissions**: Assign the connected user access to Account, Contact, Case, CaseComment, Opportunity, Lead, and Knowledge objects required by the enabled tools.

* Staging callback: [https://api.veryfront.org/oauth/callback/salesforce](https://api.veryfront.org/oauth/callback/salesforce)
* Production callback: [https://api.veryfront.com/oauth/callback/salesforce](https://api.veryfront.com/oauth/callback/salesforce)
* Write tools should be explicitly enabled for an agent or project; read tools are the default demo surface.

Provider API reference: [https://developer.salesforce.com/docs/atlas.en-us.api\_rest.meta/api\_rest/intro\_rest.htm](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm)

## Tools

| Tool                      | Access | Description                                                                                                                                 |
| ------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Find Customer             | Read   | Find customer contacts with account context for support triage. Pass a focused SOQL query when searching by email, name, phone, or account. |
| Search Accounts           | Read   | Search Salesforce accounts with business context for support or sales work                                                                  |
| Get Account               | Read   | Get detailed information about a specific account                                                                                           |
| Search Contacts           | Read   | Search contacts with account fields for CRM follow-up and support context                                                                   |
| Get Contact               | Read   | Get a Salesforce contact by ID                                                                                                              |
| List Cases                | Read   | List Service Cloud cases for a customer, account, owner, status, or queue                                                                   |
| Get Case                  | Read   | Get a Service Cloud case by ID                                                                                                              |
| List Case Activity        | Read   | List case comments for support handoff, timeline review, and resolution context                                                             |
| Search Knowledge Articles | Read   | Search published Salesforce Knowledge articles that can help answer or deflect a support case                                               |
| List Opportunities        | Read   | List Sales Cloud opportunities for account planning and customer context                                                                    |
| Create Lead               | Write  | Create a new lead in Salesforce CRM                                                                                                         |
| Create Case               | Write  | Create a Service Cloud case for customer support                                                                                            |
| Add Case Comment          | Write  | Add a support note or customer-visible comment to a Service Cloud case                                                                      |
| Update Case               | Write  | Update status, priority, owner, or resolution fields on a Service Cloud case                                                                |
| Describe Object           | Read   | Get metadata and field definitions for a Salesforce object                                                                                  |
| Run SOQL Query            | Read   | Run a read-only SOQL query for expert inspection when curated tools are not enough                                                          |

## Project configuration

Project integration configuration is optional. When `config` is missing or `{}`, Salesforce tools keep the default compatibility behavior. New Studio saves use the object-first shape below; older `allowedSObjects`, `allowExpertSoql`, and `maxQueryRows` configs are still accepted during migration.

| Field                                                                          | Type                                 | Default in the Studio form                                                                                                | Runtime effect when saved                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataAccess.objects`                                                           | Array of Salesforce object API names | `Account`, `Contact`, `Case`, `CaseComment`, `KnowledgeArticleVersion`, plus objects required by currently selected tools | Restricts Salesforce tools to selected objects. Custom and managed-package objects such as `Customer__c` or `ns__Subscription__c` can be added by API name. Omit it or use an empty list to avoid a project-level object filter. Salesforce permissions still apply. |
| `capabilities.allowExpertSoql`                                                 | Boolean                              | `false`                                                                                                                   | Allows the raw `run_soql_query` expert path only when the tool is also explicitly enabled in the project tool list.                                                                                                                                                  |
| `capabilities.maxQueryRows`                                                    | Integer from `1` to `2000`           | `100`                                                                                                                     | Rejects SOQL queries whose top-level `LIMIT` is above this value. Omit it to avoid a project-level row limit.                                                                                                                                                        |
| `mappings.customer`, `mappings.contact`, `mappings.case`, `mappings.knowledge` | Optional mapping objects             | Account/contact/case/knowledge defaults                                                                                   | Records how this org maps Veryfront concepts to Salesforce objects, identity fields, display fields, and relationships. These mappings support custom orgs without changing agent-facing tool names.                                                                 |

Recommended Service Cloud support config:

```json title="salesforce-config.json" theme={null}
{
  "dataAccess": {
    "objects": [
      "Account",
      "Contact",
      "Case",
      "CaseComment",
      "KnowledgeArticleVersion"
    ]
  },
  "capabilities": {
    "allowExpertSoql": false,
    "maxQueryRows": 100
  },
  "mappings": {
    "customer": { "object": "Account", "identityFields": ["Name"], "displayField": "Name" },
    "contact": { "object": "Contact", "identityFields": ["Email", "Name", "Phone"], "displayField": "Name" },
    "case": { "object": "Case", "customerRelationship": "AccountId", "displayField": "CaseNumber" },
    "knowledge": { "object": "KnowledgeArticleVersion" }
  }
}
```

Enable write tools separately with the project tool allowlist. For example, select `create_case`, `add_case_comment`, or `update_case` only for agents that need to change Salesforce records.

## Example prompts

* Find the customer in Salesforce, summarize their open cases, and suggest the next support action.
* Create a Salesforce Service Cloud case with the customer, subject, priority, and issue summary I provide.
* Search Salesforce Knowledge for articles that answer this customer support issue.
* Summarize Salesforce opportunities for this account and highlight any renewal or expansion context relevant to support.

## Related

* [Salesforce integration architecture](/cloud/salesforce-integration-architecture): How the Salesforce tools scale across different Salesforce org models.
