Integration

Salesforce Integration Patterns — REST, SOAP, Platform Events and More

Published 9 June 2026 · 15 min read · Advanced

Salesforce integration is one of the highest-leverage decisions in any implementation. A well-chosen integration pattern scales gracefully, tolerates failures, and is maintainable by the team long after the initial developer has moved on. A poorly chosen pattern becomes a fragile bottleneck that breaks under load and requires specialist knowledge to debug.

The integration decision framework

Start with direction. Is an external system calling Salesforce, or is Salesforce calling an external system? Then consider timing — does the calling system need an immediate response, or can it fire and forget? Then consider volume — one record at a time, or thousands per minute?

Inbound integration patterns

Salesforce REST API

The standard REST API at /services/data/vXX.X/ is the first choice for inbound integrations where an external system needs to read or write Salesforce records. It is well-documented, supports all CRUD operations, and has robust query support through the SOQL endpoint.

For external systems that need to perform multiple related operations, the Composite REST API allows up to 25 subrequests in a single HTTP call with response chaining — the result of one request can be used as input to the next.

Apex REST

When the standard REST API cannot express the required data shape or business logic, build a custom endpoint using @RestResource. This gives you full control over request parsing, data transformation, and response format.


@RestResource(urlMapping='/v1/case-intake/*')
global class CaseIntakeService {
@HttpPost
global static CaseIntakeResponse createCase() {
RestRequest req = RestContext.request;
CasePayload payload = (CasePayload)JSON.deserialize(
req.requestBody.toString(),
CasePayload.class
);
// business logic here
Case c = new Case(Subject = payload.subject, Status = 'New');
insert c;
return new CaseIntakeResponse(c.Id, 'created');
}
}

## Outbound integration patterns

### Apex callouts

For synchronous outbound calls where Salesforce needs an immediate
response from an external system, Apex HTTP callouts using
`HttpRequest` and `HttpResponse` are the standard approach. Always
use named credentials rather than hardcoded URLs to manage
authentication and endpoints in a deployment-safe way.

### Platform Events

When Salesforce needs to notify an external system but does not need
an immediate response, Platform Events are the right choice. Events
are published within the Salesforce transaction and delivered
asynchronously to subscribing systems. External subscribers use the
Streaming API or CometD to receive events.

Summer '26 added ordering guarantees and dead letter queues to Platform
Eventsa long-requested feature that makes them suitable for
high-reliability integration scenarios where event sequence matters.

### Change Data Capture

For external systems that need to stay in sync with Salesforce data,
Change Data Capture eliminates the need for polling. Subscribe to CDC
channels via the Streaming API and receive real-time change events
as records are created, updated, deleted or undeleted.

## Summer '26: Salesforce MCP Server GA

Model Context Protocol servers became generally available in Summer '26.
This opens a new category of AI-driven integrationexternal AI tools
including Claude, GitHub Copilot and others can access Salesforce data
and metadata as context using the standardised MCP interface.

For integration architects, this means Salesforce is becoming
natively accessible to AI tooling without custom API development.
The immediate use case is AI assistants that can query Salesforce
data as part of broader workflows. The longer-term implication is
that AI-to-Salesforce integration becomes a standard capability
rather than a bespoke development effort.

## The reliability principles

Every production integration should be idempotentsending the same
message twice should produce the same result as sending it once. Use
upsert with an external ID field rather than insert to achieve this.

Build for failure. External systems are unavailable. Implement retry
logic with exponential backoff. Use Platform Events or Queues as buffers
when synchronous reliability is required. Store failed payloads in a
custom object for manual review and replay.

Monitor everything. Log every callout with its response code and response
time. Set up alerts for error rates above 1%. A silent integration failure
is worse than a visible one.

Test your knowledge — Integration

10 questions · Basic to Advanced

0 / 10 correct

Frequently asked questions

What are the main Salesforce integration patterns?

The main patterns split by direction — inbound (external systems calling Salesforce) and outbound (Salesforce calling external systems) — and by timing. Inbound uses the REST API, SOAP API, or custom Apex REST endpoints. Outbound uses Apex callouts, Platform Events, or Change Data Capture for event-driven sync.

What is the difference between Platform Events and Apex callouts?

Apex callouts are synchronous — Salesforce waits for the external system to respond before the transaction completes. Platform Events are asynchronous — Salesforce publishes the event and the transaction completes immediately, while subscribers process the event at their own pace. This decoupling prevents slow external systems from degrading Salesforce transaction performance.

What is Change Data Capture (CDC) in Salesforce?

Change Data Capture streams real-time notifications to external subscribers whenever Salesforce records are created, updated, deleted, or undeleted via the Streaming API. It is preferable to polling because it pushes changes as they happen rather than requiring the external system to repeatedly call Salesforce APIs.

What is the Salesforce Composite REST API?

The Composite REST API allows up to 25 subrequests in a single HTTP call, with later subrequests able to reference results from earlier ones. It reduces network round trips and API call consumption for external systems that need to perform multiple related operations.

What is an External Service in Salesforce?

An External Service lets you register an external REST API using its OpenAPI specification. Salesforce generates invocable actions automatically, making the external API callable from Flow and Apex without writing HTTP request boilerplate.

What is the Salesforce MCP Server that became GA in Summer '26?

The Salesforce-hosted Model Context Protocol (MCP) server became generally available in Summer '26, allowing any MCP-compatible AI client — including Claude and GitHub Copilot — to access Salesforce data and metadata as context without custom API development.

What does idempotent mean in the context of Salesforce integrations?

An idempotent integration produces the same result whether a message is sent once or multiple times. In Salesforce, this is typically achieved with upsert operations using an External ID field rather than insert, so retried or duplicate messages do not create duplicate records.