How to design a canvas scenario
This topic describes how to design a conversation flow.
Scenario description
Bot: Dear Customer [xxx], please rate my service. You can say "satisfied" or "not satisfied".
User satisfaction:
User: Satisfied.
Bot: Thank you for your positive feedback. The call will now end automatically.
User dissatisfaction:
User: Not satisfied.
Bot: Thank you for your feedback. We will continue to improve our service. The call will now end automatically.
Steps
Step 1: Set the start intent
Select a standard node to add a new node after it. You can add the new node in two ways:
1. Add a new node using the arrow.

2. Drag it below the arrow from the start node.

Click the User Branch-1 branch. Select Condition Trigger, choose a condition from the condition group, and then select New Intent.
A scenario can contain multiple conversation flows, but only one can be the main flow. The flow that contains the start intent is the main flow. When the bot makes an outbound call, it starts with the message from the response node under the start intent. The start intent acts as the default intent.


Enter the intent name and intent code.

Select Edit Intent.

In the User Utterances section, add "Start".
Step 2: Set the opening message
In the response node that is connected under the start intent, set the opening message that the bot will play to the user.
Set the node name.
Set the response content to: `Dear ${envVars['VENDOR_PARAM']['name']}, please rate my service. You can say 'satisfied' or 'not satisfied'.`
`${envVars['VENDOR_PARAM']['custom_field']}` is an in-band parameter. You can pass custom parameters into the canvas to be played to the user. For example, in this scenario, you can set `name==John Doe`. The message played to the user will be "Dear John Doe". You can upload custom fields for an outbound call task using an Excel file or an API.
Step 3: Set the 'satisfied' branch and response
Set the intent and response for the 'satisfied' branch.
Select the opening message node, and then select New > User Says > Branch.

Select Intent Trigger, select New Intent, and change the branch name to 'Satisfied'.

Enter the intent name and intent code, and then click Create.

Set up the 'satisfied' node.
Add a standard node after the 'satisfied' branch. You can name this node 'Satisfied Node'.

Note:
An intent represents what a user says. The user's utterance is matched against the intents that you configure. When an intent is triggered, the flow moves to the corresponding response node. If the user's utterance does not match any intent, the bot uses the non-recognition settings from the previous response node or the global non-recognition settings.
You can use both user utterances and utterance templates to recognize user intents:
User Utterance: Satisfied
Utterance Template: `.{0,5}Satisfied.{0,5}`
Difference: If you use a user utterance, what the user says must be very similar to the configured utterance to be recognized. If you use an utterance template, the recognition is more flexible. For example, with the User Utterance configuration above, if a user says "I am very satisfied", it will not be recognized. The user must say "Satisfied" to trigger the 'satisfied' response. If you use the Utterance Template, any phrase that contains "satisfied" will be recognized.
NoteFor more information about designing query rules for query templates, see LGF query configuration.

Step 4: Set the 'not satisfied' branch and response
Set the 'not satisfied' branch and response in the same way as you did in Step 3.
Step 5: Set the call to end automatically after the message
To end the call automatically after the message is played, add the Hang Up action in the Subsequent Actions section of the response node.
Step 6: Output the customer's intent to a report
To output the customer's intent to a report, for example, to report which customers were satisfied and which were not, use the following setting: In the response node that is triggered by the intent, add a Variable Configuration action in the Subsequent Actions section. Make sure to select Output to Report.
The variable can be a custom static field or a parameter variable.


The following figure shows an example of the result.
Step 7: Test the flow in the test window
Test using the text chat window
If you use in-band parameters, you can test them with variable simulation. For example, to test the message "Dear Customer xxx", you can simulate the variable for "xxx". In the canvas, use the variable `${envVars['VENDOR_PARAM']['custom_field']}`. You can test this custom field using variable simulation. For example, to display "Dear John Doe", use the variable `${envVars['VENDOR_PARAM']['name']}` in the canvas and set `name=John Doe` in the simulation.


Test using the softphone panel
Local testing with the softphone is supported. You must grant microphone permission for your browser. If you use variable simulation, you must re-enter the simulated variables when you switch from the text window to the softphone.



Step 2: Set the opening message
Step 3: Set the 'satisfied' branch and response



Step 5: Set the call to end automatically after the message
Step 6: Output the customer's intent to a report