# DialogFlow

DialogFlow is a Natural Processing Language (NLP) engine that makes it easy to design and integrate a conversational user interface into your mobile application, web application, device, bot, interactive voice response system, & so on.&#x20;

### Use-case scenario:&#x20;

DialogFlow can be used by you when;&#x20;

* You want to connect your DialogFlow agent to WotNot
* You want a smart bot to parse the input of the visitor
* You want to create AI based bots&#x20;

### How do I integrate WotNot with DialogFlow?&#x20;

Setting up the integration between WotNot and DialogFlow is two step process;&#x20;

1. Getting the JSON key for the agent that you want to connect it to WotNot
2. Configuring the JSON key on DialogFlow action block

{% hint style="info" %}
To generate the JSON key for the agent that you want to connect to WotNot, [here](https://www.loom.com/share/d1d5b0f1849a4afca5aa8ef8775cc796) is the video tutorial to guide you through the same.&#x20;
{% endhint %}

### How do I set it up?&#x20;

In-order setup the DialogFlow action block in the bot flow, you can follow the following steps;&#x20;

* Add an action block on canvas by clicking on '+'\
  &#x20;
* Choose 'DialogFlow' <br>
* Double click on 'DialogFlow' to configure it on the right panel<br>
  1. Map the Variable: \
     \
     Select the variables in which the visitor's inputs are stored. Just like to answer a question, you need a question; similarly, to parse inout to DialogFlow, we send a sentence to them & DialogFlow in return reads the question & sends the matching answer to WotNot<br>
  2. Upload JSON file: \
     \
     Upload the JSON key that you have downloaded in the earlier steps. If you haven't download it yet, refer to this [video tutorial](https://www.loom.com/share/d1d5b0f1849a4afca5aa8ef8775cc796)<br>
* Define actions:\
  \
  Define the actions to be performed for the Success & Failure scenarios. You will see two ports '+' for Success condition and '+' for Failure condition. \
  \
  On Success, meaning when an intent is matched on DialogFlow and a success response is received, we have the option to self loop the block or move on to the next step in the flow<br>

  On Failure, you can define what should be the next step in the conversation flow, by adding an action block. Obviously, DialogFlow will not always give you expected response & so whenever it fails, you may try to request the input again and loop it back to the flow

{% hint style="info" %}
We at WotNot recommend you to have the 'Collect Input' action block placed ahead of the 'DialogFlow' action block & store the response from the visitor in the variable.&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.wotnot.io/build/integrations/native/dialogflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
