Dialogflow Tutorial for Beginners (2023)

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 possibilities it provides.
That’s why I’ve created this 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?
- What is the pricing of Dialogflow?
- Create your first Dialogflow agent
- Use Dialogflow Small Talk
- Understand the user with Dialogflow Intents
- Capture information with Dialogflow Entities
Let’s dive in!
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
And much more.
One of the reasons so many people use Dialogflow, is because of their Natural Language Processing (NLP), which is extremely good.
What is the pricing of Dialogflow?
Dialogflow provides two applications:
- Dialogflow Essentials (also called Dialogflow ES)
- Dialogflow Customer Experience (also called Dialogflow CX)
Dialogflow ES is the standard version of Dialogflow that is the most used one. You basically only need Dialogflow CX if you are going to build really extensive and difficult chatbots.
Dialogflow ES is free as long as you stay under the 180 requests per minute. This means that you can send 324,000 text messages per month and don’t have to pay anything.
If you go above the 180 requests per minute, you need to pay $0.002 per request. Also, if you want audio input or output, you need to pay extra:
If you want to make a more advanced chatbot and want to use Dialogflow CX, you pay $20 per 100 chat sessions. Also, if you wanto to use audio input or output, you pay $45 per 100 voice sessions:
But again, you probably don’t need Dialogflow CX to build your chatbot 😉
How to create your first Dialogflow agent
Now let’s start and create our first Dialogflow agent.
By the way, an “agent” in Dialogflow is the the same as one chatbot.
So 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 agent for you.
Before we move on, we need to change on setting. Go to your Agent’s settings, click on ML Settings and check the Agent validation:
If you enable this, Dialogflow will automatically track errors with your agent, which could be useful to have in the future.
How to use Small Talk in Dialogflow
Once you’ve created your first Dialogflow agent, 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:
Publish your agent on multiple channels
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:
- Our website
- Facebook Messenger
- Telegram
- Slack
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 multiple channels.
Now I have a question for you:
Do you already use Dialogflow? And what problems do you have when building your Dialogflow agent?
Let me know by leaving a comment below.
P.S. If you have any questions, feel free to ask them in the comments 🙂
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