Alexa Advanced Conversation

This tutorial will show you how to quickly create a simple alexa conversation flow on Flow Designer with Advanced Conversation Mode.

1. Create new Project

Make sure you create project with Custom Skill Advanced template.

2. Open Flow Designer

Upon opening the Flow designer you will see some the prerequisite nodes for conversation are already populated.

3. Open Settings Node

You will see the Advanced Mode is Enabled. This tells you are in Advanced Conversation Mode. Click on Done.

4. Open User Says: Launch Node

You need to put property as msg.NLU.intent.name and value set as LAUNCH in order to handle the Launch request from the user or when user invokes/starts your skill.

5. 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 add 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.
  • You can provide messages in two ways: - Typing message directly, or - Via variable in Data Store. For more info See Data Store

6. Open on Alexa-in Node

Here you need to provide any Intent Schema and Custom Slots(If necessary) for Alexa’ Interaction Model.


For more detailed info. on Alexa-in node. See Alexa-in Node

For sake of tutorial, below are the Intent Schema and Custom Slots:
1. Intent Schema
    [
        {
            "name": "FoodMenuOptionsIntent",
            "options": {
                "slots": {},
                "utterances": [
                    "I would like to order some food",
                    "Can i order some food",
                    "What is in the Food menu",
                    "Can you tell me whats in Food menu",
                    "Tell me todays food menu"
                ]
            }
        },
        {
            "name": "FoodOrderIntent",
            "options": {
                "slots": {
                    "FoodItem": "FoodItems",
                    "Quantity": "AMAZON.NUMBER"
                },
                "utterances": [
                    "Order {-|Quantity} {-|FoodItem}",
                    "Please order {-|Quantity} {-|FoodItem}",
                    "Order {-|FoodItem} for {-|Quantity}",
                    "{-|FoodItem}",
                    "Send {-|FoodItem} for {-|Quantity}"
                ]
            }
        },
        {
            "name": "AMAZON.YesIntent",
            "options": {
                "slots": {},
                "utterances": []
            }
        },
        {
            "name": "AMAZON.NoIntent",
            "options": {
                "slots": {},
                "utterances": []
            }
        },
        {
            "name": "AMAZON.HelpIntent",
            "options": {
                "slots": {},
                "utterances": []
            }
        },
        {
            "name": "AMAZON.CancelIntent",
            "options": {
                "slots": {},
                "utterances": []
            }
        },
        {
            "name": "AMAZON.StopIntent",
            "options": {
                "slots": {},
                "utterances": []
            }
        }
    ]
    
2. Custom Slots:
[
	{
		"name": "FoodItems",
		"value": [
			"Pizza",
			"Pasta",
			"BUrger"
		]
	}
]

7. Drag a User says Node from Palette section to Canvas Section

8. Double-click and Open the User Says Node

You need to provide the Intent Name inside the below red box, which you have used in the Intent Schema on Alexa-in Node.
If didn’t provided correctly, then flow designer won’t be able to handle the request from Alexa and invokes the Unhandled.


9. Place a Message Node and attach to User Says Node


Add some Food Menu Items in the Message Node, to tell the menu to the user.

10. 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 or sending the any type of response to the user.


Response to the user can 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.
- For the sake of our tutorial, we have set the Request User Input to YES

11. Drag Switch Node and attach next to Respond Node

Search for Switch node from upper left corner search bar, once found, drag Switch Node and attach next to the Respond Node.


Double-Click on Switch Node, Add the below details.
Add msg.NLU.intent.name as property, add FoodOrderIntent as value and Add new rule for Otherwise by clicking on Add.

When user selects or orders something from provided menu on Alexa, a request with the FoodOrderIntent as Intent will be passed to this Switch Node from the previous Respond Node. Then this Switch Node will forward the FoodOrderIntent request to output port ONE, or else will forward to Otherwise port TWO.

12. Place the Message Nodes to give responses to user

As you might noticed, we have used {{msg.NLU.intent.slots.Quantity}} and {{msg.NLU.intent.slots.FoodItem}} inside the Message Node.
This is the way you can get the Intent’s Slots values from the incoming request. As we have previously used the FoodItem and Quantity as Slots with the FoodOrderIntent intent, in the Intent Schema.

13. Place Respond Nodes

Drag and place Respond nodes after the Message Nodes, as shown below

On previous Message Node, we were asking user to “Confirm the order”, so we need to place Respond Node with Request User Input - Yes.

14. Place Switch Node

Now we need to handle whether user says Yes, No or something else. For that we need to place the Switch Node, connected to Respond Node, as shown below.

  • Double-click the Switch Node, and add the below provided settings.
    In order to handle weather user says, Yes, No or something else. We need to add rules as AMAZON.YesIntent, AMAZON.NoIntent and Otherwise.

15. Add Message Nodes

Drag and place the Message Node, attaching next to the previous Switch Node and also provide the necessary message resonse to the user as shown below.

16. Add Response Node

Finally send the response to the user by attaching the Respond Nodes next to Message Node

17. Save Your Project

Congratulations! You have successfully completed your first project.
You are now just only one stepaway from building your Alexa Skill.

18. Create Alexa Skill