Subscribe to Platform Event Messages with Processes

Processes built in Process Builder can subscribe to platform events and receive event messages published through Apex, APIs, flows, and other processes. Processes provide an autosubscription mechanism.

To subscribe a process to a platform event, build the process to start when it receives a platform event message. In the process’s trigger, associate the process with a platform event and an object.

Example

This process starts when it receives a Printer Status event message. When it starts, the process looks for an Asset record whose serial number matches the serial number in the event message. Sample process trigger

Process and Platform Event Considerations

If platform event–triggered flows, paused flow interviews, and processes are subscribed to the same platform event, we can’t guarantee which one processes each event message first.

A process evaluates platform event messages in the order they’re received. The order of event messages is based on the event replay ID. A process can receive a batch of event messages at once, up to a maximum of 2,000 event messages. The order of event messages is preserved within each batch. The event messages in a batch can originate from multiple publishers.

Each event process runs asynchronously in a separate transaction from the transaction that published the event message. As a result, there can be a delay between when an event message is published and when the subscribed flow or interview evaluates the event message.

Debug logs corresponding to the process execution appear under the Automated Process user. But the process actions run in the context of the user who published the event message. So, for example, if a process creates or updates records, system fields like CreatedById and LastModifiedById reference the user who published the event message.

All processes are subject to entitlements, limits, and other considerations, including Apex governor limits.