This tutorial will show you how to quickly create a simple alexa conversation flow on Flow Designer with Basic Conversation Mode.
Make sure you create project with Custom Skill template with
Note: Creating a new project with template automatically populates the Flow designer with some prerequisite nodes to kickstart your conversations.
2. Open Flow Designer
Upon opening the Flow designer you will see some the prerequesites nodes for conversation are already populated.
3. Open Settings Node
You will see the Advanced Mode is disabled. This tells you are in Basic Conversation Mode. Click on Done.
4. Open User Says: Launch Node
You must select the Launch or Welcome in order to handle the Launch request from the user or when user invokes/starts your skill.
You can provide the some Utterances which user might say, by selecting the Utterances option in User Says Node.
Moreover, we have provided some pre-defined options which user usually says, like:
- Yes: To handle when you expect user will says like, YES
- NO: To handle when you expect user will says like, No
- Cancel: To handle when you expect user will says like, Cancel. Do not place more than one.
- Help: To handle when you expect user will says like, Help. Do not place more than one.
- Stop: To handle when you expect user will says like, Stop. Do not place more than one.
- Launch or welcome: To handle when you user invokes or start your skill. Do not place more than one.
- Exit: To handle the session end request from Alexa. Do not place more than one.
- Unhandled: To handle the unhandled scenarios.
5. Open on Alexa-in Node
Here you don’t need to provide any settings or Interaction model or schema.
Click on Done.
6. Open Message Node, yellow colored
- In this node you can place a Reply/Response Message which will be passed to the user at the end.
- Inside the Message Node you can also provide SSML response.
- You can also more than one version of message, only one of them will be selected and passed as response to the user.
- Note: When adding SSML, please do not include the <speak> tag in the message.
7. Place the Respond Node
Drag the Respond Node from Palette Section to Canvas Section and place just after the Message Node, finally connect the output of Message Node to the input of Respond Node.
As the name suggests, this node helps in passing/sending the any type of response to the user.
Response to the user can be happen in two ways: - Request User Input - No
Here Alexa tells something to user and do not expect reply from user.
In this case the Output of the Respond Node is closed. So you can’t attach another node next to this.
Note: when set to NO, Alexa ends the session with the user. - Request User Input - YES
Alexa says something to the user and expects some input/reply from the user.
In this case the output port of the Respond node is Opened. So next time when user replies to the Alexa, the incoming request from Alexa will be automatically forwarded to next connected node.
Note: when set to YES, Alexa do not end the session, instead continues the session with user.
On the previous Message Node, we were asking user for ordering food. So for the sake of our tutorial, we have to set the Request User Input to YES
8. Place User Says Node and attach next to Respond Node
Add some food menu as user utterances in the “User Says: Food Menu”
9. Place Message Node
Drag and place Message Node next to the User Says Node, as shown
Here Alexa will ask the user to “Confirm the order”?
10. Place Respond Node
Send the response to the User by adding the Respond Node next to the Message Node.
Here we are asking for the “Confirmation”, so we need to set Request User Input - Yes in Respond Node.
11. Place User Says Nodes
Drag and place the User Says Nodes next to the Respond Node
In order to handle weather user says Yes to confirm order, or No to cancel the order. We need to use Yes and No within User Says Node.
Double-click the upper User Says Node and set the User says to Yes.
Double-click the lower User Says Node and set the User says to No.
12. Place Message Node
To reply user confirmation or cancellation, we need to place the Message Nodes next to User Says node
13. Add Respond Node
To finally response to the user
Congratulations! You have successfully completed your first project.
You are now just only one step away from completing your Alexa Skill.