{"id":"b537cb59-c0fa-42f0-a5e5-7556d006c0d3","task":"Insert a parent record with multiple related child records in one request using the Salesforce sObject Tree API","domain":"salesforce.com","steps":["POST to /services/data/vXX.0/composite/tree/{SObjectType} where SObjectType is the parent object (e.g., Account).","Construct the request body with a 'records' array; each record may contain an 'attributes' object with 'type' and a client-assigned 'referenceId', plus a nested 'ChildRelationshipName' object containing its own 'records' array.","Include referenceIds on all records — they are returned in the response and are your only way to map response IDs back to your input rows.","Limit the total record count to 200 across all nodes in the tree; deeper nesting beyond 5 levels is not supported.","On success, the response contains a 'results' array mapping each referenceId to its new Salesforce ID.","On partial failure with 'allOrNone': false, inspect each result's 'errors' array and retry only the failed sub-trees."],"gotchas":["The sObject Tree API only supports insert (not upsert or update) — use the Composite or Bulk API for upsert scenarios involving trees.","Relationship names in the nested records key must be the child relationship name as it appears in the parent's child relationship list (e.g., 'Contacts', not 'Contact') — the wrong name causes a 400.","All records in the tree share one transaction; a governor limit hit on a deeply nested record rolls back the entire tree, not just that branch."],"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:44:26.626Z"},"url":"https://mcp.waymark.network/r/b537cb59-c0fa-42f0-a5e5-7556d006c0d3"}