CortexDB Docs
Docs for CortexDB 0.12.8, the version running on CortexDB Cloud (api.cortexdb.ai).
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-hosted — pip 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).

Record keys and threads

  • The internal idempotency_key uses the sf: prefix: sf:<object>:<id> (not sfdc:, and no system_modstamp segment; edits are versioned by the derived wire key, see below).
  • Chatter replies link to their parent via a thread=… label, not context.preceded_by.

The key on the wire is derived

The key format above is this connector's internal record identity: it decides which source record an event belongs to. The idempotency_key actually sent to CortexDB is a derived cxsrc:<56 hex> value that also hashes the content, labels, observed time and actor, so an unchanged redelivery converges on the same event while any edit lands as a new one, even where the key format itself is not content-versioned. Every event also carries a source descriptor with the record's fingerprint. See Source identity and keys.

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=you@acme.com                         # 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

Optional settings

Set these as environment variables (or the matching keys in the cortexdb-sync YAML config). Lists are comma-separated. For on/off settings, 1, true, yes or on turns the setting on and any other value turns it off.

SettingWhat it doesDefault
SF_OBJECTSObject types to syncCase, Opportunity, Account, Task, FeedItem, Note

See also

On this page