EXCEEDED_ID_LIMIT" salesforce bulk api
Fixes Salesforce Bulk API EXCEEDED_ID_LIMIT: too many ids in a single retrieve or delete call. Chunk the id list into smaller batches. Use when bulk calls fail with this error. Not for daily API limits.
TL;DR
The call packed more ids than the API accepts in one request. Split the id list into chunks (a few hundred at a time works reliably), send one call per chunk, and aggregate the results. The limit is per call, not per job.
Error
EXCEEDED_ID_LIMIT: too many ids in requestSteps
- Count the ids in the failing call. Expected: you confirm the call exceeded the per-request id limit.
- Chunk the list into groups of a few hundred ids. Expected: each chunk is comfortably under the limit.
- Send one retrieve or delete call per chunk, sequentially or with modest parallelism. Expected: every chunk returns 200.
- Aggregate the per-chunk results into one result set. Expected: complete coverage with no gaps or double-processing.
- In agents, make chunking the default for any id-list operation instead of a special case. Expected: the error never recurs regardless of input size.
When to use
- Bulk retrieve or delete calls fail with EXCEEDEDIDLIMIT.
- An agent collects thousands of ids then fires one giant call.
- Hard deletes of merged duplicates fail on large sets.
When not to use
- REQUESTLIMITEXCEEDED (daily API call limits).
- UNABLETOLOCK_ROW (contention on the records, not the call size).
Tool compatibility
- Salesforce REST and SOAP APIs; retrieve and delete calls with id lists.
- Bulk API jobs that reference id batches.
Variant phrasings
too many ids in request
The long form; chunk and retry.
EXCEEDEDIDLIMIT on undelete
Same limit applies to undelete calls with id lists.
Why it happens
Id-list calls are bounded per request to keep them fast. Agents that accumulate ids over a long dedupe run and flush them in one call hit the bound exactly when the run is biggest.
Edge cases
- Chunk size interacts with lock contention; smaller chunks also reduce UNABLETOLOCK_ROW on deletes.
- Keep a manifest of processed chunks so a mid-run crash resumes instead of restarting.
- The SOAP and REST limits differ; chunk for the smaller one if the code supports both.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_d1MeY5ZW1PI1Qrpbqy7AZw
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.