Transactional Dialogs
In this article we'll introduce the concept of transactional dialogs in Conversational AI Cloud and what it means for a developer to work with them.
Introduction
Conversational AI Cloud offers transactional dialogs as a way to actively request data from end-users. A transactional dialog is a linear flow that consists of one or multiple steps, and an end-slot that wraps up the dialogs flow.
Integrating External Systems and Data
External systems can be integrated through validation and transaction web hooks within transactional dialogs. You can learn more about the flow of transactional dialogs here
What Does A Transactional Dialog Consist Of?
Transactional Dialogs are linear flows that customers can use to actively ask for data points on their end-users to achieve a particular goal, like getting data from or changing data in a CRM, OMS, or ERP. It consists of one or multiple slots and a single end slot.
Each slot (aside from the end slot) can have:
- A missing value output message, provided in the conversation when asking the end-user to provide input for the slot e.g., "What's your first name".
- An error output message, provided in the conversation when validation of the value provided by the end-user fails e.g., "Please provide your e-mail address in the following format...".
- An ok output message, provided in the conversation when the value provided by the end-user is accepted by the system e.g., "Thank you for providing your e-mail address".
- One or multiple quick replies.
- An input pattern.
- Validation through either a web hook, or a regular expression.
- Linked conversation variable.
- Any relevant additions (metadata) that need to be passed along to the optional validation web hook, or returned by the Conv. AI Cloud API.
An end slot consists of the following values:
- A missing value output message, provided in the conversation when asking the end-user to provide input for the slot e.g., "What's your first name".
- An error output message, provided in the conversation when validation of the value provided by the end-user fails e.g., "Please provide your e-mail address in the following format...".
- An ok output message, provided in the conversation when the value provided by the end-user is accepted by the system e.g., "Thank you for providing your e-mail address".
- Transaction script (web hook) to process all of the data requested throughout the transactional dialog.
- Transaction end event that can be triggered by the caller of the Conv. AI Cloud API to continue the conversation once the transactional dialog is finished.
- Any relevant additions (metadata) that need to be passed along to the optional validation web hook, or returned by the Conv. AI Cloud API.
Aside from that transactional dialogs offer two types of web hooks:
How Does It Work?
As stated before transactional dialogs are a linear flow that customers can walk through. However, when working with web hooks it is possible to pre-fill slots in the transactional dialog based on what you may already know about your end-user. For example, if you already know your end-users postal code (because you may have captured it through a conversation variable) there's no need to ask for it again. For this reason, each unfulfilled transactional dialog slot (with a validation web hook defined) will be evaluated in parallel.
Web Hook Evaluation
Validation web hooks are evaluated in parallel, meaning that they'll all get called at the same time every time user input is provided during dialog evaluation. Slots that already have a filled value will not have their web hook called.
The diagram above describes a situation where we have a transactional dialog with 2 validation slots and an end slot. Whenever the end-user triggers the transactional dialog Conv. AI Cloud will call both validation web hooks configured on the transactional dialog slots. If one of them returns a valid value, the end-user will not be prompted with the question to fill out that slot.
Every time the end-user provides input during the evaluation of the transactional dialog all validation web hooks are called in parallel for every slot that does not have a value set yet.
Once all slots are assigned a value the end slot transaction web hook will be called. This web hook can then decide to reset specific slots, or finalise the transactional dialog depending on the logic implemented in the web hook. The transaction web hook receives all data received throughout the transactional dialog to decide whether or not the dialog is finished.
Transactional Dialog Events
For every transactional dialog you can choose to attach an event to the end slot of the transactional dialog. This event will be returned to the caller of the gateway API in the response from Conversational AI Cloud. The caller can then decide to trigger the event through the events endpoints on the gateway API to continue the conversation with the end-user as the conversation designer intended.
Updated almost 2 years ago