Skip to main content

Overview

CrewAI supports integration with Salesforce CRM, enabling your crews to interact with Accounts, Contacts, Leads, Opportunities, Cases, Campaigns, Tasks, Orders, and Products. The integration includes SOQL/SOSL query support.

Prerequisites

  • A Salesforce org (any edition with API access)
  • System Administrator or equivalent permissions to create External Client Apps
  • API access enabled for the org

Salesforce External Client App Setup

Step 1: Access Setup

  1. Log in to your Salesforce org
  2. Navigate to Setup (gear icon → Setup)
  3. In Quick Find, search for External Client App Manager
  4. Click New External Client App

Step 2: Create an External Client App

  1. Fill in the basic information:
    • External Client App Name: Enter a name (e.g., “CrewAI Integration”)
    • API Name: Auto-populated from the name
    • Contact Email: Your admin email
    • Distribution State: Leave as Local
  2. Under API (Enable OAuth Settings), check Enable OAuth Settings
  3. Set the Callback URL: Default configuration (NGINX with shared hostname):
    https://<YOUR_APPLICATION_HOST>/oauthsvc/oauth/add
    
    Separate OAuth hostname (GKE/ALB with path: "/"):
    https://<YOUR_OAUTH_HOST>/oauth/add
    
    When using GKE’s native ingress or a separate OAuth hostname with oauth.ingress.path: "/", the /oauthsvc prefix is not included. See OAuth Ingress Path Configuration.
  4. Under Selected OAuth Scopes, add the following (see Required Scopes below):
    • Manage user data via APIs (api)
    • Perform requests at any time (refresh_token, offline_access)
    • Access unique user identifiers (openid)
    • Access the identity URL service (profile, id)
  5. Click Save
After saving, Salesforce may take 2-10 minutes before the External Client App is ready for use.

Step 3: Get Your Credentials

  1. After saving, click Manage Consumer Details and verify your identity
  2. Copy the Consumer Key (Client ID) and Consumer Secret (Client Secret)

Step 4: Configure Security Policies

  1. Go back to the External Client App and click Manage
  2. Click Edit Policies
  3. Under OAuth Policies:
    • Set Permitted Users to All users may self-authorize
    • Set IP Relaxation to Relax IP restrictions (recommended for server-to-server use)
    • Set Refresh Token Policy to Refresh token is valid until revoked
  4. Click Save

Required Scopes

ScopeDescription
apiFull access to Salesforce REST API (CRUD, SOQL, SOSL)
refresh_tokenEnables offline access via refresh tokens
idAccess to the identity URL for user info
profileAccess to user profile information
The api scope grants access to all standard and custom objects. Salesforce does not support granular per-object scoping through OAuth — object-level access is controlled via Profiles and Permission Sets within the org.

Configure CrewAI Helm Values

Add your Salesforce credentials to your CrewAI Helm values:
oauth:
  enabled: true
  secrets:
    salesforce:
      clientId: "your-salesforce-consumer-key"
      clientSecret: "your-salesforce-consumer-secret"
See Built-in Integrations Configuration for complete configuration options.

Activate the Integration

After deploying the updated Helm values, you must sync the integration definitions so the platform recognizes them. Use either method: Option 1: Via Admin Panel
  1. Log in to the CrewAI web UI as an admin
  2. Navigate to Admin Panel > Tools & Integrations
  3. Click the Sync Integrations button
Option 2: Via kubectl
kubectl exec -it deploy/crewai-web -- bin/rails studio:tools:sync_crewai_tools
Until you sync, the Salesforce integration will not appear as available to users. Repeat this step after any Helm upgrade that changes OAuth credentials.

Available Actions

The Salesforce integration provides 36 actions across 9 object types:
ObjectActions
Accountlist_accounts, get_account, create_account, update_account
Contactlist_contacts, get_contact, create_contact, update_contact
Leadlist_leads, get_lead, create_lead, update_lead
Opportunitylist_opportunities, get_opportunity, create_opportunity, update_opportunity
Caselist_cases, get_case, create_case, update_case
Campaignlist_campaigns, get_campaign, create_campaign, update_campaign
Tasklist_tasks, get_task, create_task, update_task
Orderlist_orders, get_order, create_order, update_order
Productlist_products, get_product, create_product, update_product
All list actions support SOQL filters, field selection, and pagination control via batch_size (200–2000).