Salesforce Integration Patterns


Salesforce Integration is essential for seamless data flow and process synchronization. It involves patterns like Request and Reply for real-time communication, Fire and Forget for asynchronous processes, Batch Data Synchronization for scheduled and bulk data transfers, Remote Call-In for external system-initiated integration, and Data Virtualization for real-time access without data duplication.

Salesforce Integration Patterns

Introduction :

In todays digital world, seamless connectivity between different systems is crucial for optimizing business process, enhancing productivity and delivering a superior customer experience is key to success. Salesforce, a world leading Customer Relationship Management (CRM) platform, plays a pivotal role in this ecosystem. To get full potential of digital ecosystem, organizations often need to integrate Salesforce with various other applications and systems such as ERP Systems (SAP), Others system for Payment Integration, etc. In order to integrate these systems understanding of Salesforce Integration Patterns become essential. In this blog, we will explore Salesforce Integration Patterns, understanding their significance and how they empower organizations to harness the full potential of their data.

What is Salesforce Integration?

Salesforce Integration is the process of connecting Salesforce with other applications and systems to ensure a seamless flow of data and processes. The goal of Salesforce integration is to create a seamless and unified experience, allowing organizations to leverage the capabilities of Salesforce in conjunction with other tools and systems.

Common integration scenarios include connecting Salesforce with marketing automation platforms, ERP systems, financial software, e-commerce platforms, and third-party applications. Salesforce provides a range of tools and APIs, such as REST and SOAP APIs, to facilitate integration.

Salesforce Integration Patterns :

PatternScenario
Request and ReplySalesforce invokes a process on a remote system, waits for completion of that process, and then tracks state based on the response from the remote system.
Fire and ForgetSalesforce invokes a process in a remote system but doesn’t wait for completion of the process. Instead, the remote process receives and acknowledges the request and then hands off control back to Salesforce.
Batch Data SynchronizationData stored in Lightning Platform is created or refreshed to reflect updates from an external system, and when changes from Lightning Platform are sent to an external system. Updates in either direction are done in a batch manner.
Remote Call-InData stored in Lightning Platform is created, retrieved, updated, or deleted by a remote system.
Data VirtualizationSalesforce accesses external data in real time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system.

1. Request and Reply :

Key characteristic :

  • Synchronous : This is designed for those scenarios where salesforce wants to communicate with external system in real-time. Salesforce sends a request to external system and wait for its response to complete the process.
  • Point-to-Point Interaction : In this pattern, there is a direct, point-to-point interaction between salesforce and external system. Salesforce sends a request to external system, and external system replies with required details.
  • Simple Implementation
  • Ideal for Fast Response Time

Implementation Methods :

  • Salesforce Flows : It provides user friendly interface to call external services via declarative manner (no code required). Externally hosted service should be RESTful service and definitions are available in JSON format.
  • Apex Triggers : This can be utilize to call external service based on record data change. The callout will be asynchronous to external service by using future methods, Queueable interface. This is not recommended for this pattern. It is better suited for Fire and Forget pattern.
  • Apex Callouts : LWC component or Visualforce initiates the synchronous call to external services. Externally hosted service can be RESTful service or SOAP-based service.
  • Batch Apex : This allows to make a callout to external service via apex batch. There are governor limits applicable on number of callouts via Batch. However, they will be reset on every batch transaction.

2. Fire and Forget :

Key characteristic :

  • Asynchronous : In this approach salesforce does not wait for response from external system in real-time. This is mainly useful where immediate response is not required.

Implementation Methods :

  • Process-driven platform events : This works on Publisher-Subscriber model. Platform events are event message or notifications that an app sends or receives to take further action.
  • Customization-driven platform events : This is similar to Process-driven platform events. The only difference is events are created by Apex Classes or Triggers and same can be publish or consume by using Apex or API.
  • Workflow-driven platform events : This is similar to Outbound Messages where workflow/flow used to trigger outbound message.
  • Outbound messaging : Salesforce sends an outbound message to external system and in response it receives acknowledgement. If acknowledgement is not received in a timely manner salesforce retries automatically until it received acknowledgement.
  • Apex Callout
  • Batch Apex

3. Batch Data Synchronization :

Key characteristic :

  • Schedule Execution : Batch data synchronization involves executing integration processes on a scheduled basis, such as hourly, daily, or weekly.
  • Bulk Data Transfers : This is designed for exchanging Large Data Volumes between Salesforce and external systems in a batch process, rather than individual record-by-record updates.
  • Asynchronous : The data synchronization occurs asynchronously, meaning Salesforce does not wait for the external system to process the entire batch before moving on to other tasks.
  • Non-Real-Time Requirements : The is suitable when immediate data synchronization is not critical in real-time. This allows system to process data during off-hours.

Implementation Methods :

  • Change Data Capture : Salesforce Change Data Capture publishes change events, which represents changes to salesforce data. With Change Data Capture, you can receive near real time changes of salesforce data and synchronize them to external system.
  • ETL Tools : Extract, Transform, Load (ETL) tools can connect with multiple systems. They can extract, transform and load data into salesforce or from salesforce to external system.
  • Bulk API : Salesforce’s Bulk API is specifically designed for efficient batch data operations, enabling mass data insertion, upsert, update, or deletion.

4. Remote Call-In :

Key characteristics :

  • External System Initiates : This integration pattern is triggered by external system calling into Salesforce.
  • API-Based Communication : The external system communicate with Salesforce by using its APIs, such as SOAP or REST.

Implementation Methods :

  • REST API
  • SOAP API
  • Apex Web Service (SOAP)
  • Apex REST Service
  • Bulk API 2.0

5. Data Virtualization :

Key characteristics :

  • Real Time Access : Access data on-demand, provide near real-time access to data.
  • No Data Duplicate : Data is always stored in external system. It eliminates the need to store data in salesforce, reducing storage cost and simplifying data management.
  • Virtual Data Access : Salesforce users can access data, modify data, search data which is residing in external system similar to data which is stored in salesforce.

Implementation Methods :

  • Salesforce Connect : Use this to access data from external system along with salesforce data. Pull data from legacy system such as SAP, Microsoft in real time without storing in salesforce.
  • External Data Services : Access external system data by using their APIs to virtualize data which can be integrated into salesforce.

References :