Dialogflow Tutorial for Beginners (2024)
By Joren Wouters • Updated on
Do you want to create a chatbot with Google’s natural language platform? Great!
With Dialogflow, you can understand questions your users ask and automatically reply to it.
But it takes some time to fully understand how Dialogflow works and all the features it provides.
That’s why I’ve created this free Google Dialogflow tutorial for you.
I take you through all the features of Dialogflow step-by-step so you can create your first chatbot.
- What is Dialogflow?
- How to create your Dialogflow chatbot
- Use Dialogflow Small Talk
- Understand the user with Dialogflow Intents
- Capture information with Dialogflow Entities
Let’s dive in!
Table of Contents
What is Dialogflow?
Dialogflow is the natural language understanding platform of Google that you can use to create chatbots.
With Dialogflow, you have one system for creating your chatbot and then you can automatically put it on multiple channels, such as:
- Your website
- Facebook Messenger
- WhatsApp (using Twilio)
- Telegram
- Slack
One of the reasons so many people use Dialogflow, is because of their Natural Language Processing (NLP), which is extremely good.
How does Dialogflow work?
Dialogflow works with agents. An agent is a chatbot that you can train, so it can automatically reply to questions.
To do this, Dialogflow has two key features: Intents & Entities.
An intent is an action a user wants to do or a question someone has. To recognize an intent, you can feed Dialogflow with training phrases. For example, for the intent “Order pizza”, you can feed it with:
- Can I order a pizza?
- I want to get a two pizzas, please!
Then, Dialogflow will recognize that if someone asks these questions, they want to order a pizza.
Secondly, Dialogflow uses entities to capture important parts of a sentence. For example, if someone says “Can I get a veggie pizza?”, Dialogflow understands that veggie is the topping of a pizza.
How to create your first Dialogflow chatbot
Now let’s start with our first Dialogflow chatbot.
Head over to the Dialogflow console and log in with your Google Account (create one if you don’t have it already).
Once you are logged in, you can click on Create Agent:
Here, you can fill in the name of your agent, set the language and click on Create:
Dialogflow will now load for a few seconds and creates the chatbot for you.
Next, you need to go to your Agent’s settings, click on ML Settings and check the Agent validation:
By enabling this feature, Dialogflow automatically tracks errors in your chatbot.
How to use Small Talk in Dialogflow
Once you’ve created your Dialogflow chatbot, we can start by using Small Talk in Dialogflow.
Small Talk is a feature in Dialogflow that you can use to respond to everyday questions, such as:
- Who are you?
- How old are you?
Check the video below on how you can set up Small Talk in Dialogflow:
Understand the user with Dialogflow Intents
Small Talk allows you to answer simple questions.
But if you want to really understand the user, we need to use Dialogflow intents.
An intent is an action a user wants to do or a question a user has.
For example, they want to:
- Order a pizza
- Book an appointment
- Want more information about your company
And in Dialogflow, you already have two default intents:
- Default Welcome Intent
- Default Fallback Intent
The Default Welcome Intent is for understanding greetings, such as “hey”, “hi” and “hello”.
And the Default Fallback Intent is triggered when the chatbot doesn’t know an answer to a question.
Let’s see how Dialogflow intents work and how you can create them yourself:
Capture information with Dialogflow Entities
Now that we can understand the user, it is time to capture specific information users are telling us.
And we can do that by using Dialogflow entities.
Entities are facts in a sentence, that refer to the who, what, when and where.
For example, an entity can refer to the topping of a pizza or the day of an appointment.
Let’s take this sentence as an example:
I want to order a veggie pizza.
If we would not use entities, Dialogflow would think that the user wants a normal pizza, instead of a veggie pizza.
Gladly, we can train Dialogflow to understand these facts in a sentence, called entities.
Check out the video below to set up your first entities in Dialogflow:
How to publish your Dialogflow chatbot
Now that you’ve build your Dialogflow agent, it’s time to put it on multiple channels.
And because we are using Dialogflow, it’s pretty easy to do this.
Let’s see how we can add Dialogflow to:
Add Dialogflow to your website (Dialogflow Messenger)
With Dialogflow Messenger, you can easily add your Dialogflow agent to your websites.
Also, you can customize the widget to your branding, such as changing the colours and title of your widget:
Connect Dialogflow to Facebook Messenger
Connect Dialogflow to Telegram
Connect Dialogflow to Slack
Now It’s Your Turn
And that’s how you create your first chatbot with Dialogflow and put it on many channels.
Although Dialogflow is good with AI, I actually don’t recommend using it. This is because you cannot create custom chatbot flows, personalize conversations or store customer data.
So, if you want to create custom chatbot flows and use AI, please check out these tutorials:
Frequently Asked Questions
What is Dialogflow used for?
Dialogflow is a tool to automatically answer questions from customers. It’s mainly used for its natural language processing capabilities.
You can train Dialogflow on your phrases. It will then reply to questions based on them.
Hi there. I have a problem. I want to write this massage when someone Clicks get started.
Massage : hello, [the name of the user]. How can we help you.
So how will i tell the user’s name….
I think if you create an intent with the training phrase “Get Started”, you can automatically answer this. Regarding your second question, I am not sure how you can use the Facebook user’s name with Dialogflow. You probably need to create a connection with Facebook’s Graph API…
I want to create a chatbot to be integrated into my website that can query a database to retrieve students results & display it.
I want to be able to update the database from the admin page on the website & it should be reflected in the chatbot.
How do I do this?
Hey Andy! To be honest, I am not an expert in creating custom databases, so I would not know which system you would need for that. But once you have your system, you can just make an integration between Dialogflow and that system 🙂
Hello Andy James,
I also want same. If you have done that part can you guid me?
how do i create buttons in conversation like Yes or no, I had enter json code in custom payload but the buttons would not appearing in output bot, can you please help me on this?
Hey Rajesh! For which channel are you building your chatbot?
I am building a custom chat-bot integrated with actions for assistant support. I need to display the last unanswered intent again, if user go with small talk rather answering the question. I want this as default small talk message, just after we small talk delivers it’s response.
Hey Vineet! I think if you want this, you need to code it yourself using Dialogflow Fulfillment, because this is not a built-in feature of Dialogflow.
I am able to chat using facebook messenger. However, When I asked my friend to try out, the chatbot did not reply to him. Wondering is there something I missed?
Hey! This is because you need to submit your Facebook App for review and get approved. Here is a video on how you can do that: https://youtu.be/PMRn-p2PzTE