July 12, 2026

To retrieve and read Salesforce records with the MuleSoft Salesforce Connector, use one of three read operations: Query to run a SOQL statement, Query All to include deleted and archived records, and Retrieve to fetch specific records by their IDs. Query with SOQL is the workhorse for most reads, and the connector streams large result sets automatically so you can process them without running out of memory.
This guide covers each read operation, how to write the SOQL, how to handle large data sets, and how to fix the errors that show up most — the read side of any MuleSoft and Salesforce integration.
Reading records means pulling data out of Salesforce through the MuleSoft Salesforce Connector - querying records so a Mule application can process them, send them to another system, or make decisions on them. It's the read half of an integration; the write half is pushing records in.
In a typical flow, a Mule application queries Salesforce on a schedule or in response to an event, maps the results with DataWeave, and hands them to the next system — a data warehouse, an ERP, or a report. Before it reads anything, the connector authenticates with a Salesforce connection and needs read access to the objects and fields you query.
The connector's read operations are Query, Query All, Retrieve, and Bulk Query. Picking the right one keeps your reads fast and inside API limits. For the exact parameters each takes, keep the connector's operations reference and documentation open as you build.
The rule of thumb: use Query for everyday reads, Retrieve when you already hold the IDs, and Bulk Query when you're pulling more than the standard query limits comfortably handle.
Query is the operation you'll use most. It takes a SOQL statement and returns the matching records. Here's the flow.
Keep queries selective. A broad SELECT across millions of rows without a good filter will time out or hit limits - narrow it with WHERE, LIMIT, and indexed fields.
When you already have the record IDs carried from an earlier step or another system - Retrieve is faster and simpler than a query. Give it the object, the list of IDs, and the fields you want back, and it returns those records directly.-
Use Retrieve instead of a Query with a long WHERE Id IN (...) list when you hold the IDs already; it's built for exactly that and avoids an unnecessary SOQL statement.
Standard queries are fine for thousands of records, but large extracts need a different approach so you stay inside Salesforce limits.
Bulk behavior and streaming defaults can change between connector releases, so pin your connector version (the Mule 4 line) and check the release notes before upgrading.
Reading data still needs a secure connection and the right permissions. The connector authenticates to Salesforce with OAuth 2.0 (JWT bearer for production) or Basic auth for testing, running as a dedicated integration user.
For reads specifically, that integration user needs read access to every object and field you query - object permissions plus field-level security. A query that silently returns fewer fields than expected is almost always a field-level security gap, not a SOQL problem.
Read operations fail for a small set of predictable reasons. Here's how to clear them.
For platform detail on SOQL limits and access, the Salesforce Developer blog and Salesforce Admins resources are the primary references, and Apex Hours and Salesforce Ben have MuleSoft query examples.
A few habits keep your reads fast, complete, and inside Salesforce limits:
These are the same standards we hold on every Salesforce integration with MuleSoft, and we keep flows healthy afterward through managed services.
Use the connector's Query operation with a SOQL statement, or Retrieve when you already have the record IDs. Add the operation to your flow, select the fields you need, and process the returned records with DataWeave.
Query returns active records that match your SOQL. Query All returns the same records plus deleted and archived ones, which is useful for auditing or syncing deletions to another system.
Let the connector stream standard Query results so you process them in chunks, and switch to the asynchronous Bulk Query for full extracts or millions of records. Filter selectively to stay inside SOQL and API limits.
Yes - "SFDC" is shorthand for Salesforce, so the MuleSoft SFDC connector is the same Anypoint Connector. Its Query, Query All, and Retrieve operations read records the same way regardless of which name you see.
Almost always field-level security. The integration user needs read access to every field in your SELECT; without it, Salesforce simply omits those fields rather than erroring. Grant the field access on the user's profile or permission set.
Through the Salesforce connection you configure - OAuth 2.0 (JWT bearer for production) or Basic authentication for testing - running as a dedicated integration user with read access to the objects you query.
Retrieving and reading Salesforce records with the MuleSoft Salesforce Connector comes down to choosing the right operation - Query, Query All, or Retrieve - writing selective SOQL, streaming large results, and giving the integration user the read access it needs. Get those right and data flows out of Salesforce cleanly, fast, and within limits.
That's what we do at Minuscule Technologies. As a trusted Salesforce engineering partner with 160+ specialists and 75+ projects delivered since 2014, we design and build Salesforce integrations and MuleSoft-based data flows for enterprises - including Nasdaq-listed firms - that need reliable reads out of Salesforce into every system they run, backed by the DevOps discipline to keep them running.
Need Salesforce data flowing to the rest of your stack? Talk to Minuscule Technologies and let's build the flow.
You've seen what's possible. Now, let's make it happen for your business. Whether you need an end-to-end Salesforce solution, a complex integration, or ongoing managed services, our team is ready to deliver.
Schedule a Free Strategic Call