Skip to content
Reference

Adapter: Salesforce

Query Salesforce and Health Cloud records with bound SOQL, read by id, create, update, upsert on an external ID and delete, or poll a SOQL query with a cursor (OAuth 2.0 client credentials or JWT bearer).

On this page

Purpose

Read and write Salesforce records, Health Cloud objects included, from a workflow step, and start a workflow from new or changed records with a polling trigger. A typical flow takes an HL7v2 or FHIR message, maps it to Salesforce fields and upserts it on an external ID such as the patient's MRN, so a resent message updates the same record. See Salesforce for the overview and what is still coming.

Auth

Create a connected app in Salesforce for the engine and give its integration user only the objects and fields the workflows need.

  • oauth2-client-credentials (default): the connected app's consumer key and secret. Salesforce runs every call as the app's "Run As" user. This flow needs your My Domain login host in loginUrl (for example demohealth.my.salesforce.com); login.salesforce.com and test.salesforce.com refuse it, and the profile shows a warning.
  • jwt-bearer: the consumer key, the integration user's username and an RSA private key. The engine signs an RS256 assertion (issuer the consumer key, subject the username, audience production or sandbox); upload the matching certificate to the connected app and pre-authorize the user.

The consumer secret and the private key are encrypted at rest and never returned by a read. The token response names the org's instance URL; the engine accepts it only as an https:// address that passes the SSRF rules, and every API call stays on it under /services/data/. Salesforce sends no session lifetime, so the session is reused for sessionCacheMinutes (default 30) and renewed at once when Salesforce answers 401 (INVALID_SESSION_ID): the call is sent once more with a new session, never a third time. The connection test signs in and reads /limits.

Settings

Auth is chosen with authType: oauth2-client-credentials, jwt-bearer (default oauth2-client-credentials). Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.

SettingTypeRequiredDefaultSecretDescription
loginUrlurlNoVendor URLNoWhere the engine signs in: login.salesforce.com for production, test.salesforce.com for a sandbox, or your My Domain login host (client credentials needs the My Domain host).
apiVersionstringNov61.0NoREST API version used in every request URL, e.g. v61.0.
authTypeenum: oauth2-client-credentials, jwt-bearerNooauth2-client-credentialsNooauth2-client-credentials: a connected app's consumer key and secret, run as the app's integration user. jwt-bearer: the consumer key, the integration user's username and a private key whose certificate is on the connected app.
credentialsobjectNo
credentials.clientIdstringNoNoConnected app consumer key. Used when authType is oauth2-client-credentials or jwt-bearer.
credentials.clientSecretstringNoYesConnected app consumer secret (encrypted at rest). Used when authType is oauth2-client-credentials.
credentials.usernamestringNoNoSalesforce username the JWT bearer token is issued for. Used when authType is jwt-bearer.
credentials.privateKeyPEMstringNoYesRSA private key in PEM format that signs the JWT bearer assertion (encrypted at rest). Used when authType is jwt-bearer.
jwtAudienceenum: production, sandboxNoNoThe JWT bearer assertion's audience: production (login.salesforce.com) or sandbox (test.salesforce.com). Defaults to sandbox when loginUrl is test.salesforce.com or a sandbox My Domain, otherwise production.
sessionCacheMinutesnumberNo30NoHow long a Salesforce session token is reused before the engine signs in again. Keep it below the org's session timeout; a 401 signs in again at once.
timeoutnumberNo30000NoTimeout for each HTTP request in milliseconds.
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).
proxyUrlurlNoNoHTTP(S) proxy, e.g. http://proxy.example.test:3128 (opens in a new tab). The proxy host must pass the SSRF rules (SSRF_ALLOWLIST for a private one).
proxyUsernamestringNoNoProxy user (Basic auth).
proxyPasswordstringNoYesProxy password.
noProxyarray of stringNoNoHosts sent direct, not through the proxy: a name (and its subdomains), .suffix, host:port or *.

Actions

A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.

ActionWhat it doesStep parametersKeys a message may supply
queryRun one SOQL SELECT with :name values bound from params; follows nextRecordsUrl up to maxRecords and maxPages.soql, params?, paramTypes?, maxRecords?, maxPages?params
pollPolling trigger read: a SOQL query using :cursor and :limit, one message per record.soql, cursor?, cursorInitial?, cursorType?, limit?, params?, paramTypes?None
readRead one record by sObject and id, optionally only some fields.sobject, id, fields?id
createCreate one record from the step's record or the message.sobject, record?record
updateUpdate the fields of one record by id.sobject, id, record?id, record
upsertUpsert on an external ID field: updates the record holding the value or creates one, so a resent message updates the same record.sobject, externalIdField, externalId, record?externalId, record
deleteDelete one record by sObject and id.sobject, idid
limitsThe org's daily API request allocation: max and remaining.NoneNone

Minimal example

The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.

json
{
  "name": "Salesforce (example)",
  "adapterType": "salesforce",
  "config": {
    "credentials": {
      "clientId": "example-consumer-key",
      "clientSecret": "synthetic-secret"
    }
  }
}

Limits

  • SOQL values are bound, never pasted. Write :name in the SOQL and give the value in params. The adapter writes each value as one SOQL literal: a string is quoted with its quotes, backslashes and line breaks escaped, and other control characters are refused; a datetime, date, id, number or boolean (set in paramTypes) must match its exact shape. A list becomes (a, b) for IN :names. {{...}} templates in the SOQL are refused, and only one SELECT statement is accepted. The SOQL, the sObject and the external ID field come from the step; a message can supply only the keys in the actions table.
  • Queries are bounded. A query follows nextRecordsUrl up to maxRecords records (default 2,000, at most 50,000) and maxPages pages (default 25), and reports truncated when it stopped early.
  • Results. create, update, upsert and delete return id, success, created and errors. A failed call fails the step with Salesforce's error code and the field names it reports, never its message text, which can quote a record value.
  • Retries. The API request limit (REQUEST_LIMIT_EXCEEDED, including the org's daily allocation, which the error names) and 503/SERVER_UNAVAILABLE or UNABLE_TO_LOCK_ROW are retried with the step's retry settings, waiting at least five minutes after a limit and honoring Retry-After. Validation errors, missing records and permission errors fail without a retry. A 500 or a timeout after a create was sent is marked uncertain and not retried, because Salesforce may have saved the record; the same failure on an update, upsert or delete is retried. An upsert whose external ID matches more than one record fails without a retry.
  • Call limits. The profile's calls-per-second and concurrent-call limits apply as for any adapter. Set them below your org's API allocation; the limits action reports the daily maximum and what remains.
  • Polling. The poll action binds :cursor and :limit. Use SystemModstamp as the cursor field: Salesforce returns it as ISO text in UTC (2026-05-01T12:34:56.000+0000), so it sorts as text, and the adapter binds it back as a SOQL datetime. See the example below.
  • Bulk API jobs, composite requests, Change Data Capture and Platform Events, and outbound messages are not supported. See What's coming.

A polling trigger that runs the workflow once per new or changed referral:

json
{
  "type": "polling",
  "interval": 60000,
  "adapterProfileId": "<profile id>",
  "action": "poll",
  "params": {
    "soql": "SELECT Id, Status, SystemModstamp FROM Referral__c WHERE SystemModstamp >= :cursor ORDER BY SystemModstamp, Id LIMIT :limit",
    "cursor": "{{cursor}}",
    "cursorInitial": "2026-01-01T00:00:00Z",
    "limit": 200
  },
  "itemsPath": "records",
  "cursorField": "SystemModstamp",
  "idField": "Id"
}

Use >= with idField: records that share the last cursor value are read again and the id skips the ones that already ran. Keep limit (at most 5,000) above the number of records one change can stamp with the same second. {{cursor}} goes in the cursor parameter only; written into the SOQL it is refused.

An upsert step that keeps one Account per MRN:

json
{
  "action": "upsert",
  "sobject": "Account",
  "externalIdField": "MRN__c"
}

The message supplies externalId (the MRN) and record (the fields), or the whole message is the record when it has no record key. attributes, Id, externalId and the external ID field are left out of the body.

Reference