OBLYTECH Logo
OBLYTECH Logo

Event-Driven Case Updates to Partner Systems

A case status change belongs on a partner event feed when a second platform must react soon after it happens and a nightly batch would be too late. Publish the transitions the partner acts on, carry them with Platform Events or Change Data Capture, and have the partner apply each update by record version so a late message cannot overwrite a newer status.

Decide whether a case change should leave Salesforce

Not every case update needs to be sent as an event. Events suit cases where a partner platform must show the current status to its own users, start a task, or close a loop without someone running a report. If the partner only needs a daily summary, a scheduled export is simpler to build, test and support.

A synchronous pattern fits better when an agent is waiting for the partner’s answer before they can continue. A publish-and-forget event tells the partner something changed, but it does not return a result. In that case a request and reply call gives the agent what they need.

Before committing to events, review the case process with the people who own it. Confirm the business reason for each trigger, check whether the partner platform can receive events at all, and estimate the partner-side effort if it cannot. A needs assessment and discovery session is a good place to build this list, and the output should name each trigger alongside the partner that consumes it.

Choose which case status changes become events

Start with the transitions a partner acts on. Escalation, a move into a waiting state that your team defines, case closure and an owner change are common examples. Edits to internal notes and to fields the partner never reads rarely justify an event, and each extra event adds volume to monitor and a failure mode to handle.

For each trigger, write down four things before any build starts:

  • The exact condition that fires the event, such as a status value moving from one named value to another.
  • The fields the payload must carry for the partner to act.
  • The partner system and the team that owns its receiving logic.
  • The action the partner takes on receipt, and what it should do if that action fails.

Tie triggers to the stored field value rather than to a button click or a single screen. A bulk update, an automated flow and an integration user all change the same status field, and the event should fire the same way for each of them. Otherwise the partner receives events for some changes and not others, which is hard to diagnose later.

Pick Platform Events or Change Data Capture for the feed

Platform Events are custom messages you define, and a flow or Apex code publishes them. You control the field names and the message contract. Change Data Capture publishes changes to records without a message you define, so it usually takes less build work, but the message follows the record’s shape rather than a contract you designed for the partner.

For a partner that needs a stable, named contract, a custom platform event usually gives more control over versioning. For a partner that already expects record-shaped changes, Change Data Capture may reach production sooner.

Plan around the replay window and payload size limit for each feed type you choose. Those are specific settings that depend on the feed type and the release your org runs, so confirm them before you size batches or decide how long a partner can be offline and still catch up. Outbound Messages have their own delivery behavior, which also needs checking before you pick them for a trigger.

Design the event payload so the partner can apply it safely

A payload should carry enough to identify the case, state what changed, and let the partner judge whether the change is newer than what it holds. Include the case identifier, the external case number the partner stores, the new status, the time the status changed, a record version or last-modified value, and the owner reference. Leave out internal notes, personal data the partner does not need, and any field it cannot act on.

Setting up the identifiers is the part teams most often skip. Work through these steps before go-live:

  1. Create the external case number on the partner side and map it to the Salesforce case identifier. Store the mapping before the first event is published.
  2. Publish the event from the status change, using the trigger condition you documented earlier.
  3. Have the partner store the highest version it has applied for each case, along with the time that version was applied.
  4. Record every rejected or skipped message in a log that someone reviews, rather than dropping it silently.

Identifier mapping overlaps with the wider migration work. If the partner already holds case records, the mapping is usually built during that migration, so the data migration and integration plan is the right place to settle the keys before events start.

Handle updates that arrive out of order on the partner side

Do not assume events arrive in the order the status changed. A feed that draws from more than one source system, or a partner that retries a message, can deliver a newer status before an older one. The partner must decide what to do when that happens.

Compare record versions before writing

Keep the highest version applied for each case. When an event carries a lower version or an earlier timestamp than the stored one, write it to the log and skip the update. This one rule prevents a late message from moving a case back to an earlier status, which is often the first failure partners notice.

Make writes idempotent with an external key

Upsert the partner record on the external case number rather than inserting a new record. A replayed message then updates the record it already created instead of adding a duplicate. Repeated delivery stops being a problem for the data, though it still shows up in volume figures.

Decide what to do with a gap in the sequence

If the partner receives version 7 after version 5, version 6 is missing. Two responses work. The partner can hold version 7 for a bounded period and then request the current case state, or it can apply version 7 and log the gap for review. Requesting the current state is the more reliable option when the partner keeps no history of its own, because it resolves the gap instead of recording it.

Stop loops when the partner writes back

When a partner sends an update back into the org, that write can publish a new event, which then reaches the partner again. Break the cycle in two places. Filter out changes made by the integration user in the publish condition, comparing the last-modified-by user against it. Avoid publishing from an Apex trigger on the same object, because a trigger that publishes on its own object can contribute to the loop. Use a flow or a separate code path for the publish step.

Test and monitor the case event flow

Test three sequences before going live: a normal progression through the statuses, a replay of older events after newer ones have applied, and a duplicate delivery of one message. Each sequence should end with the partner record in the state you expect and with the log showing exactly what was skipped or applied.

Cases that arrive without an external number should go to an exception queue rather than being published with a blank key. Data quality problems like this are common when a feed starts, and the Salesforce data quality and migration checks are the place to catch them before events are sent.

Once the feed is live, watch four measures on a regular schedule:

  • Events published compared with events the partner confirms receiving.
  • The number of updates the partner rejected because the version was older.
  • The size of any retry or hold queue on the partner side.
  • The age of the oldest unprocessed message, measured against the replay window.

Someone must own those measures after launch. The ongoing support and maintenance model should name the person who reviews the log and the process for changing a trigger or payload.

For help planning this work, see Salesforce implementation.

Questions about case updates to partner systems

Should every case field change be published as an event?

No. Publish a change when a partner system acts on it. Field edits that only affect internal records add volume and failure points without changing anything on the partner side, so leave them out of the trigger.

Can a partner rely on events arriving in order?

Not reliably, once events come from more than one source or are retried. Treat ordering as something the partner enforces with record versions, not something to assume from the feed.

What happens if a partner system is offline for a day?

The partner can catch up while events remain inside the replay window for the feed type. Measure how long your partner can be offline against that window, and plan a reconciliation request for any gap that runs past it.

Is a scheduled export a safe fallback when events fail?

It can be, provided the export carries the same version field as the events. An export without versions cannot tell the partner which copy is newer, so it can reintroduce the stale-status problem the events were meant to remove.

Which team should own the partner’s version checks?

The team that owns the partner’s receiving logic should own the checks, because they hold the stored versions and the log. The Salesforce team should own the trigger conditions and the payload contract, and the two teams should agree on changes to either before they go live.