With platform event–triggered flows, you can do all your automation in one place. Users can trigger a Flow when a platform event message is received. Unlike Process Builder, users can access all available records when a Flow is invoked by the platform event message. Previously, platform event–driven automation required you to use Process Builder and Flow Builder.
Platform event-triggered flow launches when a platform event message is received. This Auto launched flow runs in the background.
What is Platform Event ?
Platform Event is based on Event-Driven Architecture which enable apps to communicate inside and outside of Salesforce. Platform events are based on the publish/subscribe model and work directly with a message bus which handles the queue of incoming events and processes listening for them. This is built in real time integration patterns in the Salesforce Platform which helps to reduce point-to-point integration.
Learn more here about platform event.
Create Platform Event Flow in Salesforce
In this session we will talk about why we should use Platform Event Trigger flow and how to create platform event flow in Salesforce.
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 flow can receive a batch of event messages at once, up to a maximum of 2,000 event messages
- Debug logs for platform event–triggered flows and resumed flow interviews appear under the Automated Process user
Yeah! You know the way to go with that Platform Event-Triggered Flow now. Read more blogs and find out about other flow types too.
I hope this helped you
There are some omissions and concerns here:
1. The video suggests using a custom label to hold configuration. This is very bad practice – this is what custom metadata types (or custom settings) are for. Custom labels are only for localisation and are designed to vary by user locale.
2. This entirely fails to mention that the flow executes in the context of the initiating user, which is entirely different to the behaviour of an apex trigger platform event subscriber. This has an impact on how all elements in the flow behave, with the up-to-2000 event records being processed in chunks based on the originating user. I was very surprised to see Automated Process user used for debug logs in the video; are you certain this is the case?
3. The video suggests using chatter notifications instead of Salesforce notifications. The latter make a lot more sense in the Lightning UX.
4. The video uses a long form for creating the platform event and initializing the fields; these could easily have been passed to the event construction to make the code shorter without losing any meaning.
5. The video seems to abuse the batch error event mechanism (we are not using batch here) in a very strange manner, always creating a record that is then deleted on a double fault.
Thanks phil for your feedback
1) We agree metadata is solution. As this for fresher so we just cover the custom label concept.
2) Need to check with speaker
3) I was just a demo to explain the basic concepts.
Once again we only explain the basic concept of Platform event. Were not trying to resolve the best practices.
We appreciate all your feedback but we also stand with our speakers. Your all points are valid
Amity, the problem with taking shortcuts for intros, like with custom labels, is that it teaches bad practice to novices who know no better and will keep on using it. Better to simply hard code it and then mention there are better ways to define per-org configuration.