Platform event is based on Event-driven architecture. Unlike request-response communication models, software architecture built on an event-driven model decouples event producers from event consumers, thereby simplifying the communication model in connected systems.
Platform events enable the flow of event messages within Salesforce and to or from external apps.
Platform events cannot be updated or deleted or view records in the SF user interface.
Platform events can be published using Apex, REST API, flows, and processes. Also, you can subscribe to platform events using Apex triggers, flows, processes, a Lightning component, and a CometD-based tool.
Platform event supports below field types:
- Checkbox
- Date
- Date/Time
- Number
- Text
- Text Area (Long)
Salesforce stores high-volume platform events for 72 hours in the event bus.
Platform events that are defined with the Publish After Commit publish behavior are transactional and can be rolled back, but those defined with the Publish Immediately publish behavior are not and cannot be rolled back. Note the following differences in behavior.
If your app is on the Salesforce platform, you can publish events using an Apex method or with declarative tools, such as Process Builder or Flow Builder. If your app is an external app, you can publish events using Salesforce APIs.