Build your first Flow

In this short guide you will create your first short conversational Flow.

1 Create a Lexicon

Our flow needs to understand variable user input. Therefore, let's create a Lexicon first.

๐Ÿ“˜

Lexicons

By adding Tags and Synonyms to Keyphrases in a Lexicon and attaching the Lexicon to a Flow, different user inputs can be grouped and semantically linked.

  1. Click the + button in the Project Dashboard and click the Lexicon button. Enter a name, e.g. Food Lexicon and hit enter.

Next, we'll add new Keyphrases to the Lexicon for our food options:

  1. Enter a new Keyphrase pizza in the text field in the toolbar and press enter.

Now we can expand our pizza Keyphrase with Tags and Synonyms to make it more understandable for our Flow.

  1. Let's add cake as a Synonym.
  2. Then, add food as a Tag.

2 Attach the Lexicon to your Flow

Now we want to use our Lexicon in a Flow.

๐Ÿšง

Attached Lexicons

The Keyphrases defined in a Lexicon will only be used in a Flow if the Lexicon is attached to it.

  1. Back in the Project Dashboard, create a new Flow, let's call it Pizza Flow.
  2. In the Flow Editor, click on Attached Lexicons in the left sidebar.
  3. Attach your Food Lexicon to the Flow by clicking on it.

3 Create Intents

Next, we need to create an Intent so that we can use it as a condition in our conversation.

  1. Click on Intents in the left sidebar.
  2. Click the lower right button and choose ML Intent.
  3. Enter order_food as name.
  4. Add the example sentences listed below
  5. Save the Intent
  6. Train your intents by pressing Train Intents on the upper right

4 Building the Flow

Now let's use our Lexicon and Intent in our Flow.

  1. Go back to the Flow Chart in the Flow Editor. Click Flow Chart on the left sidebar.
  2. Let's set up the Flow to process different inputs. Use an If Node as follows:
    Click on the button on your Start Node and select Create Node โ†’ Logic โ†’ If.
  3. Double click the If Node and either use the Rule Editor (write ci.intent on the left side, use equals as the operator and write order_food on the right) or use the Advanced Editor and write ci.intent === "order_food" into the condition field. This condition will now be true if our new Intent order_food is matched. Save the Node.
  1. Now we will add Say Nodes to our conditions to get the conversation going:
    Click the button on the Else Node and select Create Node โ†’ Basic โ†’ Say.

๐Ÿ“˜

If Node Condition

Whenever the condition in the If Node isn't met, the Flow will go into the else branch attached to the If Node.

  1. Double click the new Say Node to add the text your Flow will say before the order_food Intent is met. Enter a greeting text, for example Hello there, what can I do for you today?.
  2. Now add a Say Node to the Then Node. Click the button on the Then Node and select Create Node โ†’ Basic โ†’ Say. Double click it and enter Great! I will deliver your food as soon as possible! as text.

5 Test your Flow

You can now chat with your Flow in the Interaction Panel and see the results of the Flow you build.


Whatโ€™s Next

Let's publish our Flow live on the web!

Did this page help you?