Teneo Developers

Convert a Composer bot

Create a new flow

We will now proceed to create a flow (dialog) to hold the logic of the get_weather dialog in the Composer bot.

  1. Select the Solution root folder and click on Flow in the ribbon bar.
  2. Give your flow a name like Get weather.
  3. Add the description, Get the current weather conditions..
  4. Click on the back arrow at the top of the menu to go to the main flow view.

Populate trigger

Now it is time to populate our trigger.

  1. Select the trigger and name it Get weather.
  2. In the Match section in the configuration panel, click on Add followed by TLML Syntax.
  3. In the TLML Syntax field, enter weather.

Add outputs

Next, we need the prompt a response that asks for the user's postal code.

  1. Click on the output node and name it Ask for postal code.
  2. Paste in the output Let's check the weather. What's your postal code?.

Add flow variables

Variables are important when building bots. Not least, your bot's memory will rely on what is stored in variables. In order to store user's postal code, we will need to create a new variable. We will also need some variables to store the information we will shortly be getting from the weather API.

  1. Click on the FLOW button to reach the flow backstage panel.
  2. Select Variables in the menu.
  3. Click on Add.

We will now proceed with creating a variable that takes the postal code from the user input and is later used together with the HTTP request. As an extra addition, we add a initial value for our variable.

  1. Give the variable the name postalCode and the initial value 90210.

Next in line is to create some more variables that will be taken from the Weather API we have called and used inside our flow.

  1. Go ahead and add the following variables too, as we will need them once we call the Weather API:
Variable nameValue
celsius0
city''
country''
fahrenheit0
icon''
responseCode0
weather''
  1. Click on the back arrow at the top of the menu to return to the main flow view.
  2. Hit 'Save' and close the flow.

Next page
Create an integration
Was this page helpful?