# Dialogflow: Creating a Chatbot

{% hint style="info" %}
**Tip:** For more advanced and easier to use automated replies to conversations, consider using [Workflows](https://docs.is-messenger.com/ismessenger/modules/workflow).
{% endhint %}

IS-Messenger has extensive integrations with Dialogflow that cater to various use cases, including creating chatbots.

<figure><img src="https://3688769499-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mbui1HRO4dGghy5ITOz%2Fuploads%2FB4On6OWZz4keZQFAMJwT%2F12.png?alt=media&#x26;token=3fd1e032-b1aa-40f6-9280-8c5b3dfb1ca7" alt="screenshot showing how respond.io integrates with Dialogflow"><figcaption></figcaption></figure>

The following image shows an example of how Dialogflow can be used to automate specific responses.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/0og7ct98mv/1665045623496/dialogflow-creating-a-chatbot-2.gif" alt="gif showing an example of a Dialogflow automated conversation"><figcaption></figcaption></figure>

{% hint style="info" %}
**Tip:** To better understand the integration between Dialogflow and IS Messenger, read the following blog posts:\
[How To Build a Chatbot with Dialogflow](https://docs.is-messenger.com/ismessenger/workspace-setting/integrations/dialogflow)\
[How To Use IS Messenger As a Dialogflow CRM](https://docs.is-messenger.com/ismessenger/workspace-setting/integrations/dialogflow/dialogflow-connecting-to-dialogflow)
{% endhint %}

{% hint style="warning" %}
Dialogflow's chatbot is [not supported for email channels](https://docs.is-messenger.com/ismessenger/messaging-channels/email) on IS-Messenger due to Dialogflow's intent text input limit. Consider using [Workflows](https://docs.is-messenger.com/ismessenger/modules/workflow).
{% endhint %}

### Connecting to Dialogflow <a href="#connecting_to_dialogflow" id="connecting_to_dialogflow"></a>

Follow the guide below to connect to Dialogflow

{% content-ref url="dialogflow-connecting-to-dialogflow" %}
[dialogflow-connecting-to-dialogflow](https://docs.is-messenger.com/ismessenger/workspace-setting/integrations/dialogflow/dialogflow-connecting-to-dialogflow)
{% endcontent-ref %}

### Creating a Basic Intent <a href="#creating_a_basic_intent" id="creating_a_basic_intent"></a>

For this guide, we will create a basic intent that enables the chatbot to answer inquiries regarding operating hours.

**Step 1: Create Intent**

Navigate to the [Dialogflow](https://dialogflow.cloud.google.com/) console and click **Intents** on the side navigation menu. Press the ➕

or **CREATE INTENT** from the top of the module.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/0og7ct98mv/1675304850654/dialogflow-chatbot-1.jpeg" alt="screenshot showing how to create intent in Dialogflow"><figcaption></figcaption></figure>

**Step 2: Name Your Intent**

Enter a name for your intent. Your intent name should represent the end-user expressions it recognizes. For example, `operating_hours_enquiry`.

**Step 3: Include Training Phrases**

The template phrases will be deprecated and ignored during training. Learn more [here](https://cloud.google.com/dialogflow/es/docs/intents-training-phrases#example_and_template_modes).

{% hint style="warning" %}
Training phrases are the phrases that will trigger the specific intent and the expected behavior.
{% endhint %}

You can compile the most commonly asked questions in regards to operating hours and include the list as training phrases.

For example,

> *What are your operating hours?*

> *What time do you close?*

> *Are you open on Sundays?*

> *Which day do you close?*

> *Are you open on the weekends?*

> *What time do you open?*

> *What time do you close?*

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/0og7ct98mv/1675305083559/dialogflow-chatbot-2.jpeg" alt="screenshot showing how to set training phrases in Dialogflow"><figcaption></figcaption></figure>

**Step 4: Build Intent Response**

Scroll down to the **Responses** section and add a **Text Response**.

{% hint style="info" %}
**Tips:**\
You can send multiple responses.\
You may add a few response variants and a response will be chosen by randomized selection for the Contact.
{% endhint %}

The response we will build for this intent is:

> Our operating hours are Monday to Saturday, 10am to 10pm. We are closed on Sundays and Public Holidays. Let us know if you require further assistance.

**Step 5: Test It Out**

You can test it with the testing panel located at the right side of Dialogflow or test it with the connected Channels.

<figure><img src="https://files.helpdocs.io/9e3syfbzn8/articles/0og7ct98mv/1675305173759/dialogflow-3.jpeg" alt="screenshot of dialogflow chatbot sample response"><figcaption></figcaption></figure>

#### What's Next? <a href="#what_s_next" id="what_s_next"></a>

Now that you know how to create an intent, enhance it with more use cases specific to your company.

{% content-ref url="dialogflow-managing-intents" %}
[dialogflow-managing-intents](https://docs.is-messenger.com/ismessenger/workspace-setting/integrations/dialogflow/dialogflow-managing-intents)
{% endcontent-ref %}
