The Narrative is the bot-driven part of your app, typically starting with a greeting and ending with a goodbye. Each item in the Narrative is a bot turn. The bot turns will normally be executed in order from top to bottom.
This show an example of a Narrative with three bot turns:
Hello world - a first bot turn
The Narratory example of Hello world is a narrative with a single bot turn of type reply:
If you supply more than one text-block, Narratory will randomly pick one of them:
We recommend adding a few different variants to every bot output since repetition can bore and irritate users.
Asking questions - adding user turns
The next step is to add answers to our bot turn. To do this, we change the type of our bot turn block to request (in the drop down menu on the bot turn block) and add one or several user turns to our bot turns's user input.
Each UserTurn takes two inputs, an intent (see NLU / Intents docs to learn how to create intents) containing example phrases of what the user can say to trigger this UserTurn, and one or several followup BotTurns.
Here we have added two user-turns, one triggered by the user saying "yes" and one for the user saying "no".
Combining turns to sub-dialogs
You can combine bot turns and user turns creating sub-dialogs like shown here:
Jumping in narrative
The bot turns in your narrative will execute in order, but you can use goto parameter to jump to any part in the narrative.
Here is an example where goto is used to jump to a different part of the narrative (talking about the weather) instead of going to the next bot turn in the narrative which would be a trivia game.
Conditional bot turns
Conditions are an essential part in making your dialog customized for the user. In your narrative, it is common to sometimes skip bot initiatives if some criteria is met. One example could be a bot initiative asking a user what color they want for a shirt they are buying. You likely only want to ask this question if the user hasn't already said what color he/she prefers, and if he/she actually is interested in buying a shirt.
Read how to implement conditions on bot turns in Logic docs.