{"id":"d4e6ca06-62e6-46d6-971c-d76499d39af3","task":"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","steps":["POST to /services/data/vXX.0/jobs/query with operation set to query and a SOQL string that may include parent relationship dot fields","Poll the job status endpoint until the state is JobComplete","Fetch the results CSV via GET /services/data/vXX.0/jobs/query/<jobId>/results with a Sforce-Locator header starting empty","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","Continue until the response Sforce-Locator header is null, indicating all records have been downloaded","Parse each CSV chunk incrementally to avoid loading the entire result set into memory"],"gotchas":["Bulk API 2.0 query uses a locator-based pagination scheme that differs from Bulk API 1.0's result batches; the two APIs are not interchangeable","Including too many relationship traversal fields in the SOQL can cause the job to fail; simplify the query and join data post-download if needed","The CSV header row is only included in the first chunk; subsequent locator-fetched chunks contain data rows only"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/d4e6ca06-62e6-46d6-971c-d76499d39af3"}