Newer Version Available

This content describes an older version of this product. View Latest

Get the Status of Asynchronous Platform Event Publish Operations (Pilot)

Track which high-volume platform events were published successfully and which events failed, and take the necessary actions. To get notified of the status of event publish operations, enable status events on your high-volume platform event. Then subscribe to the PublishStatusEvent standard platform event with Apex triggers or CometD clients.

We provide Publish Status Events to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Publish Status Events isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for Publish Status Events in the Trailblazer Community.

Note

You can get a confirmation of the enqueued publish operation without this pilot feature, but you don't know whether the operation succeeds eventually. A status of success in the returned SaveResult means that the publish operation is queued in Salesforce. The operation is carried out later when system resources are available. Some failures are returned in the immediate SaveResult, such as validation or limit errors, but not the asynchronous errors. In rare cases, enqueued publish operations can fail due to a system error. The benefit of this pilot feature is that you can find out about the eventual status of enqueued publish operations and perform appropriate actions.

Enable Publish Status Events

To enable receiving publish status events for your platform event, in Setup, click Track publish status on the event's definition page. Or in Metadata API, set the enablePublishStatusTracking field on CustomObject to true.

Event publish results are batched in a PublishStatusEvent and grouped by the status and topic, which is the event API name. A PublishStatusEvent doesn't necessarily correspond to one publish request. It contains results of one or more requests that are for the same platform event and have the same publish status. PublishStatusEvent can hold up to 100 publish results. Each PublishStatusEvent includes an array of PublishStatusDetail child objects containing information about each event publish operation.