Level Up Your Salesforce Flow Game: Synchronous API Calls Without Code

Level Up Your Salesforce Flow Game: Synchronous API Calls Without Code

As an Integration Architect, I used to think that integrating synchronous processes in Salesforce with external systems was a complex and time-consuming process that required coding resources. However, after exploring the capabilities of Salesforce Flow, I discovered how effortless it is to make synchronous API calls without any coding knowledge. In this article, I will share how at Taboola we leveraged Salesforce Flow and Workato to create a reliable and flexible integration solution that met our business needs.

Before we dive into the technical details, it's essential to understand the context in which you might want to use synchronous API calls in Salesforce Flow. These calls are particularly useful when you need to retrieve or update data from an external system in real-time as part of a business process. In contrast, asynchronous API calls such as outbound messages or platform events may be used when data integration can be performed in the background, and the results are not needed immediately. However, there are situations when synchronous API calls are necessary, such as when you need to execute a business rule that depends on the response from an external system or when you require a user to take action based on the response.

While outbound messages and platform events are both powerful tools for integrating systems in Salesforce, they are asynchronous in nature, meaning that the response is not immediately available. Outbound messages are typically used to trigger external system updates in response to events in Salesforce, while platform events are used to notify external systems of changes in Salesforce data. However, both require additional setup and configuration, and they do not provide immediate feedback to the user. In contrast, synchronous API calls provide immediate feedback, which can be essential for certain business processes.

To provide a seamless user experience, we leveraged Salesforce Screen Flow to incorporate the synchronous API response as part of the Flow. This allowed us to display the API response to the user in real-time and incorporate it into the business process. We used Workato to develop the API endpoint that our Salesforce flow would call, and Workato's no-code interface allowed us to create the API endpoint quickly and easily, define the API request and response structure, and test the endpoint for correct functionality. Workato's built-in error handling and logging capabilities also made it easier to troubleshoot issues during testing. By using Workato and Salesforce Screen Flow together, we created a reliable and flexible integration solution that met our business needs without requiring extensive coding expertise.

Create the API in Workato

First of all we need to create an API in Workato, the API we created is of course much more complicated than this one. But for the sake of the example it's simplified and echoing the message it receives in the payload.

No alt text provided for this image

The next thing we need to do is to export the Open API specs json file from the Workato API Platform. The exported json file will look like this:

No alt text provided for this image

And as you can see, there's a full specification in the Open API format of the API we just created in Workato.

Create a Flow to Call an API

In this section, we will create a Flow that efficiently calls an API synchronously. To accomplish this, we will leverage the HTTP Request element to execute the API call. The HTTP Request element is incredibly flexible and permits you to specify the HTTP method, the endpoint URL, and any necessary headers or parameters for the API call. Additionally, we will use the Assign Variables element to capture the API response.

It's worth noting that this approach was developed in collaboration with our Salesforce Team Lead, Neta Orlovski . Together, we found this method to be a reliable and efficient way to integrate Salesforce with external systems using synchronous API calls.

  1. Register an External Service

No alt text provided for this image
Select from API Specification

In the next phase we'll use the exported Open API specification file in the JSON field

No alt text provided for this image

And we'll see the operation we built in Workato

No alt text provided for this image

2. Create new Apex-Defined Variable in the flow to support the population of the payload sent to the API

No alt text provided for this image

3. Set the mapping from the screen to the payload

No alt text provided for this image

4. Send the populated payload variable to the external service API

No alt text provided for this image

The final flow will look like this one

No alt text provided for this image

Demo

The input on the screen

No alt text provided for this image

The output on the screen

No alt text provided for this image

Note that when executing it in debug we can see all the the technical data of the call and as the external service is creating a full APEX class it can also be debugged as a code.

Conclusion

In this article, we have shown how to create a Flow to call an API synchronously. We have also provided some additional tips for creating Flows to call APIs. We hope that this article has been helpful. Building integrations with external services from Salesforce is a powerful tool and very needed. Building the solution with no/low code can be a bit challenging at first but in the long run it allows scale and independent maintenance to the Salesforce team.

Bear in mind that this is a simple example on how to build it and to have a full qualitative processes it needs to be added error handling and more.

Thank you for reading!

Omer Dafan

Business Marketing and Sales manager

7 个月

???? ??? ?? ??????! ??? ????? ???? ?????? ?????? ????? ?????? ????? ??? ????? ??????? ?????? ?????? ?????? ??????: https://chat.whatsapp.com/BubG8iFDe2bHHWkNYiboeU

回复
Svetlana Ratnikova

CEO @ Immigrant Women In Business | Social Impact Innovator | Global Advocate for Women's Empowerment

7 个月

???? ??? ?? ?? ???????? ??? ?????? ???? ?????? ???: ?????? ????? ??? ??????? ????? ????? ?????? ??????. https://chat.whatsapp.com/BubG8iFDe2bHHWkNYiboeU

回复
Rahim Earteza

CEO at Impala Intech | Helping Startups & Businesses Turn Ideas into Powerful Software | Expertise in SaaS, Mobile Apps, & Web Applications | Let’s Solve Your Problems with Tech! #BusinessProblems #SoftwareSolutions

1 年

Great post! ?? Integrating Salesforce with external systems using synchronous API calls in Flow sounds like a game-changer for efficient business processes. I'm curious to know more about the specific use cases at Taboola where immediate feedback is essential. How has this approach impacted your team's workflow and overall integration projects? #salesforce #salesforceintegration #salesforceflow #nocode #lowcode #integration

Raphael Zivi

IS Integration Lead at Taboola | Workato Expert

1 年
Max Fokin

IS Development Manager @ Taboola

1 年

Gidi Abramovich for sure you'll find it insightful ??

要查看或添加评论,请登录

Max Fokin的更多文章

  • Streamlining Netsuite Data: A Seamless Data Retrieval Integration

    Streamlining Netsuite Data: A Seamless Data Retrieval Integration

    In the ever-evolving landscape of technological innovation, efficiency and performance are paramount. At Taboola, we've…

    7 条评论
  • Should I Integrate Salesforce?

    Should I Integrate Salesforce?

    Well the immediate answer is probably YES! But why? and how to achieve it? CRM systems as Salesforce are customer…

    6 条评论

社区洞察