Triggering Flows
A flow is triggered in response to a customer request or action. Previously, if you wanted to trigger a flow with Events, you were required to either start your flow with an Event Trigger or add an Event Reply after the first trigger. To make the process of triggering flows easier, you can now directly trigger a flow with event replies, buttons, and quick replies.
Additionally, you can trigger a specific flow from Code Actions and Webhooks. This approach reduces the development time and enhances the user experience.
Event Replies
Pre-requisites- You need to create a separate flow to be able to trigger the flow using the Event Replies.
To trigger flow using the Event Replies:
- Create a flow.
- Drag any trigger to the canvas.
- Drag an Event Reply to the canvas.
- In the Event panel, open the Trigger Type menu and click Flow.
- Select the flow to be triggered from the Flow Name menu.
- Click Save.
Buttons
Pre-requisites- You need to create a separate flow to be able to trigger the flow using Buttons.
To trigger flow using Buttons:
- Create a flow.
- Drag any trigger to the canvas.
- Drag a Button Reply to the canvas.
- In the Button panel, enter the Title.
- Click Add and enter the button name in the Label field.
- Select Trigger Flow in the Trigger Type window.
- Select the flow to be triggered from the Flow Name menu.
- Click Save.
Quick Replies
Pre-requisites- You need to create a separate flow to be able to trigger the flow using Quick Replies.
To trigger Flow using the Quick Replies:
- Create a flow.
- Drag any trigger to the canvas.
- Drag a Text Reply to the canvas.
- Enter a message in the Add text response field.
- In the Quick Replies section, click ADD QUICK REPLY.
- Select Trigger Flow in the Send Text menu.
- Select the applicable flow in the Flow menu.
- Enter the button name in the Label field.
- Click Save.
Webhooks
To trigger Flow using Webhooks, copy the Flow immutable ID and paste it into the Code Action:
const replyBody = {
verifyToken,
flows: [{
flowImmutableId: 'fQ2Heilnc'
}]
}
Code Action Example
To trigger Flow using a Code Action, copy the Flow immutable ID and paste it into the code action. Update the Call Back URL in the Webhook window.
async payload => {
try {
trigger({
type: 'flow',
flowImmutableId: 'fxA2ExdQF'
})
} catch(err) {
console.error(err)
}
}
Try it out
To trigger a flow from the Try it out window:
- In the Try it out window, click the flag icon.
- Select Trigger Type Event from the drop-down menu.
- Select the applicable flow from the Flow menu.
- Click SEND.
Read more about Khoros Flow Triggers and Replies.
Updated about 1 year ago