Fix Guide

How to Fix Salesforce Platform Events Not Firing or Not Received

Step-by-step fix guide with AI-powered diagnosis from BuildForce.

Salesforce Platform Events fail across the publish-deliver-consume pipeline: EventBus.publish returns success but the event never enters the bus when the publisher lacks Publish permission on the event, subscribers miss events when the CometD client's replay ID is set to -1 (current only) and the publish happened during reconnection, daily event delivery caps silently drop events beyond the org's allocation, and Apex triggers on platform events fail silently when they hit governor limits (the failure isn't reported back to the publisher). The fix requires checking EventBus.publish results, replaying from a known replay ID, and monitoring daily event capacity.

Publish PermissionReplay ID -1 vs -2Daily Event CapTrigger Silent Failure

Symptoms

EventBus.publish returning success=true but no subscriber receives the event

CometD subscriber receiving events for 5 minutes then going silent indefinitely

Replay ID gaps in subscriber logs (jumps from 1000 to 1050)

Some events received, others lost, with no obvious pattern

Platform event triggers running once then never again after a deploy

Change Data Capture events for some objects firing but not others

Root Causes

1

Publisher lacks Create permission on the platform event

Platform events require Create permission on the event sObject. A user without Create returns success from EventBus.publish (the call succeeds locally) but no event enters the bus. This is the single most common silent failure.

2

Subscriber connected with replay ID -1

Replay ID -1 means 'subscribe to new events only'. If the subscriber disconnects and reconnects with -1, any events published during the disconnect window are lost. Use -2 (subscribe from earliest stored event) for recovery, or store the last received replay ID and resume from that.

3

Daily event delivery cap exceeded

Each org has a daily Platform Event delivery cap (50,000 default, higher with add-ons). High Volume Platform Events count delivered notifications across all CometD subscribers. Beyond the cap, events are dropped without backpressure to publishers.

4

Platform event trigger hitting governor limits

Apex triggers on platform events run in batches of up to 2,000. If the trigger hits SOQL or DML governor limits, the batch fails. The event is retried up to 9 times then moved to dead-letter — if no DLQ handler exists, the events are lost permanently.

5

Change Data Capture channel mismatch

CDC events for object X arrive on the /data/X__ChangeEvent channel. Subscribing to /data/ChangeEvents (the wildcard) receives all CDC traffic but requires 'Subscribe to All Change Events' permission. Without it, subscriber silently receives nothing on the wildcard.

How to Fix It — Step by Step

1

Confirm publish succeeded with full result inspection

EventBus.publish returns Database.SaveResult[]. Don't just check success — log errors[] on each result. A user without Create on the event still gets success=true from the publish call but errors[] contains the access violation.

Example
List<Order_Created__e> events = new List<Order_Created__e>{ new Order_Created__e(Order_Id__c='123') };
List<Database.SaveResult> results = EventBus.publish(events);
for (Database.SaveResult r : results) {
  System.debug('Success: ' + r.isSuccess());
  if (!r.isSuccess()) {
    for (Database.Error e : r.getErrors()) System.debug(e.getStatusCode() + ': ' + e.getMessage());
  }
}
2

Verify publisher has Create permission on the event

Platform events require Create access. Check the running user's profile or permission sets for Create on the event sObject. Add via a permission set; profile-level Create grants Publish system-wide for events the profile defines.

Example
SELECT Field, PermissionsCreate, PermissionsRead 
FROM ObjectPermissions 
WHERE SObjectType = 'Order_Created__e' 
AND Parent.ProfileId IN (SELECT ProfileId FROM User WHERE Id = '[publisher_user_id]')
3

Switch CometD subscriber to use stored replay IDs

Subscribe with -2 initially to drain stored events (up to 72 hours), then store the last replayId on every received event. On reconnect, subscribe from stored replayId + 0 (resume after that event).

Example
// CometD subscription with replay
const replay = { '/event/Order_Created__e': lastReplayId || -2 };
cometd.addExtension('replay-extension', new cometdReplayExtension(replay));
4

Monitor daily event delivery against the cap

Setup → Platform Events → Usage shows current 24h delivery count vs cap. Salesforce Limits API also exposes DailyDeliveredPlatformEvents. Alert at 80% to throttle publishers before drops start.

Example
GET /services/data/v59.0/limits
// Look for DailyDeliveredPlatformEvents.Max and DailyDeliveredPlatformEvents.Remaining
5

Bulkify platform event triggers and add error handling

Platform event triggers receive batches of up to 2,000 events. Ensure no SOQL/DML in loops. Use EventBus.TriggerContext.currentContext().setResumeCheckpoint() to mark progress so partial-batch failures retry from the checkpoint instead of the start.

Example
trigger OrderCreatedTrigger on Order_Created__e (after insert) {
  EventBus.TriggerContext ctx = EventBus.TriggerContext.currentContext();
  for (Order_Created__e e : Trigger.new) {
    try {
      // process e
      ctx.setResumeCheckpoint(e.ReplayId);
    } catch (Exception ex) {
      // log to dead-letter sObject
    }
  }
}
6

Configure dead-letter handler for failed event batches

After 9 failed retries, Salesforce moves events to a failure queue accessible via EventBus. Create a sObject 'Failed_Event__c' and write a dead-letter handler that captures the event payload for manual replay.

7

Audit CDC channel subscriptions for permission gaps

If you subscribe to /data/ChangeEvents (wildcard), the user needs 'Subscribe to All Change Events' permission. Without it, subscription succeeds but zero events arrive. Either grant the permission or subscribe to specific channels like /data/Account__ChangeEvent.

Let BuildForce diagnose and fix this automatically

Instead of following manual steps, connect your org and let our AI identify exactly what's broken and how to fix it — in minutes.

Book a Demo

Common Questions

More answers about this issue and how to resolve it.

Stop debugging manually. Let AI do it.

BuildForce runs 200+ automated checks across your Salesforce org and tells you exactly what's broken and how to fix it.