Ingest Salesforce Cases, Opportunities, Accounts, Tasks, Chatter, and Notes into CortexDB.
Salesforce Connector
The Salesforce connector ingests CRM data from Salesforce into CortexDB as typed episodes. Cases, Opportunities, Accounts, Tasks, Chatter feed items, and Notes are all captured with full metadata and entity relationships.
Setup
1. Create a Salesforce Connected App
In Salesforce Setup, create a Connected App with OAuth2 enabled:
- Enable OAuth Settings
- Add scopes:
api,refresh_token,offline_access - Note the Consumer Key (client ID) and Consumer Secret
2. Configure the Connector
export CORTEX_SALESFORCE_INSTANCE_URL=https://myorg.salesforce.com
export CORTEX_SALESFORCE_CLIENT_ID=your-connected-app-client-id
export CORTEX_SALESFORCE_CLIENT_SECRET=your-connected-app-client-secret
export [email protected]
export CORTEX_SALESFORCE_PASSWORD=your-password-plus-security-token
export CORTEX_SALESFORCE_TENANT_ID=my-app
export CORTEX_SALESFORCE_NAMESPACE=salesforce
3. Start the Connector
cortexdb-connector salesforce \
--instance-url https://myorg.salesforce.com \
--client-id your-client-id \
--client-secret your-client-secret \
--username [email protected] \
--password your-password \
--tenant-id my-app
Or with Docker:
docker run -d \
--name cortex-salesforce \
-e CORTEX_SALESFORCE_INSTANCE_URL=https://myorg.salesforce.com \
-e CORTEX_SALESFORCE_CLIENT_ID=your-client-id \
-e CORTEX_SALESFORCE_CLIENT_SECRET=your-client-secret \
-e [email protected] \
-e CORTEX_SALESFORCE_PASSWORD=your-password \
-e CORTEX_SALESFORCE_TENANT_ID=my-app \
cortexdb/connector-salesforce:latest
What Gets Ingested
| Salesforce Object | Episode Type | Content |
|---|---|---|
| Case | issue | Case subject, description, status, priority |
| Opportunity | document | Opportunity name, stage, amount |
| Account | document | Account name, industry, type |
| Task | issue | Task subject, description, status |
| Chatter FeedItem | message | Post title and body |
| Note | comment | Note title and body |
Episode Metadata
{
"type": "issue",
"content": "Case [Escalated]: Payment processing timeout for enterprise account\nCustomer reports intermittent 504 errors during checkout...",
"source": "salesforce",
"timestamp": "2026-03-17T14:30:00Z",
"metadata": {
"salesforce_object": "Case",
"salesforce_id": "5003000000D8cuI",
"status": "Escalated",
"priority": "High"
},
"entities": [
{ "type": "case", "id": "5003000000D8cuI", "name": "00001234" },
{ "type": "account", "id": "0013000001abc", "name": "Acme Corp" },
{ "type": "user", "id": "0053000000xyz", "name": "0053000000xyz" }
]
}
Configuration
| Variable | Default | Description |
|---|---|---|
| CORTEX_SALESFORCE_INSTANCE_URL | Required | Salesforce instance URL |
| CORTEX_SALESFORCE_CLIENT_ID | Required | OAuth2 connected app client ID |
| CORTEX_SALESFORCE_CLIENT_SECRET | Required | OAuth2 connected app client secret |
| CORTEX_SALESFORCE_USERNAME | Required | Salesforce username |
| CORTEX_SALESFORCE_PASSWORD | Required | Password (with security token appended) |
| CORTEX_SALESFORCE_OBJECTS | Case,Opportunity,Account,Task,FeedItem,Note | Comma-separated object types |
| CORTEX_SALESFORCE_TENANT_ID | Required | Target tenant |
| CORTEX_SALESFORCE_NAMESPACE | salesforce | Target namespace |
| CORTEX_SALESFORCE_BACKFILL_DAYS | 90 | Days of history to backfill |
| CORTEX_SALESFORCE_POLL_INTERVAL_SEC | 60 | Polling interval |
Backfill
On first run, the connector backfills records modified within the last CORTEX_SALESFORCE_BACKFILL_DAYS days (default 90). Subsequent syncs use incremental LastModifiedDate filtering via SOQL. The connector handles Salesforce query-more pagination for result sets exceeding 2000 records.