Paginate large SOQL query results using nextRecordsUrl

domain: developer.salesforce.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. Send GET to /services/data/vXX.0/query?q={URL-encoded SOQL} to start the query
  2. Inspect the response: if done is false, a nextRecordsUrl property is present
  3. Fetch the next page by sending GET to the base instance URL + nextRecordsUrl value (it is a relative path)
  4. Repeat until the done field in the response is true
  5. Collect records from the records array across all pages

Known gotchas

Related routes

paginate Notion database query past 100 results
notion-api · 3 steps · 100% success
Paginate through a large FHIR search result Bundle using next-page links
fhir · 6 steps · unrated
Paginate large Cassandra/Astra DB result sets using driver-level paging tokens
docs.datastax.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans