Conversation Node - Triggers


Overview


Trigger helps you to integrate chat bot with different services through REST API's. Check the triggers documentation to know more about building a trigger. This section provides information on how you can consume triggers in your conversation.

Example:
You have collected all the required information from end user to compute motor insurance premium. You would now like to consume the trigger in one of the conversation node.

Let's say that you want to compute insurance premium for 1, 2 and 3 years. The backend system has REST API, which you need to call 3 times one for computing single year premium, another for computing 2 years premium and third for computing 3 years premium.

Then you would select a message node, add bot message "Please wait while we process your request and offer the best premium for 1, 2 and 3 years" and add the first trigger to your message node.
Then you could select another message node and just add trigger without adding any message for computing the premium for 2 years and so on.

Trigger Node


Tip: Trigger can be combined with intent, input parameters and message type nodes.

Tip: Trigger when getting consumed as part of message type node, then the Bot Say's becomes optional and you can actually created a Trigger only node.

Tip: Trigger can't be combined with condition based nodes.

Node Name


Name your node corresponding to the information or action required by the user.

Bot Say's


Add the relevant information that you would like to show the end user. The bot message is displayed first before the trigger is executed.

Tip: Trigger is always executed last in sequence. So if you are consuming trigger with Intent, then first the intent is idenfitied, bot message is displayed and then the trigger is executed.

Tip: When combining trigger with input parameters, the bot message is displayed first, the user input is collected and then the trigger is called and executed

Trigger Name


This field identifies the name of the Trigger. You can create a new trigger by clicking on "+" icon.

Message While Trigger API Calls


This allows you to define a message you can convey to the user while the trigger executes. This helps to inform the user about the process in progress and keeps him engaged.

Trigger execution


Trigger has input variable, these are typically consumed by GET parameters and body details. Trigger relies on conversation to provide appropriate information in those variables. Trigger also uses input variables for validation of the trigger response, if the user wants to do any validation. Trigger provides output variables, in which valuable information is stored like motor insurance premium that would be consumed by the conversation and displayed to the user to take some action on the same like purchase insurance.

Trigger Success and Failure


A Trigger is successfully when it meets the following criteria

  • 200 OK HTTP Status code is received
  • Under Status tab, all the status key and value comparison has yielded TRUE
  • Under Validation tab, minimum number of validations are TRUE
  • All the keys mentioned in Response Keys are present in the response body

If any of this fails then the Trigger has failed and the conversation would be handed over to the manual agent, if handover to manual agent is enabled during deployment.