Author your first Health Bot scenario Quickstart

The Health Bot Service supports several built-in scenarios. For example, the bot can triage a medical condition, or find information about a disease.

In addition, partners have detailed configurability and control over the service functionality and behavior. Customers also have the ability to extend the functionality of the bot by authoring custom scenarios.

This Quickstart guide will walk you through creating your first custom Health Bot scenario.

You will learn how to:

  1. Author a new custom Health Bot scenario
  2. Chat with the bot instance to test your scenario

If you don't have an access to the Azure Health Bot Create your first Azure Health Bot

Log in to the Health Bot Service Management Portal

Log in to the Microsoft Health Bot Service Portal.

Author a new custom scenario

Customized scenarios can be added in the scenarios tab of the management portal. To begin creating scenarios for a new health bot instance, select the Add button at the top of the page.

We will start by defining the unique Name and Description of our scenario:

We will also set the Scenario ID as "hello". This is an internal identifier that will be used later on, once we define intents to be mapped to this scenario.

Note: Scenario ID is case sensitive.

The fields, visual editor, and elements provided in the Scenario Editor allow you to author, test, and debug scenarios.

The Returning Message and Interrupting toggle are advanced settings that control how scenarios can temporarily interrupt the conversation flow. To learn more read Configure interrupting scenarios. For now, let hit create.

Each scenario appears as a graphical flow of controllers. Three types of controllers are available in the scenario editor:

  1. Conversational elements that are visible to the end user, such as Prompts and Statements.

  2. Flow control elements not visible to the end users but rather used to create the logic of the conversation.

  3. Navigational elements such as Zoom, Trace, and Watch not used at runtime, but which help the scenario author to create and debug the scenario.

For the full list of elements and their meaning see Scenario Elements

Let's select a Statement element and place it in the editor window. A Statement triggers an output from the health bot instance with no expectation of a response.

An edit window will appear. In the display text we will enter "Hello, world!" Note: The display text can be a string literal or a valid JavaScript expression. Editing the label of an object is a good authoring practice. In this case, we have labelled it Greeting.

You can open and edit the fields at any time by double-clicking on the object in the visual editor, or right-clicking and selecting Edit.

A JSON view is available as well for editing ease and allows easy access to the underlying code. The text-based code is generated automatically when the author adds new objects to the visual editor and is updated automatically after any changes.
The JSON format also allows scenarios to be exported and imported.

Move to the code tab to see the underlying JSON code.

Now let's make things more interesting and add other elements to the conversation flow. A Yes/No Prompt defines a two-way split in the flow based on user input. We will use it to ask the user if they are interested in scheduling a meeting with a doctor. The response to this question will be saved in a variable named "ShouldScheduleDoctor".

To learn more about Health bot variables see Health bot instance variables

Now let's connect the Greeting element with the Schedule prompt by dragging an arrow from one element to the other.

We can define what will happen further in the conversation based on the user response.
Let's write something to the user by adding two more statement elements and proceed to test the conversation we have just authored.

Chat with the bot instance to test your scenario

Note! Before you can test your scenario, make sure to first Save it. Then, press Run.

The Web Chat panel in the upper right of the Scenario editor allows you to run and test scenarios as you go. It will first display the 'Hello, World!' greeting element and will then continue to the scheduling condition.

At any time, you will be able to see the current step being executed in the conversation

For more debugging options please see Advanced Debugging

Once you have completed testing the flow, you can exit the scenario editor.

Managing Scenarios

A new record will be added to the list of scenarios.

Action Description
Export your scenarios Use the Export button to export all the selected scenarios as JSON files for safekeeping, sharing, and to move from staging to production.
Import Use Import to import a JSON blob in to one or more scenarios.
Enable or Disable You can enable and disable scenarios using the on / off toggle buttons next to the scenario

You can use the "begin" keyword followed by the scenario ID to explicitly trigger this scenario from the main Chat window

Next steps

Now that you have authored your first scenario, get yourself familiar with additional Bot capabilities.

Get to know the different Scenario Elements

Learn about Health bot instance variables

Advanced Debugging Concepts

Learn How to enhance user experience using Authored Cards

Control the flow of conversation using Sub Scenarios

Discover Action Code

Error handling best practices in authored scenarios