arazzo: 1.0.1 info: title: Salesforce Sales Cloud Account Tree With Contacts summary: Create an Account and its child Contacts in one tree call, then read the Account back. description: >- A nested-create pattern that uses the Composite API SObject Tree resource to create a root Account together with its child Contact records in a single request, then reads the root Account back through the REST SObject Rows resource to confirm it persisted. Every step inlines its request and the OAuth bearer Authorization header. version: 1.0.0 sourceDescriptions: - name: compositeApi url: ../openapi/salesforce-sales-cloud-composite-api-openapi.yml type: openapi - name: restApi url: ../openapi/salesforce-sales-cloud-rest-api-openapi.yml type: openapi workflows: - workflowId: account-tree-with-contacts summary: Create a parent Account plus child Contacts in one tree, then verify. description: >- Posts an sObject tree with an Account root and nested Contact children, then reads the created root Account back by id. inputs: type: object required: - accessToken - treeRecords properties: accessToken: type: string description: OAuth 2.0 access token used as the Bearer credential. treeRecords: type: array description: >- Array of sObject tree records. Each root record carries an attributes object with type "Account" and a referenceId, plus optional nested child Contact records under a relationship. items: type: object steps: - stepId: createTree description: Create the Account root and nested Contact children in one call. operationId: createSObjectTree parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: sObjectName in: path value: Account requestBody: contentType: application/json payload: records: $inputs.treeRecords successCriteria: - condition: $statusCode == 201 outputs: hasErrors: $response.body#/hasErrors rootAccountId: $response.body#/results/0/id - stepId: verifyAccount description: Read the created root Account back by id. operationId: getSObjectRecord parameters: - name: Authorization in: header value: Bearer $inputs.accessToken - name: sObjectName in: path value: Account - name: recordId in: path value: $steps.createTree.outputs.rootAccountId - name: fields in: query value: Id,Name successCriteria: - condition: $statusCode == 200 outputs: accountName: $response.body#/Name outputs: rootAccountId: $steps.createTree.outputs.rootAccountId accountName: $steps.verifyAccount.outputs.accountName hasErrors: $steps.createTree.outputs.hasErrors