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
- Log in to your Salesforce org
- Navigate to Setup (gear icon → Setup)
- In Quick Find, search for External Client App Manager
- Click New External Client App
Step 2: Create an External Client App
-
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
-
Under API (Enable OAuth Settings), check Enable OAuth Settings
-
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
See OAuth Redirect URI Patterns for the correct redirect URI format based on your ingress configuration.
-
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)
-
Click Save
After saving, Salesforce may take 2-10 minutes before the External Client App is ready for use.
Step 3: Get Your Credentials
- After saving, click Manage Consumer Details and verify your identity
- Copy the Consumer Key (Client ID) and Consumer Secret (Client Secret)
- Go back to the External Client App and click Manage
- Click Edit Policies
- 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
- Click Save
Required Scopes
| Scope | Description |
|---|
api | Full access to Salesforce REST API (CRUD, SOQL, SOSL) |
refresh_token | Enables offline access via refresh tokens |
id | Access to the identity URL for user info |
profile | Access 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.
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 your updated Helm values, sync integrations to make them available to users — see Activate Integrations After Deployment.
Available Actions
The Salesforce integration provides 36 actions across 9 object types:
| Object | Actions |
|---|
| Account | list_accounts, get_account, create_account, update_account |
| Contact | list_contacts, get_contact, create_contact, update_contact |
| Lead | list_leads, get_lead, create_lead, update_lead |
| Opportunity | list_opportunities, get_opportunity, create_opportunity, update_opportunity |
| Case | list_cases, get_case, create_case, update_case |
| Campaign | list_campaigns, get_campaign, create_campaign, update_campaign |
| Task | list_tasks, get_task, create_task, update_task |
| Order | list_orders, get_order, create_order, update_order |
| Product | list_products, get_product, create_product, update_product |
All list actions support SOQL filters, field selection, and pagination control via batch_size (200–2000).
- Google Workspace Integrations - Gmail, Calendar, Drive, Sheets, Slides, Docs, Contacts
- Microsoft 365 Integrations - Outlook, OneDrive, Teams, SharePoint, Excel, Word
- HubSpot Integration - Contacts, companies, deals, tickets, products
- Notion Integration - Workspaces, databases, pages, and comments