CortexDB Docs
Connectors

Salesforce Connector

Ingest Salesforce records and Chatter into CortexDB.

Tails Salesforce objects (accounts, opportunities, cases, …) and Chatter feed activity, and writes them to CortexDB as experiences.

Two ways to run this connector

Self-hostedpip install 'cortexdb-connectors[salesforce]' then cortexdb-sync sync salesforce. Managed — CortexDB runs the connector as a worker. See the Connectors overview.

1. Prepare credentials

Self-host and dashboard use different auth

The managed dashboard uses an OAuth refresh token. The self-hosted connector uses the username-password OAuth flow — a Connected App's consumer key/secret plus a Salesforce username and password (append the security token to the password if required). Both are listed below.

Create a Connected App with the API scope enabled, and note the consumer key and secret.

What gets written

Each record and Chatter post becomes a POST /v1/experience on the resolved scope (default org:<org>/source:salesforce), with an entity reference to the record and metadata (object type, id, a source_url).

Corrected fields

  • The idempotency_key uses the sf: prefix (sf:<object>:<id>:<system_modstamp> — not sfdc:).
  • Chatter replies link to their parent via a thread=… label, not context.preceded_by.

Run it yourself

pip install 'cortexdb-connectors[salesforce]'
pip install cortexdb-cli && cortexdb init

export SF_INSTANCE_URL=https://acme.my.salesforce.com   # required
export SF_CLIENT_ID=...                                 # required (Connected App consumer key)
export SF_CLIENT_SECRET=...                             # required (consumer secret)
export SF_USERNAME=[email protected]                         # required
export SF_PASSWORD=...                                  # required (+ security token if needed)

cortexdb-sync --api-url http://localhost:3141 sync salesforce
cortexdb-sync --api-url http://localhost:3141 watch salesforce --interval 300

See also

On this page