Skip to content

Enterprise Integrations · Architecture deep dive

Salesforce ERP integration patterns: ownership, events, and failure recovery

Architecture guide for Salesforce-to-ERP interfaces: platform events, CDC, canonical models, idempotent writes, error handling and recovery.

Written by
Michał TargielSalesforce Tech Lead & Integration Specialist
Published
· updated
Reading time
5 min read

Salesforce-ERP integration can turn a promising workflow into a persistent operational burden when ownership, retries, mappings, and reconciliation are designed late. This article is informational: it explains patterns and tradeoffs. If you need Synairo to design, review, remediate, or build interfaces for your systems, that is a separate commercial engagement (linked at the end of this page).

Pattern 1: Platform Events for near-real-time sync

Salesforce Platform Events are one supported primitive for event-driven integration. For example, an approved quote can publish an event that middleware consumes before calling the ERP. Salesforce retains high-volume platform events and Change Data Capture events for 72 hours (legacy standard-volume events were kept for 24 hours), allowing a subscriber to retrieve events within that window; it does not guarantee storage beyond it. The design still needs durable checkpoints, idempotency, monitoring, a reconciliation check, and recovery behavior outside the event bus, because Salesforce documents that in rare cases an event is not persisted and cannot be recovered.

Pattern 2: Change Data Capture as the outbound half of two-way sync

When data needs to flow in both directions - product catalog from ERP to Salesforce, order confirmations from ERP back to Salesforce - Change Data Capture (CDC) can publish Salesforce record changes to a subscriber. The ERP return path must use interfaces supported by the customer's exact product and version. CDC can reduce polling on the Salesforce side, but it does not by itself create a reliable bidirectional integration.

Pattern 3: Canonical data model for multi-ERP environments

Organizations with multiple ERPs (common after M&A) often build a separate point-to-point integration for every pair of systems that needs to exchange data. Each one carries its own field mappings, error handling, and deployment process, and the number of pairs grows roughly with the square of the number of systems: with Salesforce and three ERPs that all need to share customers and orders, there are up to six pairs, and a fifth system adds four more. Instead, define a canonical data model in your middleware layer - a neutral representation of Customer, Order, Invoice, and Product. Each system maps to and from the canonical model once, so N systems need N mappings. The trade-off is a model that must be owned, versioned, and kept from becoming the lowest common denominator; if only Salesforce and a single ERP exchange data, a canonical model is extra work for no gain.

Pattern 4: Idempotent writes everywhere

Network failures, ERP timeouts, and retry logic mean your integration will sometimes deliver the same event more than once, and Salesforce documents that platform event publishing can itself produce duplicates. Every write operation must be idempotent: applying the same operation twice must produce the same result as applying it once. In Salesforce, use External ID fields as upsert keys - the ERP's native record ID stored on the Salesforce object. In the ERP, use the Salesforce record ID as the business key for the upsert or lookup, and an identifier of the operation as the idempotency key: a record ID identifies the record, not the operation, so using it alone would make every update after the first look like a duplicate. Build a deduplication log in your middleware to skip processing of event IDs you've already handled. Choose the identifier carefully: a platform event carries an EventUuid that identifies the message, while the replay ID is an opaque position in the stream, is not guaranteed to be contiguous, and is not guaranteed to be unique across maintenance such as an org migration. The Change Data Capture guide documents no EventUuid in the change header, so do not assume one: a key built from the header's transaction key and sequence number, with the entity name, identifies a change within a transaction. Do not key on a single record ID, because the header's record IDs field is an array and changes to many records can arrive merged in one event; treat the commit number as diagnostic only. If you subscribe through Pub/Sub API, also evaluate the event id field, and confirm in your org that it is populated for change events.

Anti-pattern 1: Direct database connections

Direct reads from an ERP database can couple an integration to an internal schema, bypass application authorization, and create operational risk during upgrades. Prefer interfaces documented and supported for the customer's exact ERP product and version. Any exception should have an explicit owner, security review, change contract, and recovery plan.

Anti-pattern 2: Synchronous callouts in Salesforce transactions

Calling an ERP API synchronously from a user-facing Salesforce transaction couples the user's outcome to the remote system's latency and availability. Where the business process permits asynchronous completion, publish an event or enqueue work and handle the remote call with explicit retry and error behavior. Confirm platform limits and transaction semantics for the chosen Salesforce release and mechanism.

Anti-pattern 3: Ignoring error handling until production

The happy path works in every demo. Error handling is what separates a prototype from a production system. Define upfront: what happens when the ERP returns a validation error? When the middleware is down for 30 minutes? When field mappings fail because a record has unexpected null values? Build a dead-letter queue for failed events. Send alerts to the integration owner (not just to a log file nobody reads). Create a Salesforce custom object "Integration Error Log" that the operations team can monitor without needing to access middleware logs.

MuleSoft vs. custom middleware in 2026

MuleSoft can fit Salesforce-centric enterprises that already operate the Anypoint platform. Azure Integration Services or custom middleware may fit a different operating model. Compare total cost, team skills, support ownership, throughput, observability, and failure recovery using the customer's actual workload; generic cost ratios are not reliable procurement guidance.

Recommendation

Name an integration owner on each side of the interface, and give them the error queue and the authority to prioritize fixes. An interface with a technology stack but no one accountable for its failures is not operable.
This page stays informational. To hire Synairo for discovery, architecture review, remediation, or implementation of Salesforce-to-ERP interfaces, use the Salesforce ERP integration service page on synairo.com (commercial intent). The enterprise integrations discipline page describes the broader practice.

Related engineering insights

All engineering insights →

About the author

Michał Targiel, Salesforce tech lead and integration engineer at Synairo.

Dealing with this in your own org?

Michał wrote this because it kept coming up. If it is coming up for you, describe the setup and we will tell you what we would do.

Talk to an engineer

We approach this as part of Enterprise integrations.

For a scoped engagement on this topic, see Salesforce ERP integration.