linkedin

Working with Salesforce sObjects with Composite Connector Part II

In Part II of Working with Salesforce sObjects using Salesforce Composite Connector operations, we extend our MuleSoft Salesforce Integration walkthrough by focusing on how to retrieve, update, upsert, and delete records using sObjects. In Part I, we covered common sObject type names in Apex and established the foundational concepts required to work effectively with the Composite Connector.

This article builds on that foundation by demonstrating how Salesforce Composite Connector operations support efficient bulk data management while maintaining transactional control and predictable execution behavior. In Part I, we introduced Salesforce sObjects and demonstrated how to create sObject trees using the Composite Connector.

Retrieving Salesforce sObject Records with MuleSoft

Salesforce Composite Connector operations allow you to retrieve one or more records of the same sObject type within a single request. This approach minimizes API calls while ensuring consistent response mapping. At a protocol level, these operations follow established REST API composite request patterns, which allow multiple related actions to execute within a single, structured request.

Key characteristics of record retrieval include:

  • Retrieve one or more records of the same sObject type
  • The number of sObjects returned always matches the number of record IDs provided in the request

By aligning request and response sizes, MuleSoft enables deterministic processing and simplifies downstream handling.

Updating Salesforce Records Using the Composite API

You can use Salesforce Composite Connector operations to update multiple records in a single transaction. This capability supports high-volume data updates while giving teams explicit control over error handling behavior.

Important details for updating records include:

  • Update up to 200 records per request
  • The operation does not create new records when a target record does not exist
  • You can configure whether MuleSoft rolls back the entire request if an error occurs

This flexibility helps teams balance performance, consistency, and fault tolerance during batch update scenarios.

Upserting Salesforce sObjects via MuleSoft Integration

Upsert operations allow MuleSoft to either create or update Salesforce records based on an external ID field. This pattern works especially well for integrations where record existence cannot be guaranteed ahead of time.

Key characteristics of upsert processing include:

  • Create or update up to 200 records using an external ID field
  • Choose whether MuleSoft rolls back the entire request when an error occurs
  • Salesforce processes records in the order they appear in the request body
  • The response returns UpsertResult objects in the same order as the request

These features make Salesforce Composite Connector operations particularly effective for large-scale data synchronization and system-to-system integration workflows.

Delete Multiple Records

Salesforce Composite Connector operations also support bulk record deletion within a single request. This functionality simplifies cleanup processes and enforces consistent transactional behavior.

Key aspects of record deletion include:

  • Delete up to 200 records per request
  • The operation returns a list of DeleteResult objects
  • You can configure full rollback behavior if an error occurs

This approach ensures controlled execution when removing records at scale.

Conclusion and Series Continuation

Together, Parts I and II provide a complete overview of how Salesforce Composite Connector operations work with sObjects in MuleSoft, covering both object structure and full lifecycle data management.

In the next part of the series, we expand on these concepts by exploring advanced error handling strategies, performance optimization techniques, and real-world MuleSoft integration patterns.