Processing Large Salesforce Data Volumes with MuleSoft and Bulk API 2.0
When an integration moves hundreds of thousands or millions of Salesforce records, the first optimization should not be a larger Mule worker. It should be choosing an interaction model designed for bulk data.
Salesforce Connector exposes operations backed by Salesforce Bulk APIs, including Bulk API 2.0 capabilities.
Synchronous and bulk workloads are different
A synchronous query is appropriate when a caller needs a reasonably sized result now. Bulk processing is asynchronous by design:
Mule
→ create/submit bulk job
→ Salesforce processes asynchronously
→ inspect job status
→ retrieve successful/failed/unprocessed results
→ reconcile
Design the flow around that lifecycle rather than pretending the bulk job is one long synchronous request.
Ingest design
For large writes:
- transform source records into the Salesforce contract;
- submit a bulk ingest job using the appropriate operation;
- retain a correlation between source batch and Salesforce job ID;
- poll/check completion at a controlled interval;
- retrieve success and failure results;
- reconcile failures without replaying successful records unnecessarily.
Query design
For large extracts, use a bulk query approach when synchronous retrieval becomes inappropriate. Keep the extraction fields intentional and consider whether the consumer can process result chunks incrementally.
Memory is an architecture concern
Avoid patterns such as:
retrieve millions of records
→ convert everything into one Array
→ transform entire Array
→ send entire Array downstream
Chunk processing, streaming where supported, and bounded concurrency produce much more predictable runtime behavior.
Failure recovery
A production bulk integration should answer:
- Which job produced this file/result?
- Which source records succeeded?
- Which failed validation?
- Can failed records be retried independently?
- Can the flow restart without resubmitting an already-completed job?
Connector-version awareness
Salesforce Connector evolves. Current release notes document BulkV2 result operations and changes across connector versions. Pin and test connector/runtime versions rather than assuming an old example exactly matches a current project.