Flows can be subscribed to platform event messages. When platform event messages published through Apex, APIs, flows, and other processes are received, the Platform event triggered flow will be launched.
What are platform events?
- Platform events are part of Salesforce’s enterprise messaging platform.
- The platform provides an event-driven messaging architecture to enable apps to communicate inside and outside of Salesforce.
- Platform events are the event messages (or notifications) that your apps send and receive to take further action.
- They simplify the process of communicating changes and responding to them without writing complex logic.
- Publishers and subscribers communicate with each other through events. One or more subscribers can listen to the same event and carry out actions.
Read more about platform events Platform Events Developer Guide | Salesforce Developers
Custom platform events
We can define a custom platform event in Salesforce in the same way that we define a custom object. Create a platform event definition by giving it a name and adding custom fields. Platform events support a subset of field types in Salesforce.
To create a new event, click on the ‘New Platform Event’ button.
We can create custom fields for the platform event in the same way as we create custom fields for an object. These fields are used to store data we receive from the platform event message. The platform event in salesforce will capture the event messages and the purpose of the platform event triggered flow is to subscribe to those events and make necessary changes in the org.
To create a platform event–triggered flow, choose a platform event of which the event messages trigger the flow to run.
All the standard and custom platform events will be listed here. We have to choose the desired one.
Build the business process of your requirement by adding necessary elements. Save the flow and Activate it. The flow is now ready to get triggered for every notification of the subscribed event.
- Suppose a web application connected with salesforce is publishing certain event notification and it should be made available to some chatter groups in salesforce. We can create a flow which will be triggered whenever the website publishes an event. The event message will then be posted to the chatter group.
- A web application captures the details of leads and verifies their background information. The details will be then send to salesforce and an account and contact need to be created in salesforce. The web application uses publisher subscriber model and publish an event with details. We can create a flow which subscribe to this event and build the business process to create an account and contact. When ever an event notification is received, the flow will be triggered. An account (if not existing) and an associated contact also will then be created.
Looking for more use cases to build using Platform event triggered flows, leave us a message.
Take Five Consulting is a technology company, based in Virginia U.S., that specializes in the Mortgage Banking vertical especially LOS implementation and application development. Take Five Consulting creates and implement mortgage technology and software specifically for Mortgage Industry.