Salesforce Sales Cloud · Arazzo Workflow

Salesforce Sales Cloud Account Tree With Contacts

Version 1.0.0

Create an Account and its child Contacts in one tree call, then read the Account back.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CloudCRMCustomer ManagementEnterpriseSalesArazzoWorkflows

Provider

salesforce-sales-cloud

Workflows

account-tree-with-contacts
Create a parent Account plus child Contacts in one tree, then verify.
Posts an sObject tree with an Account root and nested Contact children, then reads the created root Account back by id.
2 steps inputs: accessToken, treeRecords outputs: accountName, hasErrors, rootAccountId
1
createTree
createSObjectTree
Create the Account root and nested Contact children in one call.
2
verifyAccount
getSObjectRecord
Read the created root Account back by id.

Source API Descriptions

Arazzo Workflow Specification

salesforce-sales-cloud-account-tree-with-contacts-workflow.yml Raw ↑
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