From Gerald: Enabling Flow Screens to Respond to Platform Events

You can drop this extension into a Flow Screen and use it to respond to platform events by carrying out flow navigation.

You can refer to this following post Using Flow to Create a Synchronized ‘Co-Work’ Chat Session to have a example of what you could do with this component!

Platform Event

The Platform Event should have at least the following fields :

  • Id => to identify the platform event between agent and customer
  • flowNavigationRequest => allows to control the flow navigation of the flow receiving and reacting to the Platform Event. Possible values are : none, next, back, pause, end.
  • Value1, value2, value3, value4, value5 => example of value the Platform Event will carry out. Note : you can change those fields based on the type of information to carry out.

Permission Set

You need to create a permission set to allow users to create and read the Platform Event created. A platform event is a Salesforce Object and will appear as any other objects in the “Object Settings” section of your permission set. You should assign the proper permission to both internal and external users.

Component

The component has the following attributes:

  • Id => to identify the platform event between agent and customer
  • eventAPIName => the API name of the platform created
  • flowNavigationRequest => When the component receives a platform event, this attributes allows to control the flow navigation. Possible values are : none, next, back, pause, end. Note : The platform event has also an attribute “flowNavigationRequest” that takes precedence over the one in the component.
  • Value1, value2, value3, value4, value5 => example of value the component will be able to retrieve from the Platform Event. Note : you can adapt those attributes to reflect the field created on your Platform Event.

Install

1.0 Unmanaged 11-25 https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1v000002GyT7

Source

The code is available in this github repository