Salesforce Sales Cloud · Arazzo Workflow

Salesforce Sales Cloud Search Then Retrieve Record

Version 1.0.0

Run a SOSL search across objects, then fetch the full record for the top hit.

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

Provider

salesforce-sales-cloud

Workflows

search-then-retrieve-record
SOSL search for records, then retrieve the top match in full.
Executes a SOSL search and, when a record is returned, fetches the full record for the first searchRecords entry using the supplied object type.
2 steps inputs: accessToken, fields, sObjectName, searchString outputs: record, topHitId
1
search
Run the SOSL search across objects.
2
retrieveRecord
Fetch the full record for the top search hit.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Salesforce Sales Cloud Search Then Retrieve Record
  summary: Run a SOSL search across objects, then fetch the full record for the top hit.
  description: >-
    A find-and-expand pattern over the Search and SObject Rows resources. The
    workflow runs a SOSL search to find matching records across objects,
    branches on whether anything matched, and when it did retrieves the complete
    record for the first hit by its id and object type. Every step inlines its
    request and the OAuth bearer Authorization header.
  version: 1.0.0
sourceDescriptions:
- name: searchApi
  url: ../openapi/salesforce-sales-cloud-search-api-openapi.yml
  type: openapi
- name: sobjectRowsApi
  url: ../openapi/salesforce-sales-cloud-sobject-rows-api-openapi.yml
  type: openapi
workflows:
- workflowId: search-then-retrieve-record
  summary: SOSL search for records, then retrieve the top match in full.
  description: >-
    Executes a SOSL search and, when a record is returned, fetches the full
    record for the first searchRecords entry using the supplied object type.
  inputs:
    type: object
    required:
    - accessToken
    - searchString
    - sObjectName
    properties:
      accessToken:
        type: string
        description: OAuth 2.0 access token used as the Bearer credential.
      searchString:
        type: string
        description: The SOSL search string (e.g. FIND {Acme} IN ALL FIELDS RETURNING Account(Id)).
      sObjectName:
        type: string
        description: The object type of the expected top hit (e.g. Account).
      fields:
        type: string
        description: Comma-separated list of fields to return on retrieval.
        default: Id,Name
  steps:
  - stepId: search
    description: Run the SOSL search across objects.
    operationId: executeSOSLSearch
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: q
      in: query
      value: $inputs.searchString
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      topHitId: $response.body#/searchRecords/0/Id
    onSuccess:
    - name: hitFound
      type: goto
      stepId: retrieveRecord
      criteria:
      - context: $response.body
        condition: $.searchRecords.length > 0
        type: jsonpath
    - name: noHit
      type: end
      criteria:
      - context: $response.body
        condition: $.searchRecords.length == 0
        type: jsonpath
  - stepId: retrieveRecord
    description: Fetch the full record for the top search hit.
    operationId: getSObjectRecord
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: sObjectName
      in: path
      value: $inputs.sObjectName
    - name: recordId
      in: path
      value: $steps.search.outputs.topHitId
    - name: fields
      in: query
      value: $inputs.fields
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      record: $response.body
  outputs:
    topHitId: $steps.search.outputs.topHitId
    record: $steps.retrieveRecord.outputs.record

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-sales-cloud-search-then-retrieve-record-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.