Newer Version Available

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

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

High-volume platform events are published asynchronously. With publish status events, you can track the status of publishing operations and take the necessary actions. Enable status events on the high-volume platform event you are interested in tracking. Then subscribe to the PublishStatusEvent standard platform event.

As a beta feature, Publish Status Events is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Publish Status Events in the Trailblazer Community. For information on enabling this feature in your org, contact Salesforce.

Note

You can get a confirmation of the enqueued publish operation without this feature, but you don't know whether the operation eventually succeeds. A status of success in the immediately 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 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 status events 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 high-volume 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.