How Salesforce Platform Events Work With Your ERP
Learn how Salesforce platform events work, their delivery limits, and how to safely execute event-driven writes to ERPs like NetSuite.

Salesforce platform events are messages that let Salesforce and outside systems react to each other through a publish/subscribe model. One system publishes that something happened, and others subscribe and respond. The catch is that a delivered event doesn’t mean the work is finished. A Closed-Won deal can fire an event in Salesforce yet never land as a completed write in Oracle NetSuite or another ERP.
To close that gap, the subscriber that writes into your system of record has to validate the payload, prevent duplicate writes (idempotency), check for permissions, handle errors, and keep a clean audit trail before you can treat the ERP transaction as complete.
Below, you’ll learn how platform events work, the limits that affect production workflows, how publishing behavior affects rollbacks, why NetSuite writes don’t always complete, and how to design a resilient path from event to completed transaction.
Key Takeaways
- Salesforce platform events support event-driven messaging, but they don’t guarantee that an external ERP write succeeded.
- The Salesforce event bus has delivery, allocation, and retention limits, including a 72-hour retention window that affects recovery from weekend outages.
- "Publish Immediately" and "Publish After Commit" both behave differently, so rollback behavior must match the business meaning of the event.
- NetSuite can reject writes after Salesforce delivery because authentication, payload validation, duplicate checks, and destination rules still apply.
- Engini provides a managed execution layer between agents and systems of record, with scoped permissions, audit trail, and replayable failed writes for routed actions.
Defining Salesforce Platform Events
A platform event in Salesforce is a special event message used for event-driven messaging between publishers and subscribers. Essentially, platform events let apps communicate inside or outside Salesforce through event messages. They work well when the producer doesn’t need to know which consumer handles the message.
Here’s a quick definition for easier reference:
- Platform event: A Salesforce event message published to the event bus.
- Publisher: The system or process that publishes the event.
- Subscriber: The system or process that listens for the event.
- Event bus: The Salesforce messaging layer that stores and delivers event messages for a limited time.
- Publish/subscribe: A messaging pattern that decouples the producer from the consumer.
Note: For platform events, Salesforce uses the event message as a trigger rather than as proof of downstream completion. That’s the core design point when the subscriber is expected to write into Oracle NetSuite, SAP Business One, SAP S/4HANA, Oracle Fusion, or another system of record.
The Publish/Subscribe Model Explained
The publish/subscribe model separates the publisher from the subscriber. A Salesforce process can publish an event to the Event Bus, and subscribers can consume that event through supported channels.
Common publishers include Apex code, Flow Builder, APIs, or Salesforce processes, while common subscribers include Apex triggers, Flows, Lightning Web Components using "empApi", external applications using Streaming API, and subscribers using Pub/Sub API.
Because the publisher doesn’t wait for every subscriber to finish, this model supports asynchronous processing. In practice, this means that the publisher can emit the event and move on, while each subscriber can then pick it up and process it later.
But while decoupling helps reduce direct dependencies, it also creates a responsibility boundary. So, Salesforce can publish and deliver the event, yet your external subscriber must still handle authentication, payload mapping, duplicate prevention, destination-system validation, and failed writes.
Custom vs. Standard vs. High-Volume Events
Salesforce platform events generally appear in three forms.
| Event Type | What It Means | Common Use |
|---|---|---|
| Custom platform events | Events you define for your own business process. | A Closed-Won opportunity event that starts order creation. |
| Standard platform events | Events Salesforce provides for specific platform behavior. | Salesforce-generated event messages for supported platform scenarios. |
| High-Volume Platform Events | Platform events designed for higher-scale publish and subscribe usage. | Enterprise event streams with larger delivery needs. |
Working With Custom Platform Events
- Custom platform events use custom fields for the payload, with types such as Text, Number, Date, and other supported field types, depending on the event definition.
- Custom platform event API names use the "__e" suffix, which separates an event definition from a custom object that uses "__c". For example, an event definition might end in "Order_Requested__e", while a custom object might end in "Order__c".
With that said, be sure to treat platform event records as event messages rather than standard database records. This is because after publication, the event message is read-only. That immutability is useful for messaging integrity, but it also means you correct downstream processing through a new action, a retry, or a replay strategy instead of by editing the original event.
Technical Limits of the Salesforce Event Bus
The Salesforce event bus is a messaging layer with limits, allocations, delivery behavior, and retention rules like any other. It also doesn’t execute external ERP transactions. We therefore recommend checking your organization’s edition, licenses, event type, and purchased allocations, because publish and delivery limits can vary depending on your exact setup.
Platform event logic also runs alongside Salesforce governor limits when Apex participates in publishing or subscribing. So, make sure to also review the governor limits documentation when your design depends on Apex triggers, batch processing, callouts, or transaction volume.
Note: Limits apply at the messaging layer, while ERP integrity depends on what happens after delivery. A Salesforce event can be published successfully, but the NetSuite write can still be rejected. If this happens, the subscriber may miss the retention window, hit an API limit, lose authentication, submit an invalid payload, or create a duplicate without an idempotency check.
The 72-Hour Retention Window
Salesforce retains platform event messages for 72 hours, with subscribers using a "ReplayId" to replay stored events within that retention window. That 72-hour window can make a difference in production. For example, a Friday evening subscriber outage can become a Monday morning data gap if the subscriber doesn’t recover and replay events before retention expires.
The error can be entirely missed on the business side as well. Let’s say that Salesforce published the event, but the downstream ERP action never completed. Without monitoring, missed replay detection, and a separate audit trail for the external write, your finance team may discover the gap only when an order, invoice, or customer record is missing from NetSuite.
And while "ReplayId" does help subscribers resume from a stored point, you should not treat it as a permanent storage solution. It also doesn’t validate that NetSuite accepted the transaction. All replay does is solve message recovery inside the retention boundary, but ERP execution still needs its own control path.
Publishing Behaviors and Rollbacks
Salesforce platform events can also use different publish behaviors. The two important options here are "Publish Immediately" and "Publish After Commit."
| Publishing Behavior | How It Works | Design Implication |
|---|---|---|
| "Publish Immediately" | Salesforce publishes the event when the publish call executes. | The event may publish even if the surrounding database transaction later rolls back. |
| "Publish After Commit" | Salesforce publishes the event only after the database transaction commits. | Subscribers receive the event only after the source transaction succeeds. |
Matching Publish Behavior to the Transaction
In Apex, "EventBus.publish()" is the common publishing call, and the chosen publish behavior decides how the event relates to the surrounding database transaction. That choice then affects data correctness, because publishing immediately from a process that later rolls back can leave a subscriber trying to create a NetSuite sales order for a Salesforce state that never committed.
On the other hand, "Publish After Commit" is usually safer when the event represents a committed business state, such as a Closed-Won deal, because it maps to a durable Salesforce change. Even so, that only confirms the source transaction was committed before Salesforce published the event and not that the ERP write completed.
Why Cross-System Writes to NetSuite Don’t Always Complete
This is because event delivery and ERP execution are separate steps in their own right. Salesforce can deliver a platform event, while NetSuite can still reject the write because of authentication, validation, permissions, duplicate records, required fields, or transaction rules.
This is also where people often get blindsided. Teams tend to treat event delivery as completed transactions, only to find gaps later on when finance reconciles the system of record.
With that said, a typical workflow here looks as follows:
- A Salesforce opportunity reaches Closed-Won.
- Salesforce publishes a platform event.
- An external subscriber receives the event.
- The subscriber maps the payload to a NetSuite customer and sales order.
- NetSuite validates the request.
- NetSuite accepts or rejects the write.
Note: The risky part sits between steps 3 and 6. That’s where authentication, field mapping, custom business rules, idempotency, and error handling decide whether the event becomes a completed ERP transaction.
Event Delivery vs. Completed Transactions
Event delivery means the subscriber received an event message. A completed transaction, on the other hand, means the system of record accepted and recorded the write.
However, NetSuite may reject the payload because a required field is missing, a subsidiary rule is not met, a customer match is ambiguous, or the authenticated role lacks access to the target record type. The same risk applies to other ERPs, including SAP Business One, SAP S/4HANA, and Oracle Fusion, where destination-system rules still govern the final write.
Why Retries Need Idempotency
If the subscriber retries after a timeout, it needs a duplicate check or idempotency key so it doesn’t create two customers, two sales orders, or two invoices for one Salesforce event. Note that a "ReplayId" only serves to recover a Salesforce event within the retention period, but it doesn’t provide business-level idempotency – the subscriber still needs to know whether the ERP write already happened.
The Missing Audit Trail for External Actions
Salesforce provides platform event publishing and subscription behavior, but the external ERP action needs its own audit trail. In practice, this means you need to have a way to see the source event, the subscriber action, the payload transformation, the destination response, and the retry outcome.
Without that cross-system record, troubleshooting turns into manual hell, where a developer checks Salesforce event publication, someone else checks the subscriber logs, finance checks NetSuite, and security checks permissions – only to see one part of the story.
Error Handling Across Systems
Error handling needs the same cross-system view. Ideally, a failed write should show the reason, the affected object, the destination system, the permissions used, and the safe retry path. Where supported and safe, the team can also correct the cause, verify destination state, and replay the failed write.
That audit trail is key for governance, too. It also matters for SOX-sensitive processes because a financial transaction needs traceability beyond a message stating “the event was published.”
Comparing Event-Driven Integration Approaches
Event-driven integration can run through native Salesforce features, point-to-point code, traditional iPaaS, standalone MCP or custom tools, or a managed execution layer. The right approach depends on the transaction risk, the number of systems involved, and how much execution logic your team wants to own.
Point-to-point integration can be enough for a narrow workflow, as middleware and iPaaS can handle mapping, routing, governance, and monitoring. Execution layers become mandatory, though, when an agent or external process needs one governed path across CRM, ERP, and other systems of record.
Native Features vs. Traditional iPaaS vs. Execution Layers
| Approach Type | What It Does Well | Work That Remains |
|---|---|---|
| Native Salesforce features | Good for publishing events, subscribing inside Salesforce, and triggering Salesforce-native automation. | External ERP writes still need authentication, mapping, validation, retries, and audits outside the event bus. |
| Point-to-point integration | Direct and clear for one source and one destination. | Each connection, permission model, retry path, and error state stays custom. |
| Traditional iPaaS | Strong fit for mapping, management, monitoring, and governed integrations. | Agent execution across several systems can require extra coordination and policy design. |
| Standalone MCP or custom tools | Effective for exposing tools to agents and applications. | Your team may still own server connections, permissions, observability, retries, and lifecycle management. |
| Managed execution layer | Gives agents one controlled path to act across connected enterprise systems. | You still need destination-system roles, finance approvals, and process ownership. |
How Engini Helps You Set Up Platform Events in Salesforce
Engini fits the managed execution layer approach. It does this by linking agents to enterprise systems through governed connectors and management, while connected systems keep enforcing their own rules.
For a Salesforce event that has to become a completed NetSuite write, Engini can also enforce scoped permissions on the routed action, execute the write, record a full audit trail, and surface any failed writes so your team can then review and replay them after correcting the cause.
Subscribing to Events and Handling Errors
To subscribe to a Salesforce platform event, you choose a subscriber type that matches where the work should run. For instance, Apex triggers and Flow Builder handle Salesforce-side work, while external subscribers can use Streaming API, CometD, or Pub/Sub API.
When it comes to choosing the right subscriber, it all depends on your latency needs, error handling, authentication, and whether the target action stays inside Salesforce or reaches an external system. At the same time, external subscribers listen to the relevant event channel, then process each event message according to the subscriber’s own error-handling and retry design.
Common subscription patterns here include:
- Apex triggers: Run server-side logic inside Salesforce after a platform event is published.
- Flow Builder: React to platform events with declarative automation inside Salesforce.
- Lightning Web Components with "empApi": Subscribe from the browser for UI-driven use cases.
- Streaming API or CometD: Subscribe from external applications.
- Pub/Sub API: Subscribe through Salesforce’s event-driven API model for external consumers.
Note: Error handling changes by subscriber type as well. A Salesforce-side subscriber can use platform mechanisms and logs, while an external subscriber may need its own handling for network errors, API limits, authentication expiry, destination validation, and duplicate protection.
Change Data Capture (CDC) vs. Platform Events
| Event Type | What Triggers It | Payload Meaning | Common Integration Use |
|---|---|---|---|
| Change Data Capture | A record changes in Salesforce. | Data about the record change. | Syncing changed records or reacting to data mutations. |
| Platform Events | Code, Flow, API, or automation publishes an event. | A business event you define. | Triggering a process, such as ERP order creation. |
Change Data Capture and platform events both publish event messages, but they represent different intents. CDC publishes change events that represent created, updated, deleted, and undeleted records, making it useful when subscribers need to know that a Salesforce record has changed.
Platform events, on the other hand, are custom business events. They work better when you want to publish a meaningful process event, such as an order request or ERP sync request, rather than every record change.
Building Resilient Cross-System Workflows
A resilient cross-system workflow treats real-time communication as a trigger rather than the whole transaction. So, while decoupling helps Salesforce publish without waiting for the ERP, the subscriber needs enough control to protect the system of record.
For a Salesforce to NetSuite process, the workflow should account for these states:
- The Salesforce source transaction committed.
- The platform event was published.
- The subscriber received the event.
- The subscriber validated the payload.
- The subscriber authenticated to NetSuite.
- The subscriber checked for duplicates.
- NetSuite accepted or rejected the write.
- The outcome was logged for review.
- A failed write can be corrected and retried where supported and safe.
Other Considerations to Note
- Platform events support event-driven communication, but if strict ordering is required for a business process, you may need custom logic to sequence actions, reject stale events, or verify the current destination state before writing.
- Review your Salesforce encryption at rest settings, event payload fields, subscriber credentials, and destination-system access so sensitive ERP data doesn’t move through the pipeline without the right controls.
- Platform events may not be the right tool when the process requires permanent message storage, strict ordering without custom logic, or a synchronous confirmation before the user can proceed. In those cases, a direct transaction path, a deterministic integration, or a different design may fit better.
- For agent-triggered writes, the same rule applies. The agent may interpret the task and propose an action, but the execution path still needs scoped permissions, destination-system validation, auditability, and a clear failure model.
Securing Your Salesforce to ERP Data Pipeline
The main point to take away from all of this is simple – a delivered Salesforce platform event may start the work, but it doesn’t finish it. That’s because a completed write in NetSuite still depends on authentication, payload validation, permissions, duplicate checks, the retention window, and an audit trail that all sit outside the event bus.
So, your next step is to map the full path from event to completed transaction and decide where each control lives. And for a single low-risk workflow, native features or a point-to-point integration may be enough. But once agents start writing across CRM, ERP, and other systems of record, a managed execution layer gives you a better solution with flexible permissions, auditing, and replay features in place.
Agent gateway
Ship agents into systems you can’t afford to break
Agent gateway and workflow automation on one iPaaS core: MCP, SDK, API, or canvas, with secure auth, audit trail and tool permissions built in.
Frequently Asked Questions
Can Salesforce platform events guarantee delivery to NetSuite?
They can support event delivery to subscribers within Salesforce’s documented limits, but they don’t guarantee that NetSuite accepted a write. That’s because NetSuite execution depends on the subscriber, authentication, payload validation, permissions, duplicate checks, and destination-system rules.
What happens if a subscriber is down for more than 72 hours?
If a subscriber outage exceeds the Salesforce event retention period, the subscriber may no longer be able to replay the missed events from the event bus. For production ERP workflows, you therefore need monitoring that detects subscriber lag before retention can expire.
Should a NetSuite write use “Publish Immediately” or “Publish After Commit”?
“Publish After Commit” usually fits better when the event represents a committed business state, such as a Closed-Won opportunity. Conversely, “Publish Immediately” can fit cases where the event itself must publish regardless of the surrounding transaction outcome.
Do platform events replace polling?
Platform events can reduce the need for polling because subscribers can react when Salesforce publishes an event. They, however, don’t remove the need for downstream controls – an external ERP write still needs validation, idempotency, error handling, and an audit trail.
When are platform events not the right tool?
Platform events may not fit when a process needs permanent message storage, strict ordering without custom logic, or synchronous confirmation before the user continues. They also may not fit if your only need is a simple two-app update with no system of record risk.