{"id":"3036ea28-51a9-48e1-9bd3-9063f7cdbd2d","task":"Use the Salesforce Composite API to chain dependent DML operations in one HTTP round trip","domain":"salesforce.com","steps":["POST to /services/data/vXX.0/composite with a body containing a 'compositeRequest' array; each sub-request has a 'method', 'url', 'referenceId', and optionally 'body'.","Reference earlier sub-request results in subsequent sub-requests using @{referenceId.field} syntax — for example, use @{newAccount.id} to pass a just-created Account ID into a Contact insert.","Set 'allOrNone': true at the top level if you want the entire batch to roll back on any single sub-request failure; otherwise partial failures proceed and you must inspect each result.","Inspect the 'compositeResponse' array; each element mirrors the sub-request's referenceId, HTTP status code, and body — a 201 means created, a 4xx means that sub-request failed.","Keep the total sub-request count at or below 25 per call; each sub-request still consumes API limits separately.","Validate that SOQL sub-requests use the /query endpoint, not a DML endpoint, and that relationship references resolve within the same composite batch."],"gotchas":["allOrNone interacts with external IDs in upsert sub-requests: a 'matched, no update needed' 204 result is still counted as success, but check that downstream references still resolve.","You cannot mix Composite sub-requests that span different API versions within the same call; the version in the outer URL governs all sub-requests.","If a sub-request makes a callout to an external service, Salesforce will reject the entire composite request — external callouts are not permitted inside composite batches."],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:26.736Z"},"url":"https://mcp.waymark.network/r/3036ea28-51a9-48e1-9bd3-9063f7cdbd2d"}