Blog

Speedup your Salesforce Integrations with Composite Connectors

Sivendu SasidharanWritten by Sivendu Sasidharan

Anypoint Connector for Salesforce Composite API enables you to work with the Salesforce Composite Rest API, a lightweight set of REST API from salesforce that increases the performance of your integration with Salesforce. When used right with the appropriate Integration Patterns, a Composite connector can significantly reduce the number of API Calls to Salesforce.com when compared to the default Salesforce Connector.

Read more on how NJC Labs can help you reduce your Salesforce Platform API consumption while increasing your integration speed. with MuleSoft Salesforce Integration and composite connectors

What is a Salesforce Composite Connector ?

Salesforce Composite Connector uses a single REST API call to access several individual Salesforce services. This connector improves your application’s performance by minimizing the number of round-trips between the client and server.

Salesforce Composite Connector

A Salesforce connector can handle only one type of object. But in Salesforce, there are multiple objects with parent child relationships. While dealing with multiple objects and parent child relations the number of calls that has to be made to Salesforce will be more. This exhausts Salesforce API call limit for customers, which in turn brings in additional cost for customers to scale up API usage subscription. This can be greatly reduced if Salesforce Composite connectors are used.

Benefits of using Anypoint Salesforce Composite Connector ?
  • Offers the ability to create a collection of nested parent-child records.
  • Reduce the number of API calls to SFDC, reduces network overhead and shortens processing time.
  • Enables a user to execute dependent requests in a single API call.
  • Allows to create, delete and update multiple records in a single request
Operations exposed by Composite resource
  • Composite: executes sequentially several requests in a single call. The response from one request can be used as an input in the subsequent call.
  • Batch: Executes up to 25 sub requests in a single request.. Each sub request executes independently and information can’t be shared between the calls.
  • SObject Tree: creates one or more sObject trees with root records of the specified type.
  • SObject Collections: reduces round-trip between the client and the server. It allows up to 200 records to be created, updated, retrieved, or deleted with fewer round-trips. We can determine if the entire request should be rolled back in case of an error.
Use case of each operation
  • If the calls are unrelated but of same object or action, we use sObject Collection
  • If there is smaller number of unrelated calls, we can use Batch
  • If we are creating a hierarchy of related records, sObject Tree is the best option
  • If we need to chain calls so that the response from one request can be used to enrich data of next, use Composite