Salesforce SDK v1
Explicitly permitted Salesforce record actions in bounded Python handlers.
Availability and execution model
Staging preview: plans and offline mocks only. No real Salesforce records are read or changed. The SDK contract and REST mapping are implemented; a separately authorized live egress executor is not enabled. Configuring permissions does not activate live execution.
A handler receives a verified BeaconRelay packet and calls sdk.action("salesforce", operation, input). This appends an action to a plan. It does not call Salesforce synchronously. Mock results are synthetic, not customer data.
Use processing policy Validated actions v2 and catalog Salesforce v1 + Yousign v1 (brokers-v1). Existing yousign-v1 and legacy handlers retain their original policies. Publish a new version to opt in; published source, catalog identity and fingerprint are immutable.
Configure permissions
- Select the organization on the Brokers page.
- Open Salesforce permissions. Authorization is inherited from this organization's existing Salesforce connection; do not supply another Consumer Key, secret, or token.
- Approve only the required operations and enter object/field permissions using Salesforce API names, not translated display labels.
- Enable handler tools and mocks, then save. No operations or fields are granted by default.
- In Handler IDE, select validated actions and the new SDK catalog, test with a packet, and publish a new immutable version.
- In Rehearsals, explicitly select a completed validated plan and confirm mock-only execution. Old plans are never automatically replayed.
{
"Account": {
"read": ["Name", "Integration_Key__c"],
"write": ["Name"],
"external_ids": ["Integration_Key__c"]
}
}
Each object requires all three arrays; empty arrays grant nothing. No wildcards, relationship paths or arbitrary object names outside this policy are permitted. Up to 20 objects and 50 fields per permission list are supported, within 16 KiB of saved permission settings. Read and write permissions are separate; an external-ID field requires its own approval.
The policy does not grant Salesforce privileges. When live execution becomes available, the authorized Salesforce user's object permissions, field-level security and record access will still apply. Changing an email/display name is not a new authorization; disabling the user or revoking access can invalidate the connection.
Permission edits use revision checks. Reload a stale settings form rather than overwriting another edit. A mock rehearsal freezes its approved permissions at admission; later edits affect new rehearsals, not already admitted ones. Live permission revalidation is a prerequisite for a future live release.
Operation reference
Inputs are JSON-compatible dictionaries with exactly the declared keys. Unknown keys are rejected. Standard and custom object/field API names are supported when explicitly allowed; identifiers must start with a letter and contain only letters, digits or underscores, up to 80 characters.
record.create — Create a record
Create a record using explicitly approved objects and fields.
fields- object (required)
object- string (required)
sdk.action("salesforce", "record.create", {'fields': {'Name': 'Example customer'},
'object': 'Account'})
Exact input schema
{
"additionalProperties": false,
"properties": {
"fields": {
"additionalProperties": {
"maxLength": 10000,
"type": [
"string",
"number",
"boolean",
"null"
]
},
"maxProperties": 50,
"minProperties": 1,
"propertyNames": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"type": "object"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"object",
"fields"
],
"type": "object"
}Exact normalized result schema
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z0-9]{15}([A-Za-z0-9]{3})?(?![\\s\\S])",
"type": "string"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"id",
"object"
],
"type": "object"
}record.get — Retrieve a record
Retrieve a record using explicitly approved objects and fields.
fields- array (required)
object- string (required)
record_id- string (required)
sdk.action("salesforce", "record.get", {'fields': ['Name'],
'object': 'Account',
'record_id': '001000000000001'})
Exact input schema
{
"additionalProperties": false,
"properties": {
"fields": {
"items": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"maxItems": 50,
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"record_id": {
"pattern": "^[A-Za-z0-9]{15}([A-Za-z0-9]{3})?(?![\\s\\S])",
"type": "string"
}
},
"required": [
"object",
"record_id",
"fields"
],
"type": "object"
}Exact normalized result schema
{
"additionalProperties": false,
"properties": {
"fields": {
"additionalProperties": {
"maxLength": 10000,
"type": [
"string",
"number",
"boolean",
"null"
]
},
"maxProperties": 50,
"minProperties": 0,
"propertyNames": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"type": "object"
},
"id": {
"pattern": "^[A-Za-z0-9]{15}([A-Za-z0-9]{3})?(?![\\s\\S])",
"type": "string"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"id",
"object",
"fields"
],
"type": "object"
}record.update — Update a record
Update a record using explicitly approved objects and fields.
fields- object (required)
object- string (required)
record_id- string (required)
sdk.action("salesforce", "record.update", {'fields': {'Name': 'Example customer'},
'object': 'Account',
'record_id': '001000000000001'})
Exact input schema
{
"additionalProperties": false,
"properties": {
"fields": {
"additionalProperties": {
"maxLength": 10000,
"type": [
"string",
"number",
"boolean",
"null"
]
},
"maxProperties": 50,
"minProperties": 1,
"propertyNames": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"type": "object"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"record_id": {
"pattern": "^[A-Za-z0-9]{15}([A-Za-z0-9]{3})?(?![\\s\\S])",
"type": "string"
}
},
"required": [
"object",
"record_id",
"fields"
],
"type": "object"
}Exact normalized result schema
{
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[A-Za-z0-9]{15}([A-Za-z0-9]{3})?(?![\\s\\S])",
"type": "string"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"id",
"object"
],
"type": "object"
}record.upsert — Upsert by external ID
Upsert by external ID using explicitly approved objects and fields.
external_id- string (required)
external_id_field- string (required)
fields- object (required)
object- string (required)
sdk.action("salesforce", "record.upsert", {'external_id': 'customer-42',
'external_id_field': 'Integration_Key__c',
'fields': {'Name': 'Example customer'},
'object': 'Account'})
Exact input schema
{
"additionalProperties": false,
"properties": {
"external_id": {
"maxLength": 255,
"minLength": 1,
"pattern": "^[^\\u0000-\\u001f\\u007f]+(?![\\s\\S])",
"type": "string"
},
"external_id_field": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"fields": {
"additionalProperties": {
"maxLength": 10000,
"type": [
"string",
"number",
"boolean",
"null"
]
},
"maxProperties": 50,
"minProperties": 1,
"propertyNames": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
},
"type": "object"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"object",
"external_id_field",
"external_id",
"fields"
],
"type": "object"
}Exact normalized result schema
{
"additionalProperties": false,
"properties": {
"created": {
"type": "boolean"
},
"object": {
"pattern": "^[A-Za-z][A-Za-z0-9_]{0,79}(?![\\s\\S])",
"type": "string"
}
},
"required": [
"object",
"created"
],
"type": "object"
}record.get requires a nonempty explicit field list (up to 50). Its result contains id, object, and fields; unrequested attributes are discarded. The first SDK supports scalar field values only.
record.create and record.update return id and object. A write requires 1–50 fields. Values may be strings (up to 10,000 characters), finite numbers, booleans, or null. Null is explicit; omitting a field does not request clearing it. Salesforce remains responsible for business validation and required fields.
record.upsert returns object and created, not a guaranteed record ID. Supply the external-ID field separately; do not repeat it in fields. Its value must be a nonempty string of at most 255 characters without control characters. Configure a genuine external-ID field in Salesforce; a unique external ID is recommended. Upsert is not an exactly-once guarantee: Salesforce automations may run again on a repeated update.
Record IDs accept the 15- or 18-character alphanumeric format. This checks syntax, not record existence or ID checksum. Reference fields must use appropriate Salesforce IDs; dates, datetimes, picklists and other values must use formats accepted by Salesforce. Nested field objects, binary payloads and relationship traversals are unsupported.
Result references and branching
def handle(event, sdk):
account = sdk.action("salesforce", "record.create", {
"object": "Account", "fields": {"Name": "Example customer"}
})
sdk.action("salesforce", "record.update", {
"object": "Account", "record_id": account["id"],
"fields": {"Name": "Updated customer"}
})
Here account["id"] is a symbolic reference resolved by execution after the earlier action succeeds, not an immediate ID. Only a prior Salesforce action's declared id may supply a later Salesforce record_id. Upsert has no id result. Forward, cross-plan, cross-provider and undeclared-field references are rejected.
Remote results cannot drive Python conditions, loops, string interpolation or calculations. They cannot be embedded in arbitrary fields values. You may branch on the incoming packet's concrete data. There is no synchronous get-then-branch behavior in SDK v1.
Limits and isolation
- At most 10 actions per packet, 64 KiB per input/result, and 256 KiB per action plan.
- Handler source up to 64 KiB; Python subset supports bounded conditionals, loops, dictionaries/lists,
lenandrange. Loops are capped at 1,000 items and planning at 5 seconds with additional step/memory limits. - No imports, direct HTTP, arbitrary URLs, filesystem, environment access, eval/exec, token access, or unrestricted Python packages.
- Workspace and station ownership isolate authorization and data. Disconnecting the organization does not create a fallback authorization. Broker settings store permissions only, not another Salesforce credential copy.
- Mock rehearsals require ownership, plan entitlement, CSRF protection and explicit confirmation; at most 100 per deployment per rolling 24 hours. Transport event quotas are separate.
Failures, retries and audit
The ledger records action states and attempts. Possible states include pending, leased, sending, retry_wait, succeeded, failed, needs_review and blocked. A failed or uncertain action stops downstream actions. Successful earlier actions are not rolled back: a plan is not a Salesforce transaction.
A known not-sent request or rate limit may retry up to three total attempts, with current mock delays of 30 seconds then 2 minutes. Read failures may retry safely. A write whose outcome is uncertain (timeout, lost response or worker failure while sending) becomes needs_review rather than risking duplicate creation or repeated automation. Even updates and upserts are treated conservatively.
Duplicate packet and action identities prevent automatic local replay; they do not promise exactly-once remote side effects. After a future live uncertain write, reconcile Salesforce state before explicitly deciding what to run next. Do not blindly resubmit an entire workflow.
| Code | Meaning |
|---|---|
unsupported_capability | Unknown broker or operation. |
invalid_capability_input | Input differs from the operation schema. |
invalid_result_dependency | Result reference is not an earlier compatible action. |
invalid_salesforce_policy | Object/field permissions are malformed. |
salesforce_permission_denied | Broker policy or provider denies access. |
salesforce_authorization_required | Provider rejects the session; no blind business-action retry. |
salesforce_rate_limited | HTTP 429 or Salesforce request-limit error. |
salesforce_remote_unavailable | Timeout response or server failure; a write may have happened. |
salesforce_record_not_found | Record/resource unavailable. |
salesforce_record_locked | Provider explicitly reports a locked row; review before resubmitting. |
salesforce_request_rejected | Provider rejects the request or business validation. |
salesforce_redirect_denied | Unexpected redirect is not followed. |
salesforce_invalid_response | Response differs from the expected status/result schema. |
These adapter codes describe provider-response mapping; current mock execution makes no provider requests. Rehearsals display safe ledger diagnostics such as action_preflight_failed, broker_rejected, broker_uncertain, or broker_invalid_response. Raw provider error bodies, tokens and decrypted record values are not shown in action metadata.
API compatibility and unsupported features
SDK salesforce-v1 currently maps through adapter salesforce-rest-v68 to explicitly pinned REST API 68.0. It does not use an automatically changing latest alias, and does not change the Streaming API version used by event transport. Organization-version compatibility must be verified before enabling a future live executor; no version-discovery or token-refresh call was performed to install this SDK.
The stable SDK owns operation names, schemas, errors and semantics. The adapter owns provider paths and response mapping. Compatible provider changes require adapter contract tests; incompatible behavior needs a new catalog/version and an explicit handler migration. Existing publications are never silently rewritten.
Not supported in v1: delete/undelete, arbitrary SOQL/SOSL, schema mutation, Apex calls, Composite/Bulk APIs, file/document handling, package imports, synchronous remote-result branching, live execution and external webhook handler authoring. Do not rely on these until separately documented and released.
References: API versions, REST resources, Working with records. For assistance: support@beaconrelay.dev.