Configure a Salesforce Bulk API 2.0 query job to extract records with related fields and handle multi-part result downloads

domain: developer.salesforce.com · 6 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. POST to /services/data/vXX.0/jobs/query with operation set to query and a SOQL string that may include parent relationship dot fields
  2. Poll the job status endpoint until the state is JobComplete
  3. Fetch the results CSV via GET /services/data/vXX.0/jobs/query/<jobId>/results with a Sforce-Locator header starting empty
  4. Each response includes a Sforce-NumberOfRecords header and a Sforce-Locator header; if Sforce-Locator is non-null, repeat the GET passing that locator to retrieve the next chunk
  5. Continue until the response Sforce-Locator header is null, indicating all records have been downloaded
  6. Parse each CSV chunk incrementally to avoid loading the entire result set into memory

Known gotchas

Related routes

Run a Salesforce Bulk API 2.0 query job to extract large datasets and download multi-part result files
developer.salesforce.com · 6 steps · unrated
Run a Salesforce Bulk API 2.0 query job to extract all records from a large object with relationship fields, then download the results CSV in parts
salesforce.com · 5 steps · unrated
Create and monitor a Salesforce Bulk API 2.0 ingest job for a large dataset
salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ 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