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).
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 inloginUrl(for exampledemohealth.my.salesforce.com);login.salesforce.comandtest.salesforce.comrefuse 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.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
loginUrl | url | No | Vendor URL | No | Where 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). |
apiVersion | string | No | v61.0 | No | REST API version used in every request URL, e.g. v61.0. |
authType | enum: oauth2-client-credentials, jwt-bearer | No | oauth2-client-credentials | No | oauth2-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. |
credentials | object | No | |||
credentials.clientId | string | No | No | Connected app consumer key. Used when authType is oauth2-client-credentials or jwt-bearer. | |
credentials.clientSecret | string | No | Yes | Connected app consumer secret (encrypted at rest). Used when authType is oauth2-client-credentials. | |
credentials.username | string | No | No | Salesforce username the JWT bearer token is issued for. Used when authType is jwt-bearer. | |
credentials.privateKeyPEM | string | No | Yes | RSA private key in PEM format that signs the JWT bearer assertion (encrypted at rest). Used when authType is jwt-bearer. | |
jwtAudience | enum: production, sandbox | No | No | The 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. | |
sessionCacheMinutes | number | No | 30 | No | How 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. |
timeout | number | No | 30000 | No | Timeout for each HTTP request in milliseconds. |
tlsCaPem | string | No | Yes | PEM CA certificate(s) to verify the server against. See tlsCaMode. | |
tlsCaMode | enum: replace, add | No | No | Trust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem. | |
tlsClientCertPem | string | No | Yes | PEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem. | |
tlsClientKeyPem | string | No | Yes | PEM private key for the client certificate (encrypted at rest). | |
tlsClientPfx | string | No | Yes | Client certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair. | |
tlsClientPassphrase | string | No | Yes | Passphrase of the PKCS#12 bundle. | |
tlsMinVersion | enum: TLSv1.2, TLSv1.3 | No | No | Lowest TLS version to accept (default TLSv1.2). | |
proxyUrl | url | No | No | HTTP(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). | |
proxyUsername | string | No | No | Proxy user (Basic auth). | |
proxyPassword | string | No | Yes | Proxy password. | |
noProxy | array of string | No | No | Hosts 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.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
query | Run one SOQL SELECT with :name values bound from params; follows nextRecordsUrl up to maxRecords and maxPages. | soql, params?, paramTypes?, maxRecords?, maxPages? | params |
poll | Polling trigger read: a SOQL query using :cursor and :limit, one message per record. | soql, cursor?, cursorInitial?, cursorType?, limit?, params?, paramTypes? | None |
read | Read one record by sObject and id, optionally only some fields. | sobject, id, fields? | id |
create | Create one record from the step's record or the message. | sobject, record? | record |
update | Update the fields of one record by id. | sobject, id, record? | id, record |
upsert | Upsert 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 |
delete | Delete one record by sObject and id. | sobject, id | id |
limits | The org's daily API request allocation: max and remaining. | None | None |
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.
{
"name": "Salesforce (example)",
"adapterType": "salesforce",
"config": {
"credentials": {
"clientId": "example-consumer-key",
"clientSecret": "synthetic-secret"
}
}
}Limits
- SOQL values are bound, never pasted. Write
:namein the SOQL and give the value inparams. 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; adatetime,date,id,numberorboolean(set inparamTypes) must match its exact shape. A list becomes(a, b)forIN :names.{{...}}templates in the SOQL are refused, and only oneSELECTstatement 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
nextRecordsUrlup tomaxRecordsrecords (default 2,000, at most 50,000) andmaxPagespages (default 25), and reportstruncatedwhen it stopped early. - Results.
create,update,upsertanddeletereturnid,success,createdanderrors. 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) and503/SERVER_UNAVAILABLEorUNABLE_TO_LOCK_ROWare retried with the step's retry settings, waiting at least five minutes after a limit and honoringRetry-After. Validation errors, missing records and permission errors fail without a retry. A500or 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
limitsaction reports the daily maximum and what remains. - Polling. The
pollaction binds:cursorand:limit. UseSystemModstampas 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:
{
"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:
{
"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.