Skip to main content

Salesforce Integration

Connect botBrains to your Salesforce Service Cloud to automate case responses and enhance customer support. The integration enables botBrains to access case information, generate intelligent responses, and optionally predict and update case fields based on conversation context.

Value Proposition

The Salesforce integration brings AI-powered automation to your customer support workflow:
  • Automated Case Responses: Generate contextually relevant responses to Salesforce cases automatically
  • Intelligent Field Prediction: Use AI to predict and populate case fields like Priority, Status, Category, and custom fields based on case content
  • Private Mode Option: Generate draft responses as private notes for agent review instead of direct customer responses
  • Flexible Configuration: Control which queues to process, which case fields the AI can access, and customize AI behavior per field
  • Custom Summary Generation: Configure custom prompts to generate case summaries tailored to your business needs
  • Environment Support: Connect to both Production and Sandbox Salesforce instances

Prerequisites

Before connecting Salesforce, you’ll need:
  • A Salesforce Service Cloud organization (Production or Sandbox)
  • Administrator access to create and configure Salesforce Connected Apps
  • OAuth Client ID and Client Secret from your Salesforce Connected App
  • Access to the botBrains platform with an active project

Setup Steps

1. Create a Salesforce Connected App

First, you need to create a Connected App in Salesforce to enable OAuth authentication. botBrains uses the OAuth 2.0 Client Credentials flow to securely connect to your Salesforce instance.
  1. Log in to your Salesforce organization
  2. Navigate to Setup > Apps > App Manager
  3. Click New Connected App
  4. Fill in the basic information:
    • Connected App Name: botBrains Integration
    • API Name: botBrains_Integration (auto-filled)
    • Contact Email: Your email address
  5. In the API (Enable OAuth Settings) section:
    • Check Enable OAuth Settings
    • Callback URL: https://login.salesforce.com/services/oauth2/callback (or your Salesforce instance URL)
    • Select the following OAuth Scopes (minimum required):
      • Access and manage your data (api)
      • Perform requests on your behalf at any time (refresh_token, offline_access)
  6. Click Save and then Continue
  7. Wait a few minutes for the Connected App to be registered
  8. From the App Manager, find your Connected App and click View
  9. In the API (Enable OAuth Settings) section, click Manage Consumer Details
  10. Note down the Consumer Key (Client ID) and Consumer Secret - you’ll need these for the integration
For sandbox environments, use your sandbox instance URL (e.g., https://yourcompany--sandbox.sandbox.salesforce.com)
Keep your Client Secret secure. Do not share it or commit it to version control. If compromised, regenerate it immediately in Salesforce.

2. Configure the Integration in botBrains

  1. Navigate to your project in the botBrains platform
  2. Go to the Channels section
  3. Select the Salesforce integration category
  4. Click Add Salesforce Integration
  5. Fill in the required information:
    • Integration Name: A friendly name for this connection (e.g., “Main Salesforce Support”)
    • Salesforce Instance URL: Your Salesforce instance URL
      • Production: https://yourcompany.salesforce.com
      • Sandbox: https://yourcompany--sandbox.sandbox.salesforce.com
    • Client ID: The Consumer Key from your Connected App
    • Client Secret: The Consumer Secret from your Connected App
  6. Click Create Salesforce Integration
New integrations are created with Private Mode and Read Only mode enabled by default. This ensures safe testing before enabling write operations.

3. Configure Integration Settings

After creating the integration, you’ll see an integration card displaying your Salesforce connection. Click Edit on the card to configure advanced settings:

Integration Name

A friendly name to help you identify this integration in your project. You can update this at any time.

Private Mode

Control how botBrains creates responses:
  • Enabled: botBrains generates draft responses as private notes for agent review. Responses do not go directly to customers.
  • Disabled: botBrains responses are sent directly to customers.

Read Only Mode

Control whether botBrains can modify Salesforce data:
  • Enabled: botBrains will not have write access to Salesforce. The integration is restricted to read-only operations.
  • Disabled: botBrains can create and update cases (subject to Private Mode settings).

Exposed Case Fields

Select which Salesforce case fields the AI can access when processing cases. Only enabled fields will be visible to the AI. This controls what information the AI uses to understand the case and generate responses. The system fetches available fields from your Salesforce instance and displays them as checkboxes. Each field shows its Salesforce API name (e.g., Subject, Description, Status, Priority, CaseNumber, Origin, Type, or custom fields). By default, fields are enabled unless you explicitly disable them. Only expose fields that are necessary for the AI to understand and respond to cases.

Ignored Queues

Select queues that botBrains should not process. Cases from these queues will be skipped during automation. The system fetches all queues from your Salesforce instance and displays:
  • Queue name
  • Developer name (in parentheses if available)
Use ignored queues to:
  • Separate manual-only cases from automated ones
  • Control which support teams use AI assistance
  • Test the integration on specific queues before rolling out broadly

Summary Configuration

Enable custom prompts for generating case summaries:
  • Toggle: Enable or disable the summary prompt feature
  • Summary Prompt: When enabled, enter a custom prompt that instructs the AI how to summarize cases according to your specific requirements
This allows you to standardize how case summaries are generated across your organization.

4. Configure the Case Predictor (Optional)

The Case Predictor uses AI to automatically populate case fields based on case content and conversation history. Access it by clicking the Predictor button on your integration card.

Predictor Configuration

The predictor page is divided into two main sections:
Left Panel: Predictor Configuration
Predictor Status Use the toggle switch to enable or disable the predictor for this integration. The label shows “Enabled” or “Disabled” based on the current state. Description: “Control if predictions run for this integration.” General Instructions A text area where you provide high-level instructions for how the AI should classify and update case fields. Placeholder text: “Explain how the assistant should classify and update Salesforce case fields.” Example general instructions:
Analyze the case description and customer messages to determine the appropriate priority,
category, and status. Use sentiment analysis to gauge urgency. Prioritize cases with
technical issues or billing problems.
Field Specific Instructions An expandable accordion showing all available fields from your Salesforce instance. For each field, you can:
  • Toggle Enable/Disable: Control whether the predictor should predict values for this field
  • Field Instructions: Provide specific instructions for how to classify this particular field
Each field displays:
  • Field name (Salesforce API name)
  • Enable/Disable toggle with status label
  • Text area for field-specific instructions (placeholder: “Describe when and how to populate this field.”)
Example field instruction for Priority:
Set priority to "High" if the customer mentions downtime, data loss, or revenue impact.
Set to "Medium" for feature requests or general issues. Set to "Low" for documentation
questions or enhancement requests.
Right Panel: Test Predictions
Test your predictor configuration before enabling it in production:
  1. Salesforce Case ID: Enter a case ID (e.g., 5008d00002a1ABC)
  2. Click Run Prediction to test the current configuration
  3. Review the prediction table showing:
    • Field: The Salesforce field name
    • Current Value: The existing value in Salesforce
    • Predicted Value: The value the AI would set
    • Highlighted rows: Rows with a different background color indicate fields that would be changed
  4. Click Clear to reset the test results
  5. Adjust your general or field-specific instructions based on the results
  6. Re-run predictions until satisfied with the accuracy

5. Save Your Configuration

After configuring settings in either the Edit dialog or the Predictor page, click Save Changes to apply your configuration.

Integration Card Details

Each Salesforce integration is displayed as a card showing: Header:
  • Salesforce cloud icon
  • Integration name
  • Instance URL (clickable link with external link icon)
  • Creation date
  • Action buttons (visible on hover):
    • Predictor: Opens the case predictor configuration page
    • Edit: Opens the configuration dialog
    • Delete: Removes the integration (with confirmation)
Status Indicators:
  • Private Mode: Shows “Enabled” (gray badge) or “Disabled” (green badge)
  • Read Only: Shows “Enabled” (gray badge) or “Disabled” (green badge)
  • Summary: Shows “Enabled” (blue badge) or “Disabled” (gray badge)
  • Environment: Shows “Sandbox” (yellow badge) or “Production” (green badge)
Ignored Queues: If any queues are configured to be ignored, they’re displayed at the bottom of the card as gray badges showing the queue names.

Common Use Cases

Scenario 1: Agent-Assisted Support

Configure the integration in Private Mode to have botBrains draft responses for agent review:
  • Enable Private Mode
  • Disable Read Only to allow botBrains to add private notes
  • Configure exposed fields to give the AI necessary context
  • Agents review and approve AI-generated responses before sending

Scenario 2: Fully Automated Tier 1 Support

Set up botBrains to handle common inquiries automatically:
  • Disable Private Mode for direct customer responses
  • Use Ignored Queues to exclude complex cases
  • Configure the Case Predictor to automatically categorize and route cases
  • Set field-specific instructions for accurate classification

Scenario 3: Case Classification Only

Use botBrains primarily for intelligent case field population:
  • Enable Read Only Mode to restrict write operations
  • Enable the Case Predictor with detailed field instructions
  • Configure specific fields you want the AI to predict
  • Monitor prediction accuracy using the test feature before rolling out

Best Practices

Start in Private Mode: When first setting up the integration, enable Private Mode to review AI responses before they reach customers. This helps you calibrate the AI’s behavior for your specific use cases.
Test Predictor Extensively: Use the test prediction feature with various case types to ensure field predictions match your expectations before enabling in production.
Iterate on Instructions: Refine your general and field-specific instructions based on actual prediction results. Start broad and become more specific as needed.
Protect Sensitive Fields: Only expose case fields that are necessary for generating responses. Avoid exposing fields containing sensitive customer data unless required.
Monitor Queue Configuration: Regularly review your ignored queues to ensure critical cases aren’t being skipped unintentionally.

Troubleshooting

Connection Issues

If the integration fails to connect or you encounter authentication errors:
  1. Verify your Salesforce instance URL is correct and includes https://
  2. Confirm the Client ID and Client Secret exactly match your Connected App credentials
  3. Ensure the Connected App has the required OAuth scopes:
    • Access and manage your data (api)
    • Perform requests on your behalf at any time (refresh_token, offline_access)
  4. For sandbox environments, verify you’re using the correct sandbox instance URL format

Cannot See Queues or Fields

If the Exposed Case Fields or Ignored Queues sections are empty:
  1. Verify the integration has successfully connected to Salesforce (check the instance URL link works)
  2. Ensure your Salesforce user has permission to access Case objects and Queue information
  3. Try refreshing the page or re-opening the Edit dialog
  4. Check that your Connected App has sufficient API permissions

Predictor Not Working

If predictions aren’t being generated or applied:
  1. Check that the predictor is enabled using the toggle switch
  2. Verify at least one field is enabled for prediction in the Field Specific Instructions section
  3. Review your general instructions - ensure they’re clear and specific
  4. Test with a known case ID to see detailed results and error messages
  5. Click Save Changes after modifying predictor configuration

Field Prediction Accuracy Issues

If predicted field values don’t match expectations:
  1. Review and refine your general instructions to be more specific
  2. Add field-specific instructions for fields that aren’t predicting correctly
  3. Use the test feature with multiple different case IDs to validate consistency
  4. Ensure exposed case fields include all necessary context the AI needs
  5. Check that field values in the prediction table match your Salesforce picklist values exactly
  6. Iterate on instructions and re-test until predictions meet your accuracy requirements

Managing Multiple Integrations

You can create multiple Salesforce integrations in a single project. This is useful for:
  • Connecting both Production and Sandbox environments
  • Separating different business units or product lines
  • Testing new configurations without affecting production
Each integration operates independently with its own:
  • Connection credentials
  • Configuration settings (Private Mode, Read Only, etc.)
  • Exposed case fields
  • Ignored queues
  • Case predictor configuration
Integrations are displayed as cards sorted by creation date (most recent first).

Next Steps

After setting up your Salesforce integration:
  • Configure your AI agent to provide accurate support responses
  • Monitor conversations to review AI performance
  • Adjust case predictor settings based on test results
  • Gradually expand exposed fields and enable queues as you gain confidence