Salesforce Change Data Capture & MuleSoft to Achieve Real-Time Integration

Learn how we implemented real-time integration with Salesforce using MuleSoft and Change Data Capture.

As technology progresses, the expectations for it to meet increase. This cause and effect relationship rears its horns in many different areas, but the one I will be focusing on within this post is the flow of data. Specifically, how quickly changes in data are reflected across systems and how Salesforce and MuleSoft can come together to surpass expectations. For those that do not know, Salesforce is the world’s #1 customer relationship management platform and MuleSoft is the world’s #1 integration platform.

Smartbridge is a Salesforce Consulting Partner & Managed Services Provider

For this post, we will be looking at a use case where our customer needed a solution to transfer customer orders created on the Salesforce community portal to a downstream ERP system for order fulfillment. The solution aimed to replace business-critical functionality. This means the solution had to do 4 things:

1. Trigger in real-time to provide updated information as quickly as possible.

2. Confirm that the order triggering the solution fits the criteria to be sent to the ERP system.

3. If valid, the solution needed to transform the order data from Salesforce to fit the required data in the ERP system.

4. The data needed to be inserted into a SQL Server staging table to be picked up by the ERP system.

The latter three requirements were relatively simple. But how we were going to run the flow in real-time was up for debate. The first things that came to mind when talking about real-time in Salesforce were Process Builder and Apex triggers. Both run on a record’s creation or update.

Between these two, only Apex triggers could provide the functionality to call a MuleSoft flow. But we wanted something simpler, if we went with an Apex trigger, we would have to create the trigger, create the MuleSoft flow, and then set up the endpoint that the trigger would call to activate the flow.

In the pursuit of something simpler, we discovered Salesforce’s Change Data Capture feature. A detailed introduction can be found HERE>>

A Seamless Integration

Change Data Capture, or CDC, is a service offered by Salesforce that aims to provide continuous synchronization of new and updated data to an external system. The way CDC provides this service is via streaming events.

Streaming events work by establishing two parties. First, the publisher, in this case Salesforce, will be broadcasting the updates for the data on its platform. Second, the subscriber, or the entity that will be actively listening to the publisher for update events.

Salesforce change data capture
Image courtesy of Salesforce

MuleSoft was selected as the desired platform for this integration due to its seamless integration with Salesforce’s CDC. I cannot express enough that the initial setup to begin receiving data was a single click and drag and then logging into the Salesforce instance. From there, the MuleSoft flow was able to run every time a save event happened from within Salesforce on the order object.

After that, creating the rest of the flow to perform the final 3 steps was relatively painless with MuleSoft. By the end of development, we had a fully functioning flow that ran in real-time and is capable of gathering data from Salesforce and pushing it to our desired staging table.

The project this requirement came from involved multiple other solutions utilizing MuleSoft to bridge Salesforce with other systems. I plan on going into these other solutions in the future, but for now, that is all. Through this project I have learned a lot about Salesforce and MuleSoft and I believe it is safe to say, that while technology does continue to evolve, Salesforce and MuleSoft will continue to provide safe and effective ways to evolve alongside it.

Looking for more on Salesforce?

Explore more insights and expertise at smartbridge.com/salesforce

There’s more to explore at Smartbridge.com!

Sign up to be notified when we publish articles, news, videos and more!