Skip to main content

Table of Contents

Integration - General

See also: Official References for the source Salesforce docs behind everything below.

How to approach an integration requirement

For each requirement, work through these steps - it keeps your talk track structured and surfaces hidden integrations.

StepQuestion to answer
1. Event / TriggerWhat starts it? Record create/update, button click, schedule, inbound call, external event.
2. HandlerWho orchestrates it? Flow, Apex trigger, LWC, or middleware (ESB/ETL).
3. Feature / MethodWhich Salesforce capability? Apex callout, External Service, Platform Event, CDC, Salesforce Connect, REST/SOAP/Bulk/Pub-Sub.
4. PatternReal-time, near-real-time, or batch? Sync vs async?
5. ResultWhat happens in the end system? e.g. order synced to ERP.
6. Response handlingIs a response needed, and does the user wait for it?
7. Error handlingRetry (where?), notify the user, fail gracefully, fallback.

Key rule: if the user must wait for the outcome to continue, the pattern must be synchronous; otherwise prefer asynchronous for resilience and scale.

List of Most Common Integration Patterns

PatternTimingSync/AsyncDescription
Request & ReplyReal-timeSyncCall and wait for the process to complete (user needs the result).
Fire & ForgetReal-timeAsyncCall and don't wait for the process to complete.
Batch Data SynchronizationBatchAsyncBulk move/sync of large data sets (Bulk API / ETL).
Remote Call-InReal-timeEitherExternal system calls Salesforce to CRUD data.
Remote Process InvocationReal-timeEitherSalesforce triggers a process in a remote system.
UI Update Based on Data ChangeNear-real-timeAsyncSubscribe to events/streams and refresh the UI.
Data VirtualizationReal-timeSyncSalesforce Connect external object (OData) - no data stored.

Integration methods (Salesforce features)

MethodDirectionWhen to use
REST APIInboundStandard CRUD/queries; lightweight, JSON, mobile/web clients.
SOAP APIInboundStrongly-typed contracts; legacy/enterprise systems needing WSDL.
Bulk API 2.0InboundLarge data volumes (LDV), data migration, batch loads.
Apex Callout (REST/SOAP)OutboundCustom outbound calls with transformation/logic.
External ServicesOutboundDeclarative callouts from Flow using an OpenAPI spec - low code.
Outbound MessageOutboundLegacy declarative SOAP message; no further Salesforce investment - prefer alternatives.
Platform EventsBothDecoupled pub/sub, custom payload, fan-out to many subscribers.
Change Data CaptureOutboundStream record changes to keep an external system in sync.
Pub/Sub APIBothPublish & subscribe to events efficiently (gRPC, binary).
Salesforce ConnectBothView/CRUD external data live without storing it (OData / cross-org).
CanvasUIEmbed a third-party app inside the Salesforce UI (good behind a firewall).
Streaming API (PushTopic)OutboundSubscribe to SOQL-based change notifications (legacy vs CDC).

Technologies

Middleware: ESB vs ETL

Prefer middleware over point-to-point to avoid tight coupling and to centralize governance, transformation, and reuse.

ESBETL
PurposeReal-time system-to-system messaging & orchestrationBatch processing of large data sets
StyleEvent/message bus, loose couplingExtract -> Transform -> Load
Typical useSync data between CRM and ERP in real timeData migration, bulk sync, load into a data warehouse
ExampleMuleSoft Anypoint as a message busScheduled bulk jobs, archiving to a warehouse

Note: Salesforce can't participate in distributed (two-phase) transactions - the middleware layer owns queuing, buffering, retries, and orchestration.

Integration architectures

ArchitectureIdeaTrade-off
Point-to-pointDirect system-to-system linksSimple at first; brittle and unscalable as systems grow.
Hub & spokeCentral hub mediates connectionsFewer links; hub can become a bottleneck/single point.
ESBShared message bus with orchestrationBest for scale/governance; more setup and skills needed.

Error handling

  • Retry - where? Usually in the ESB/middleware, not in Salesforce.
  • Notify - surface a clear error to the user when a synchronous call fails.
  • Fail gracefully - handle predefined downtime windows; don't break the user flow.
  • Fallback - give users a manual way to proceed/check status when the integration is down.
  • Idempotency - design retries so reprocessing the same message is safe.

Security & authentication

  • Use a dedicated integration user with an API Only profile (least privilege).
  • Prefer External Client Apps for AuthN/AuthZ over legacy connected apps / SOAP login.
  • Store credentials in Named Credentials (no secrets in code).
  • Secure the message (TLS, encryption) and the network (e.g. Canvas for a system behind a firewall).
  • One integration per user for the cleanest, most auditable setup.

Anti-patterns to avoid

  • Swivel chair - manually rekeying data between systems (except rare edge cases).
  • Unnecessary replication - if data doesn't need to live in Salesforce, virtualize it with Salesforce Connect (more data -> LDV -> performance/debt).
  • Point-to-point sprawl - many direct links instead of middleware.
  • Sync where async fits - blocking the user on a remote system you don't control.