Salesforce bindings over the REST API: sObject CRUD and external-id upserts, SOQL (with auto-paging), SOSL search, describe, sObject collections and composite requests, Bulk API 2.0 ingest and query jobs, and org limits.

Setup: set ONE auth flow in context, or pass credentials per call in a trailing opts Map on any API-calling function. See ::salesforce::auth for the full matrix; in short:

FlowContext variables
Access tokensalesforce.access.token + salesforce.instance.url
Refresh tokensalesforce.client-id + salesforce.refresh-token (+ salesforce.client-secret for confidential apps)
JWT bearersalesforce.client-id + salesforce.username + salesforce.private.key
Client credentialssalesforce.client-id + salesforce.client-secret + salesforce.my-domain.url

salesforce.sandbox ("true") switches the login host and JWT audience to test.salesforce.com. Sessions are cached for the rest of the run and re-minted once on 401 INVALID_SESSION_ID.

Quick start

::sobjects ::salesforce::sobjects
::query ::salesforce::query

lead ::sobjects/create-record("Lead", {
  LastName: "Lovelace",
  Company: "Analytical Engines",
  Email: "ada@example.com"
})

hot-leads ::query/soql-records(`SELECT Id, Name, Email FROM Lead WHERE Company = ${::query/literal("Analytical Engines")}`)
map(hot-leads, (r) { r.Name })

Values

DEFAULT_API_VERSION

DEFAULT_API_VERSION: Str "v68.0"

The REST API version used when salesforce.api.version is unset: v68.0 (Winter '27). Override per org with the context variable.

LOGIN_URL

LOGIN_URL: Str "https://login.salesforce.com"

TEST_URL

TEST_URL: Str "https://test.salesforce.com"