Salesforce · Arazzo Workflow

Salesforce SOQL Query

Version 1.0.0

Run a SOQL query then page additional results via the queryMore token.

1 workflow 1 source API 1 provider
View Spec View on GitHub Fortune 500Artificial IntelligenceAnalyticsCloudCommerceCRMCustomer ServiceEnterpriseMarketingPlatformSalesArazzoWorkflows

Provider

salesforce

Workflows

soql-query
Run a SOQL query and page the next batch of results when more remain.
Executes a SOQL statement, captures totalSize, done, nextRecordsUrl and the first page of records, then retrieves the next page by query id when the result set is not yet complete.
2 steps inputs: queryId, soql outputs: firstPageRecords, nextPageRecords, totalSize
1
runQuery
executeQuery
Execute the SOQL query. Returns totalSize, a done flag, the first page of records, and a nextRecordsUrl when more pages remain.
2
queryMore
getNextQueryPage
Fetch the next page of query results using the query id taken from the previous response's nextRecordsUrl. Repeat until the done flag is true.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Salesforce SOQL Query
  summary: Run a SOQL query then page additional results via the queryMore token.
  description: >-
    Executes a SOQL query against Salesforce data and handles pagination. The
    first step runs the query and inspects the done flag: when the result set
    spans multiple pages, Salesforce returns a nextRecordsUrl whose trailing
    token identifies the next batch, and the workflow fetches that next page by
    query id. When the first response is already complete the paging step is
    skipped. Every 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/_superseded/salesforce-query-api-openapi.yml
  type: openapi
workflows:
- workflowId: soql-query
  summary: Run a SOQL query and page the next batch of results when more remain.
  description: >-
    Executes a SOQL statement, captures totalSize, done, nextRecordsUrl and the
    first page of records, then retrieves the next page by query id when the
    result set is not yet complete.
  inputs:
    type: object
    required:
    - soql
    properties:
      soql:
        type: string
        description: >-
          The SOQL query string to execute (e.g. SELECT Id, Name FROM Account
          ORDER BY CreatedDate DESC LIMIT 500).
      queryId:
        type: string
        description: >-
          The query id token taken from the trailing segment of a previous
          response's nextRecordsUrl, used to fetch the next page of results.
  steps:
  - stepId: runQuery
    description: >-
      Execute the SOQL query. Returns totalSize, a done flag, the first page of
      records, and a nextRecordsUrl when more pages remain.
    operationId: executeQuery
    requestBody:
      contentType: application/json
      payload:
        q: $inputs.soql
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      totalSize: $response.body#/totalSize
      done: $response.body#/done
      nextRecordsUrl: $response.body#/nextRecordsUrl
      records: $response.body#/records
    onSuccess:
    - name: morePages
      type: goto
      stepId: queryMore
      criteria:
      - context: $response.body
        condition: $.done == false
        type: jsonpath
    - name: complete
      type: end
      criteria:
      - context: $response.body
        condition: $.done == true
        type: jsonpath
  - stepId: queryMore
    description: >-
      Fetch the next page of query results using the query id taken from the
      previous response's nextRecordsUrl. Repeat until the done flag is true.
    operationId: getNextQueryPage
    parameters:
    - name: queryId
      in: path
      value: $inputs.queryId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      done: $response.body#/done
      nextRecordsUrl: $response.body#/nextRecordsUrl
      records: $response.body#/records
  outputs:
    totalSize: $steps.runQuery.outputs.totalSize
    firstPageRecords: $steps.runQuery.outputs.records
    nextPageRecords: $steps.queryMore.outputs.records

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-soql-query-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.