Run a SOQL query with pagination from the Salesforce API
domain: salesforce.com · 4 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 salesforce.com, checked against official docs, with linked verified routes.
Steps
GET /services/data/v60.0/query?q=SELECT+Id,Name+FROM+Contact+WHERE+...
If done:false, follow nextRecordsUrl until done:true
Use queryAll to include deleted/archived records
For >10k rows or exports, switch to Bulk API 2.0 query jobs
Known gotchas
SOQL has no SELECT * — you must enumerate fields
Relationship queries count child rows against the 2000-row batch differently; nextRecordsUrl is mandatory handling
OFFSET caps at 2000 — keyset pagination (WHERE Id > last) for deep paging
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?