Integrating External Systems Using Flow HTTP Callouts
Why Integrations are Needed in Salesforce
Salesforce is a powerful CRM platform, but Salesforce alone is never enough in real-world projects. In almost every organization, Salesforce works with multiple external systems. Each system is built for a specific purpose, and Salesforce must communicate with them to complete a business process.
Why Salesforce Cannot Work Alone
Salesforce is mainly responsible for: managing customers, tracking leads and opportunities, storing business data, and automating workflows. However, Salesforce does not usually handle: payments, policy generation, document verification, background business rules, or external reporting engines. Those responsibilities are handled by other specialized systems. To make the business work endâtoâend, Salesforce must exchange data with these systems â this exchange is called integration.
Why APIs are used for integration â External systems expose APIs (Application Programming Interfaces). An API is a communication contract that allows one system to talk to another. Through APIs, Salesforce can send data, request data, and receive responses. Most modern APIs use HTTP, which is why Salesforce integrations are commonly called HTTPâbased integrations.
What Salesforce Integrations Actually Do
1. Send Salesforce Data to Other Systems
Example: send Lead data, Opportunity details, payment or policy information. Salesforce acts as the source system.
2. Receive Data Back into Salesforce
Example: receive policy numbers, payment status, verification results. Salesforce acts as the destination system.
3. Keep Systems in Sync
If data changes in one system, the same change must be reflected in the other (e.g., status updated externally â Salesforce updates its records).
4. Trigger Actions Outside Salesforce
Salesforce can create a policy, initiate a payment, or start background processing in another system using APIs.
Why HTTP-Based Integrations Are Required
HTTP is the most common and standardized way systems communicate today. Salesforce uses HTTP because it is platformâindependent, secure, widely supported, and easy to monitor and debug. Salesforce supports HTTP integrations via Flow HTTP Callouts, Apex Callouts, and Platform Events.
Understanding HTTP Basics
HTTP defines how data is sent and received between two systems. Whenever Salesforce integrates with another application, it uses HTTP to send information, request information, and receive results. This communication always follows a requestâresponse model.
Endpoint â API URL
An endpoint is the exact address of the external API. It tells Salesforce which system to contact and which operation to perform. In Flow HTTP Callouts, the endpoint is configured (often via Named Credentials for security and reuse).
HTTP Method â Action Type
- GET â retrieve information (fetch policy status, get verification result). No data is created.
- POST â send data or create something (send Lead, create a policy). Most common in Salesforce integrations.
- PUT â update existing data (modify customer details).
- DELETE â remove data from an external system (cancel a request).
Request â Data Sent from Salesforce
A request includes endpoint, method, headers (authentication, metadata), and body (actual data). In Flow integrations, the request body is usually JSON, mapped from Salesforce fields or Flow variables.
Response â Data Returned by the API
The response contains the result of the operation (IDs, status, messages). In Flow, response values are automatically parsed and can be used in Decisions, Assignments, or Record Updates.
Status Codes â Outcome Indicator
- 200 â Success â continue normal execution.
- 400 â Bad Request â data or validation issue.
- 401 â Unauthorized â authentication failed (credentials).
- 500 â Server Error â failure on external system.
What Is Flow HTTP Callout?
Salesforce often needs to communicate with external applications (payment systems, policy systems, verification services, ERP). To do this, Salesforce uses APIs, and the most common type is HTTP. Earlier, integrations were implemented mainly with Apex callouts, which required coding, test classes, and longer development time. Flow HTTP Callouts solve these problems by enabling clickâbased integrations.
Flow HTTP Callouts are used when: integration logic is simple, realâtime response is required, and business logic already exists in Flow. Just like Batch Apex is used for large data volumes, Flow HTTP Callouts handle simple, realâtime integrations.
How Flow HTTP Callouts Work Internally
- Flow reaches the HTTP Callout action.
- Salesforce builds the HTTP request using Flow variables.
- Salesforce sends the request to the external API.
- Salesforce waits for the response.
- Salesforce parses the response JSON.
- Response fields become Flow variables.
- Flow continues to the next element.
This process happens synchronously within the Flow transaction.
When to Use Flow HTTP Callouts
- Realâtime Lead integration: Lead created â send immediately to external system â receive ID â save on Lead.
- External validation: Screen Flow sends data to API (address validation, policy checks) â Flow allows or blocks next steps.
- Eventâbased notification: Record updated â notify external system (no complex retry logic).
When NOT to Use Flow HTTP Callouts
Avoid them for highâvolume data processing, thousands of records, complex looping, retry mechanisms, or unpredictable API response times. Prefer Queueable Apex, Batch Apex, or Platform Events in those cases.
Prerequisites for Flow HTTP Callouts
- API details: endpoint URL, HTTP method, request JSON, response JSON.
- Authentication details (known).
- Named Credential created (recommended for security and reuse).
- External system accessible from Salesforce.
Configuring Request Data in Flow
Request body must be JSON. Use Flow variables for dynamic values.
{
"name": "{!$Record.Name}",
"email": "{!$Record.Email}"
}
Handling API Responses in Flow
Flow parses response JSON and fields become output variables. Use them in Decisions, Assignments, or Record Updates.
Error Handling in Flow HTTP Callouts
Always handle failures. Check HTTP status code â success: continue; failure: log error or update record. Never assume the API always succeeds.
Authentication Using Named Credentials
Named Credentials are recommended: secure storage, no hardcoding, easy deployment, automatic token refresh. Supported types: Basic Auth, OAuth 2.0, API Key.
Real-World End-to-End Example
Requirement: When a Lead is created, send Lead data to an external CRM and store the returned External ID.
Flow Design: RecordâTriggered Flow (After Save) â HTTP Callout (POST) â Send Lead details â Receive External ID â Update Lead record.
Testing Flow HTTP Callouts
Flow HTTP Callouts cannot call real APIs in tests. Use Flow Test feature with sample request/response, validate decision paths, and validate record updates.
Limitations of Flow HTTP Callouts
- Not suitable for bulk processing.
- Limited debugging capabilities.
- No advanced retry logic.
- Payload size limits apply.
Best Practices for Production Use
- Always use Named Credentials.
- Explicitly handle errors (check status codes).
- Keep payloads small.
- Avoid highâfrequency triggers.
- Log failures for audit (create failure records).
Final Summary
Flow HTTP Callouts allow Salesforce to connect with external systems without writing any code. They are used when Salesforce needs to send data to another system and get a response immediately. Everything is configured using Flow, so the setup is easy to understand and maintain.
Flow HTTP Callouts work best when:
- The integration is simple.
- The response is needed right away.
- Only a small amount of data is involved.
They should not be used when:
- A large number of records must be processed.
- The logic is complex.
- Advanced retry or background processing is required.
In such cases, Apexâbased integrations are more suitable. In short, Flow HTTP Callouts are ideal for simple, realâtime integrations, while Apex is used for complex or highâvolume scenarios.