Publish an order status change as an event when several systems need to react to it soon after it happens, and when the partner does not need to wait on an answer. Platform events and change data capture are the usual options for publishing record and field changes, and the Pub/Sub API suits new publish and subscribe designs. A scheduled pull fits better when status changes arrive in batches and rarely.
Decide whether a status change belongs on an event channel
Start with two questions: who needs the change, and how quickly they need it. An order that moves from submitted to shipped matters to the warehouse, to billing, and to any customer-facing portal, and each of those consumers may need the change within minutes. A partner that polls asks the same question again on each cycle, and it spends request allowance whether or not anything changed. An event tells each subscriber what happened at the moment it was published.
Event-driven designs do not guarantee a response time, so they fit poorly where a user waits on a reply. If a sales representative needs an accepted shipment before the screen moves on, keep a synchronous call for that step and use the event for the side effects that follow.
Before you choose, work through three checks:
- List each consumer of the status field and the delay it can tolerate.
- Mark any consumer that blocks a user action, and move that step to a synchronous request.
- Estimate how many status changes a day you expect and how often the source data actually changes. Infrequent changes that arrive in batches are simpler to move on a schedule.
For the wider pattern that covers synchronous and asynchronous choices together, the Salesforce integration architecture page lays out how the options fit a single landscape.
Choose between platform events and change data capture
Platform events carry a payload that you design. The platform does not publish them on its own when a field changes. An Apex class or a Flow has to publish the event, so the status-change automation is the piece you build and test. This suits a deliberate message such as an order identifier, a new status value, and a carrier reference.
Change data capture publishes record-level change events for the objects you enable. It needs no custom publish code, but the payload describes the changed fields in the platform’s format, so the partner has to map those fields to its own order model. Choose it when the partner needs the full set of field changes and you want the platform to handle the publishing.
For new subscribers, design on the Pub/Sub API rather than on older routes. It gives the partner one subscription channel for platform events and change data capture alike, which keeps the subscriber code in one place.
Build the publish step so each message carries its own meaning
The publish step is where many later problems start. A bare message that says “order changed” forces the partner to fetch the order to learn what happened, and that fetch adds calls and delay. Put the meaning in the message.
- Define the payload with the order identifier, the new status value, the time the change happened, and a version number for the message structure.
- Publish from a single Flow or a single Apex class, so the team can see all paths that emit the event.
- Stop loops. If a consumed event triggers a new event back to its origin, the two systems can keep passing the same change between them. Add logic that breaks the cycle.
- Record the event name, the field list, and the error handling in the integration catalog your team keeps, and version the message structure from the first release.
Once the publish step is stable, the partner-side subscriber can be built against a fixed contract. Confirm which partner account and owner the update should touch before the subscriber writes anything, because account ownership decides who sees the change in the first place. The partner manager account ownership rules set out that ownership side of the design.
Handle late events on the partner side
Late delivery is the normal case for a subscriber that was offline, slow, or busy with a retry. It can receive a status event well after the order has moved on. The partner should not treat the last event it read as the current status. It should compare each incoming event with the state it already holds and skip any event that is older.
The subscriber follows this sequence:
- Store the event time from the payload on the partner’s order record, not just the time the message arrived. Arrival time reflects queueing and network delay.
- Apply a status change when its event time is newer than the stored one. Discard an older event and log the discard.
- When an event arrives for an order the partner has not created yet, hold it in a queue and retry the match after a short interval, rather than dropping it.
- Set a limit on how long a held event waits. Send what is left after that limit to an exception list that a person reviews.
The stale-update check should sit in the same place as the write, so that a retry of an old message cannot overwrite a newer status.
Plan replay windows and subscriber gaps
Replay windows limit how far back a subscriber can recover from the channel. Confirm the retention period on your instance and release before you size a recovery plan, because it sets the longest outage a subscriber can recover from without a reconciliation.
Do not design on the assumption that the publisher will notice an offline subscriber. A critical status event can be lost if a subscriber is down for longer than the replay window. The main safeguard is a scheduled reconciliation that compares order status on both sides. The reconciliation is a safety net for gaps, not a replacement for the event stream.
If the integration uses outbound messages rather than events, confirm their retry and failure behavior on your release and define the notify and fail steps in exception handling before go-live.
Manage ordering, repeats, and conflicting updates
Do not treat delivery order as a guarantee, even for events from a single source. A status event from the warehouse and one from billing can cross on the way to the partner, so use the event time described above to stop an earlier stage from overwriting a later one.
Plan for repeated messages in the partner design. Write the update so that applying the same event twice leaves the record unchanged. Test this in your own environment, because the handling of repeats is a responsibility of the subscriber.
Concurrent writes add a further risk. If the partner writes back to the order while an event is being processed, the two updates can conflict. Decide which system owns the status field, and let that system alone write it. Other systems should read the field and raise a change request when they disagree.
Budget API calls before you commit to a polling replacement
Events reduce polling traffic, but they do not remove API usage. Each subscriber callout, each write back, and each reconciliation query draws on the same request limits. Estimate the calls needed per order, multiply by daily order volume, and compare the total with the allocation for your edition. The API call budget checklist walks through that estimate step by step.
For large one-time extracts, Bulk API 2.0 is a better fit than repeated record calls. Composite APIs help when a single update touches several objects in one request. Keep replicated data to the fields the partner needs, because extra copies add volume and maintenance work on both sides.
If the same status change also crosses into an IT service platform, read the Salesforce and ServiceNow integration boundaries page before you decide which system owns the ticket. Two systems that both own a status field will disagree at some point, and the boundary decision prevents that.
Questions about order status events and partner timing
Should a partner ever poll for order status?
Yes, in a narrow case. Polling fits a source that cannot publish events, or a status that changes in scheduled batches. Poll on an interval that matches the batch, and keep the same stale-update checks described above.
Does a platform event publish itself when a status field changes?
No. Platform events are not published automatically. An Apex class or a Flow has to publish them, so the automation that detects the status change is part of the build.
What happens if a subscriber was offline for longer than the replay window?
Events outside the replay window cannot be recovered from the channel. Run the reconciliation query to rebuild the missing status values, and confirm the replay period on your instance before you rely on it.
Does an event replace a response that a user is waiting for?
No. Events do not guarantee a response time, so any user action that needs an answer keeps a synchronous call. The event then handles the follow-on updates.
Which timestamp should decide that an event is newer?
Use the event time that the publisher writes into the payload, backed by the version number. The arrival time at the subscriber reflects queue and network delay and is a weak basis for ordering.
For help planning this work, see Salesforce implementation.