How to Use HTTP Callout in Salesforce Flow (Step-by-Step Guide with Real-Time Examples)

Salesforce Flow is a powerful automation tool that helps you automate business processes without writing code.

But sometimes, you need to connect Salesforce with external systems like payment gateways, third-party applications, or external APIs.

This is where HTTP Callout in Salesforce Flow becomes very useful.

While working on Salesforce Flows, I had a requirement to check whether the email entered by a user is valid.

For example, when a new lead is created, we want to verify if the email provided is real and active before assigning it to the sales team.

Instead of using Apex code, I used an HTTP callout in the flow to send the email address to an external email validation API.

The API responded with a deliverability status, such as “deliverable” or “undeliverable”, along with the quality score of the email.

Based on that response, the flow decided whether to continue or show an error message to the user.

In this article, we will learn:

  • What HTTP Callout is
  • Why do we use it in Salesforce Flow
  • Step-by-step implementation
  • Real-time examples
  • Common mistakes and best practices

By the end of this guide, you will be able to confidently use HTTP Callouts in your Salesforce projects.

What is HTTP Callout in Salesforce Flow?

The Salesforce Flow helps users automate business processes without writing code. Sometimes during a process, we may need to send or receive data to or from another system outside Salesforce, such as checking email validity, retrieving weather information, or updating data in another app.

An HTTP Callout allows Salesforce to communicate with external systems using APIs. It sends a request (like asking a question) and waits for a response (the answer).

  • Send customer data to an external app
  • Fetch weather data from API
  • Get payment status from the payment gateway

What is an API?

API stands for Application Programming Interface. It acts as a bridge between two systems.

Example:

  • Salesforce ↔ External Website
  • Salesforce ↔ Payment System

Why Use HTTP Callout in Salesforce Flow?

Earlier, you had to use Apex code to make API requests. But now, with the “HTTP Callout” element in Flow, you can do this without writing any code.

It’s low-code and perfect for admins or consultants who don’t know Apex.

Here are the main reasons:

  • Connect Salesforce with external systems
  • Automate data exchange
  • Avoid manual work
  • Improve business processes

Types of HTTP Methods

MethodPurpose
GETRetrieve data
POSTSend data
PUTUpdate data
DELETEDelete data

How to Use HTTP Callout In Salesforce Flow

Below, I will explain all the prerequisites and how to create a flow to an HTTP callout to communicate with another system over the internet using an API.

1. Create Named Credentials in Salesforce

First, we need to create a new external credential to securely connect to external systems (e.g., APIs).

Named Credentials in Salesforce

It stores the login or authentication details (like API keys or tokens) safely, so you don’t have to hard-code them in your flow or Apex code.

This ensures secure and easy communication between Salesforce and other systems.

External Credentials in Salesforce

Then we need to create the principal in the external credential to define who is making the callout to the external system.

Here, I provided the parameter name as Email Validation Principle.

External Named Credentials in Salesforce

After that, we need to create a Named Credential in Salesforce to store the endpoint URL and link it to authentication (External Credential) in a secure, reusable way.

Create Named Credentials in Salesforce

I have created an account with the Abstract API, an external platform for validating email addresses. Here, we need the GET method, URL, API key, and email address.

Here, you need to copy the URL to add to the named credential.

Email Validation API Key for Callout

Paste the copied URL, select the external credential you created, and save it.

Create New Named Credentials in Salesforce

2. Create a Permission Set for the User

Initially, the user doesn’t have external credential principal access, so we need to create the permission set and assign it to the user.

Assign Permission Set to User in Salesforce

3. Create Screen Flow to Use HTTP Callout

According to the scenario, we wanted to validate the user-provided email address when creating the record and display the status. For this, we need to create a screen flow.

Go to Setup -> in quick find search for Flow ->New Flow -> Start From Scratch -> Screen Flow -> Next.

Add a Screen element and drag the Email component onto the screen.

Create Screen Flow in Salesforce

Then, click the footer and change the Finish button label to “Validate Email“.

Screen Properties in Salesforce Flows

After that, add the Action element to create the HTTP Callout.

Add Action Element in Salesforce Flow

We need to provide the new HTTP Callout name and select the Named Credential that we created for the validated email.

After that, you will see the URL that we added to the named credential.

HTTP Callout in Salesforce Flow

Then, select the GET method for the HTTP Callout action, as we are retrieving the email validity status from the external system.

Then, in the URL Path, we need to provide the path from the external system. For that, you need to navigate the Abstract API, where you will find the GET URL path.

Get Method in HTTP Callout in Salesforce Flow

Then we need to add a key to communicate with the external system. To do this, click the Add Key button. We need to provide the API key and our email address to the system for validation.

For that, I added two key fields: an API key and an email address. Then click the Next button.

Salesforce Flow HTTP Callout

After that, to obtain a response from the external system, we need to provide a response code for this action. To do so, select ‘Use Example Response‘.

How to HTTP Callout in Salesforce Flow

After that, to retrieve the response code again, navigate to the abstract API, copy it, and paste it into the Sample JSON Response field.

Then, in the Dara Structure, you will find the fields that are contained in the response.

Salesforce Flow to HTTP Callout

Now we need to provide an API key to the action element to communicate with the external system.

For this, we need to create a New Resource type Variable, provide the API Name, select ‘Text‘ as the Data Type, and then copy the API Key from the external system and paste it into the Default Value.

Create New Resource Variable in Salesforce Flow

Now, in the Set Query Parameter Values section, we need to provide the API key and email values.

In the API key value, select the variable we created in the previous step. In the email field, we need to enter the user’s email address; to do this, select the email from the screen component.

Set Values for HTTP Callout Action in Salesforce Flow

Then add the Decision element to check whether, when you send an email to an external validation API using Salesforce Flow, a response code of 200 indicates everything went well on the API side.

The API successfully received your request and processed it without any errors.

Add Decision Element in Salesforce Flow

After that, we need to display the status of email validity checks, which requires adding the Screen element.

Add the Display Text component on the screen, where we can display the status.

In the display text properties, I want to show the email addressdeliverability, and quality score for the email we want to validate. We need to provide values from the response for these parameters.

Add Display Text Component to Screen Flow in Salesforce

Now our flow is ready to save. Provide the flow label and the API name, and click on the debug button to test the flow.

How to Create Screen Flow in Salesforce

As I click the debug button, I need to provide my email to validate it. I have provided my email address and clicked the Validate Email button.

Salesforce HTTP Callout Flow

Here, you can see that we received the response we added to the display text component from the screen element. The external system validates the email send status as a response to the Salesforce flow.

Salesforce Flow HTTP Callout Method

Additionally, if I provide a random email address that is not valid, you can see that the status is displayed as ‘undeliverable’.

HTTP Callout using Salesforce Flow

After the flow has been successfully debugged, you can activate it and add it to the Salesforce homepage or record page.

In this way, we can create a Salesforce screen flow that uses an HTTP Callout to communicate with another system over the internet via an API.

Best Practices to Use HTTP Callout in Salesforce Flow

  • Always use Named Credentials
  • Validate API response
  • Use proper error handling
  • Test API before Flow

Frequently Asked Questions

Q1: Can we use HTTP Callout in all flows?

No, only in flows that support external calls

Q2: Is coding required?

No, Flow provides a no-code solution

What is the use of Named Credential?

It stores authentication securely

Q4: Can we handle errors?

Yes, using fault paths

Conclusion

HTTP Callout in Salesforce Flow is a powerful feature that allows you to integrate Salesforce with external systems easily.

By understanding how APIs work and following the correct steps, you can automate complex business processes without writing code.

I hope you have an idea about the HTTP Callout in Salesforce Flow. I have explained it with a real-time example and shown how to create a flow that uses an HTTP callout.

Here, we used the email validation example, which is an external system that checks the validity of an email address in Salesforce.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.