Salesforce Experience Cloud · Arazzo Workflow

Salesforce Experience Cloud SOQL Query and Update

Version 1.0.0

Run a SOQL query to find a record, then update the first match.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CMSCommunitiesCRMCustomer PortalDigital ExperienceExperience CloudPartner PortalArazzoWorkflows

Provider

salesforce-experience-cloud

Workflows

soql-query-update
Locate a record with SOQL and update the first match.
Executes a SOQL query, and if at least one record is returned, updates the first record with the supplied fields; otherwise ends without changes.
2 steps inputs: accessToken, sObjectName, soql, updateFields outputs: matchedRecordId, totalSize
1
runQuery
Execute the SOQL query and capture the first record's Id and the total match count.
2
updateMatched
Patch the first matched record with the supplied field values. Returns no body on success.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Salesforce Experience Cloud SOQL Query and Update
  summary: Run a SOQL query to find a record, then update the first match.
  description: >-
    A common targeted-update pattern. The workflow executes a SOQL query to
    locate a record by arbitrary criteria, branches on whether any rows were
    returned, and patches the first matched record with new field values. When
    no rows match, the flow ends without making changes. Each step spells out
    its request inline so the flow can be read and executed without opening the
    underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: queryApi
  url: ../openapi/salesforce-experience-cloud-query-api-openapi.yml
  type: openapi
- name: sobjectsApi
  url: ../openapi/salesforce-experience-cloud-sobjects-api-openapi.yml
  type: openapi
workflows:
- workflowId: soql-query-update
  summary: Locate a record with SOQL and update the first match.
  description: >-
    Executes a SOQL query, and if at least one record is returned, updates the
    first record with the supplied fields; otherwise ends without changes.
  inputs:
    type: object
    required:
    - accessToken
    - soql
    - sObjectName
    - updateFields
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 bearer token for the Salesforce instance.
      soql:
        type: string
        description: SOQL query string (must SELECT Id) used to locate the target record.
      sObjectName:
        type: string
        description: API name of the object whose record will be updated.
      updateFields:
        type: object
        description: Field name/value pairs to apply to the matched record.
  steps:
  - stepId: runQuery
    description: Execute the SOQL query and capture the first record's Id and the total match count.
    operationId: executeQuery
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: q
      in: query
      value: $inputs.soql
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedRecordId: $response.body#/records/0/Id
      totalSize: $response.body#/totalSize
    onSuccess:
    - name: hasMatch
      type: goto
      stepId: updateMatched
      criteria:
      - context: $response.body
        condition: $.totalSize > 0
        type: jsonpath
    - name: noMatch
      type: end
      criteria:
      - context: $response.body
        condition: $.totalSize == 0
        type: jsonpath
  - stepId: updateMatched
    description: Patch the first matched record with the supplied field values. Returns no body on success.
    operationId: updateSObjectRecord
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: sObjectName
      in: path
      value: $inputs.sObjectName
    - name: recordId
      in: path
      value: $steps.runQuery.outputs.matchedRecordId
    requestBody:
      contentType: application/json
      payload: $inputs.updateFields
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      updatedRecordId: $steps.runQuery.outputs.matchedRecordId
  outputs:
    matchedRecordId: $steps.runQuery.outputs.matchedRecordId
    totalSize: $steps.runQuery.outputs.totalSize

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/salesforce-experience-cloud-soql-query-update-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.