Outbound Integration in a Salesforce context is always from Salesforce to External Systems. It is where Salesforce initiates the contact with an external system. These notes are helping me to form concepts while studying for the Integration Architect Certification.
Only one of the options listed below does not require additional licenses. Where you need to consider budget constraints, External Services would be the option to choose.
Licenses not needed:
- External Services:
These need Named Credentials provided by the Open API-compliant provider/web service which include the authentication parameters and the URL of the callout endpoint in one definition. The Callout URL must be registered in the Salesforce org’s remote site settings or be specified in the Named Credentials. The results can be used with invocable actions in declarative tools such as flow.
An example of a situation where External Services would be used is accessing government and institutions services. In the UK, we have Companies House and the Charity Commission who provide API access to their database that fuels their public search feature. With External Services, we can use a button on the page layout and flow to send the search parameters to the Companies House or Charity Commissions REST-based Open API and receive back the results to update an account page.
Licenses needed:
- Change Data Capture:
This is a streaming product that publishes change events relating to Salesforce records when they are created, edited, deleted and undeleted. Using push technology, Salesforce (the publisher) pushes data to the external System (the subscriber). Change Data Capture for specific objects is configured from Change Data Capture in Setup.
Change Data Capture is a preferred tool to update data in external systems instead of scheduling exports or setting up API Polling. API Polling is an example of pull technology where an external service polls the Salesforce server for data updates. The data is not as fresh as Change Data Capture as it will depend on the state of Salesforce at the time the information is retrieved.
Each Change Data Capture event message body for created and undeleted records include all non-empty fields including system fields. For updates, the event message body contains only changed fields and will contain empty value fields if they were updated to null. Event message bodies for deleted records do not include fields or system fields.
The only circumstance in which all fields are received by the subscriber to the event channel is when you use Apex triggers to subscribe to it. Apex triggers listen on the associated ChangeEvent relating to the corresponding Salesforce Object (OpportunityChangeEvent). Interestingly, Apex Triggers run asynchronously after the Change event has been saved. This assists with reducing the transaction processing time and enables for processing business logic separate from the initial create/update/delete/undelete transaction. Although Apex receives all the fields, it can use the changed fields header field to determine which ones were modified.
Change Data Capture is therefore a way to do real time data replication from Salesforce. It requires an integration app that can receive those events and update the external system. As the events can be replayed up to 3 days, it is also good for those occasions where the external service may go off line for a few hours or a day, then come back on and not miss events.
The channels that can be used for Change Data Capture Events to be published on, can be through the standard channel for all events (/data/ChangeEvents) or via single-entity channels (/data/ContactChangeEvent or /data/CustomObject__ChangeEvent). It is also possible to set up a custom channel for multiple subscribers that receive different entities change events (/data/CustomChannelName__chn).
To subscribe and generate change events use EMP Connector. This is an open-sourced, community-supported free tool. Read more here.
There is a maximum number of concurrent subscribers (aka CometD clients) depending on edition. This allocation is shared across all events that can subscribe through the Streaming API (See this article). For example, it would share with PushTopics, generic, platform events and change events. The Change Data Capture Add-On license increases the 24-hour allocation and it is possible to exceed the new allowance, but Salesforce will be in touch to discuss event usage. I am not quoting the limits here as it is always best to check these with Salesforce directly. - Salesforce Connect / External Objects (OData 2.0 and 4.0 Adapters):
This is a declarative method of performing a Callout from Salesforce. Using Open Data Protocol 2.0 or 4.0, Salesforce Connect enables the Salesforce Org to access data stored externally and interact with that data via external objects.
If the external data is in another Salesforce Org, a Cross-Org adapter is used. Where these adapters are not suitable for the requirement, use a custom adapter created via Apex.
Interactions are converted into an OData query that returns results according to the parameters passed. Those interactions are the viewing, searching or modifying of data stored outside of your Salesforce org.
Salesforce Connect maps external systems data tables to Salesforce external objects instead of copying the data into Salesforce. This enables the data to be accessed on demand and in real time. It is used when there is a large amount of external data that should not be copied into your Salesforce instance and real time access to small amounts of that data is needed at any one time.
Salesforce External Objects can be used in the Global Search feature, lookup relationships, the mobile app and record feeds. They are available to APIs, can be deployed via Metadata API, Change Sets and packages as well as Apex code, SOSL and SOQL queries.
There are three types of relationships that can be built in Salesforce for External Objects:
* Lookup Relationships (from any standard or custom Salesforce Object or External Object to any standard or custom Salesforce Object using the 18 character ID). An example is an Account record displaying a related list of external SAP orders.
* External Lookup Relationships (from any standard or custom Salesforce Object or External Object to the External Objects external ID standard field). An example is an External Object displaying a list of Salesforce cases records.
* Indirect Lookup Relationships (from external objects to standard or custom Salesforce Objects). An example is an Account record displays a related list of SAP sales orders with matching customer IDs that are not Salesforce IDs.
The data transmitted through Salesforce Connect is encrypted using mutual transport layer security (mTLS). Read more about mTLS from CloudFlare’s website. If the data is sensitive look at encrypting it further in Salesforce Shield Platform Encryption. - Heroku Connect:
This enables the building of Heroku apps to share data with your Salesforce org. There is a bi-directional synchronisation that can occur between Salesforce and Heroku Postgres.
Integrating with Heroku would be ideal for data replication to a data warehouse to allow data from multiple sources to be analysed together. Additionally, it is a useful tool to enable legacy systems to receive from or provide data to Salesforce. If replication is not required, Heroku can act as a data proxy using the OData protocol and Heroku External Objects. This enables legacy or other external systems to provide data to Salesforce or, on the other hand, to the external systems without concerns about storage or data age.
Two more ways to use Heroku Connect is with either integration through external processes or custom user interfaces. External Processes can carry out machine learning, image processing, and integrations with external systems as a micro-service rather than deal with such complex processing in Salesforce. Custom User Interfaces are useful if you would like to use open-source technologies like Java, PHP, etc. on Heroku rather than Visualforce or Lightning Components. - Mulesoft Composer:
This enables Salesforce admins to connect apps and data to Salesforce and automate integrations quickly and easily in the Salesforce User Interface. Mulesoft Composer can connect as an authenticated user to different systems to extract data based on an event or schedule and map it between the systems. Mulesoft Composer can also take the data through a flow, filtering it and routing it according to conditions. Some notable ready to use connectors are Salesforce, Tableau, Workday, Google Sheets and NetSuite. Any integration set up in Mulesoft Composer can be tested before it is activated. There are also built-in ways to monitor and troubleshoot the flow. - Omni-Studio Integration Procedure:
These are applications that read and write data from Salesforce and external systems. They can be called from OmniScript, FlexCard, APIs or Apex methods. The Integration Procedure designer is declarative with drag and drop elements. It is generally used when you do not need to have user interaction and need to access or transform data in external systems. Multiple actions can be covered in one single server call and the processing is carried out server side. Omni-Studio Integration Procedure will only send the data you wish to send and can perform batch processing.
- Private Connect:
Launched in partnership with Amazon Web Services(AWS), Salesforce Private Connect is a service that is backed by AWS PrivateLink enabling private API Callouts from Salesforce to a service on Amazon Web Services. It also enables calls to Salesforce APIs from within Amazon Virtual Private Cloud. It is therefore a secure bi-directional connection.
At time of writing, Private Connect supports Experience, Financial Services, Health, Platform, Sales and Service Cloud. Inbound it supports public APIs. Outbound, it can utilise Apex Callouts, Change Data Capture, External Services, Platform Events and Salesforce Connect Custom Adapter. It will not work with locked sessions to the IP address from which they originated.
Outbound Integration is not limited to the above. There are also SOAP and REST Apex Callouts, Lightning Components, Outbound Messaging, Salesforce to Salesforce and Outbound email.