Learn Dialogflow CX

Contents hide

Learn Dialogflow CX systematically

You can learn Dialogflow CX systematically using my course.

Free Preview of the First Chapter (Dialogflow CX Beginner Tutorial)

Free Preview of the Second Chapter (Dialogflow ES vs Dialogflow CX using an Example Bot)


✅ = Sample Lesson 

What we are building

What is a state machine?

What we are building

Initial Demo


Building the Vendee Bot

Initial View

User Asks For Balance

Testing it in the simulator

No state transition

Add state transitions

Ask for balance after transition

Download the agent

Completing the Vendee Bot

Assignment 1: What can I get?

Assignment 2: Buy product

Assignment 3: Return my balance

Assignment Hints

Download the Completed Vendee Bot

CX vs ES: A simple Yes/No Decision Tree Bot

What we are building

Conversation Outline

Initial flowchart

Mindomo flowchart conventions

Translate flowchart to Dialogflow ES intents

Using the BotFlo app to speed up rich response construction

Generating rich response for information card

Implementing Start Over

Dialogflow CX – Initial Routes

Why a flowchart helps even for Dialogflow CX

Complete and test the bot in the simulator

Connect CX Bot with Dialogflow Messenger

A summary of what we learnt till now

The shape of a chatbot

CX vs ES: Get User First and Last Names

Can you build this bot in Dialogflow ES? ✅

Flowchart for the ES Bot ✅

Defining the intents

ES Bot Demo

Extending the name system entity

A note about entity annotation

Building the bot in Dialogflow CX

Testing the bot in the simulator

Pros and Cons of Dialogflow CX for this bot

Understanding scope in Dialogflow CX Part 1

Understanding scope in Dialogflow CX Part 2

Flowcharts and Test Cases

Why ES First ✅

Decision Tree Flowchart

Initial Flow

Some Housekeeping Tips

Building the remaining pages

Identifying test Cases

Naming test cases

Running Test cases

Entities and Parameters

Planets Bot: Introduction ✅

Entity Definitions

Original vs Resolved value

Intent vs Session parameters

Session Parameters Intro

Using session params

Keeping track of session parameters

CX Webhooks using Python

Before you start: Ngrok Tutorial ✅

Handling multiple intents in ES Webhooks

Skeletal Code

Webhook Response Object

ngrok setup

Webhook Request Object

Handling getplanetattribute

Handling changesplanet

Handling changesattribute

Sample Code

A bug in Dialogflow CX webhooks ✅

Reroute conversation flow based on webhook response

Dialogflow CX Slot Filling

What is slot filling? ✅

Defining the slots

Demo of simple slot filling bot

Adding phrase variants


Reprompts with no-match-default

Reprompt to selection

Exiting the slot filling loop on first retry

Exiting the slot filling loop after second retry

Conditional routes with expressions

Introduction to the quiz bot ✅

Start quiz intent

Question 1 Page

Question 2 Page

Question 3 Page

Display Score Page

Scope and the flow start page

Building a Dialogflow CX Custom Integration

4 Layers of a Dialogflow Bot ✅

Set up the bot ✅

Download service account credentials file ✅

Code walkthrough

Why I don’t recommend the client library

Defining the custom payload inside Dialogflow CX

Rich responses supported by Zoho SalesIQ

Hosting the middleware code on PythonAnywhere

Hosting the middleware code on Heroku

Hosting the middleware code on Google Cloud

Custom Integration using Flask

Flask App Sample Code

Exception Handling

DF Chooser Bot Demo ✅

Download the agent file

Does a flowchart help when creating a Dialogflow CX bot? ✅

Bot Design Part 1

Bot Design Part 2

Bot Design Part 3

Changing conversation topic

CCAI Vaccine Bot Demo ✅

Start Page Routes ✅

Simple FAQ Routes

Eligibility Flow

Eligibility Flow Conflict Part 1

Eligibility Flow Conflict Part 2

Vaccine Location Flow

Vaccine Location Flow – Testing the agent

System Functions

Introduction ✅

The quiz bot ✅

Text response ✅

Conditional response

Custom Payload

Parameter Presets

Condition Routes

Download the agent blob file

Dialogflow CX vs RASA NLU

Why I prefer Dialogflow ES to RASA NLU ✅

Designing Conversations as a State Machine ✅

Slot Filling ✅

Candidate Intents ✅

When your conversation goes off track ✅

Decision Tree Chatbots ✅

Are state machines inherently bad? ✅

Which bot framework is best for non-programmers? ✅

3 skills which can help you build better chatbots ✅

Quickstart Template 1

Getting a list of inputs from user ✅

Agent blob file ✅

Quickstart Template 2: Initiate conversation from CX

Download agent blob file ✅

Quickstart Template 3

Save data to Airtable

Download agent blob file

Python Code Sample

Quickstart Template 4

Basic Slot Filling

Download agent blob file

Quickstart Template 5

Confirm or update user input after slot filling

Download agent blob file

Quickstart Template 6

Advanced slot filling

Advanced slot filling Part 2

Download agent blob file

Quickstart Template 7

List and composite entities

Download agent blob file

Quickstart Template 8

How to get user date of birth

Download agent blob file

Quickstart Template 9

How to build a decison tree bot

Download agent blob file

Quickstart Template 10

How to build a quiz bot

Download agent blob file

Quickstart Template 11

How to use Google Sheets as the database

Download agent blob file

Python Code Sample

Code samples

Python webhook to display dynamic data from a database inside Dialogflow Messenger


While I have lots of Dialogflow ES courses, all the material for learning Dialogflow CX will be consolidated into this one course. I might make an exception for some tangential material, but all the core concepts will be presented in this one course.

Reviews for the Learn Dialogflow CX Course

There are precious few courses and tutorials for Dialogflow CX given its recent release. For that reason, I wondered if I should wait until the product matured some more before looking for a course. I bought the course after watching a few of the previews of this and other courses. I like Aravind’s approach to teaching. He breaks things down into “bite-sized morsels” without using lingo that leaves many behind. I like the discussion on state machines. I was distantly familiar with the term but Aravind brought it up close.

Other benefits of the course:an understanding of the terminology used in Dialogflow, an understanding of entities and parameters, an overall view of the process of building a bot in CX

I would recommend this course to anyone that has a need to learn the process of creating a bot, either for cost savings or for extending your existing call center functionality.

– Paul R

Just the difference between parameters in CX and the pitfalls of contexts and slot filling in ES was golden.

– Shahrukh S

The course was a great help to identify the difference between CX and ES, and had detailed explanation of the CX components. Yes, I would recommend this course as it is very helpful to understand the whole concept and how to use those to develop efficient flows.

– Manoj V

How to move bot from Dialogflow CX to Dialogflow ES?

I got this question in a YouTube comment.

Unfortunately, this viewer has it completely inverted.

Consider these things:

  • Dialogflow CX has no free tier (update: there is now a free trial)
  • CX has a much steeper learning curve

In fact, here is a Twitter exchange I had with a CX developer advocate. It is a good idea to read it carefully one more time.

Especially this response:

TLDR: Use Dialogflow CX when your bot becomes too complex for ES

So the more practical approach would be to begin building your bot in Dialogflow ES. If and when it becomes too complex for ES, you should consider moving it to CX.

A systematic process for migrating to Dialogflow CX

So how to do this systematically?

Learn Dialogflow ES thoroughly, and move to Dialogflow CX when your bot becomes too complex for ES.

How to learn Dialogflow ES thoroughly?

I am obviously biased in favor of my own course material. 😉 But it would be a systematic process.

The quickest and easiest way would be to get my Learn Dialogflow ES course bundle.

In addition, the Learn Dialogflow ES bundle also has courses on Dialogflow REST API and Dialogflow Webhooks. While those courses are important to fully understand Dialogflow ES, they are not very important when it comes to learning Dialogflow CX.

When to start using Dialogflow CX

So when should you start using Dialogflow CX?

Here is my rule of thumb: if you find that the flowchart you have created using my process is too complex, then I would recommend moving to CX at that time.

This has some obvious benefits:

  • You can use the free tier of ES initially
  • You will get the benefit of using all the existing Dialogflow ES integrations
  • You will already have a working proof-of-concept Dialogflow bot. This completely de-risks your CX bot. Otherwise you will start paying before you even know if your bot will work as expected.

Import agent from from Dialogflow ES to Dialogflow CX directly?

Here is a question I received on my YouTube channel:

Is it possible to import the agent from Dialogflow ES to Dialogflow CX directly?

The short answer is No.

Remember: you can also completely ignore your existing ES bot and just start from scratch with CX – probably a good idea at the moment.

But if you are absolutely determined to migrate your ES bot to CX, this article gives you an important tip which will probably make the process smoother.

The primitives used in Dialogflow CX are very different from ES

I mentioned this in my previous article – a method to evaluate multiple bot frameworks.

Essentially, Dialogflow CX uses entirely different primitives compared to ES, so it is more of a “rewrite” than a mere “redesign”. This makes it much harder to directly import an ES agent to CX.

Having a flowchart for your ES bot will help

If you used the flowchart system I have described in my free “flowchart to Dialogflow chatbot” course, the migration process will definitely be much easier. On the other hand, if you didn’t start with the flowchart process I have described, you probably shouldn’t waste your time and just create the CX bot from scratch.

So why does the flowchart help?

For one thing, my flowcharting system forces you to make your ES bot’s conversation state machine more explicit – and remember you need to first design the state machine if you are building a reasonably complex CX bot.

Migration example

I created an example of migrating from ES bot to CX in my Dialogflow CX course (see below).

It starts with getting user’s first and last name using ES first, and then shows you how you can do the same thing using a CX bot. On the one hand, that’s a fairly simple example. On the other hand, it is a pretty good introduction to the migration process.

Don’t migrate non-contextual FAQ Bots

If you are building a non-contextual chatbot – basically a one-and-done chatbot which just answers FAQ questions without any follow up answers – you probably don’t even need a CX bot.

By the way, I have created a tool which can help you create such an FAQ bot with a single click. So another way of looking at the same thing: if your ES bot can benefit from BotFlo’s FAQ Bot generator, it probably isn’t a good candidate for migration.

CX is primarily meant for the use case where your Dialogflow ES bot’s flowchart gets fairly complex – I also mention this in my article about when to migrate from ES to CX.

For some additional explanation about when CX is necessary, also read my article on Dialogflow CX vs ES where I talk about the Twitter conversation I had with a Google developer advocate.

Understanding Dialogflow CX parameters

I got this comment on YouTube recently:

please make a tutorial about parameters on dialog flow cx. its really confusing compare to dialogflow ES.

While the comment is true, there are three things you can do to make it easier to learn how CX parameters work.

Learn the basics of ES first

I have already mentioned this before, but I think people should first learn ES before learning CX. Jumping right into CX is quite similar to trying to run before learning how to walk. Plus, ES is practically free, so you can do all the mistakes you want while learning.

Understand ES limitations

The design of Dialogflow CX is intended to rectify the problems you face in ES when building complex conversation flows. And you don’t have to take my word for it. That’s what a Google employee pointed out on Twitter.

Ask if you really need a Dialogflow CX bot

Some people want to learn CX just to put it on some kind of checklist on their list of skills. Let us suppose you are not that person.

In that case, you should first build your bot in ES and see how far you can get. Then you can decide whether you need to use CX.

In my Dialogflow CX Beginner Tutorial, I explain the criteria for deciding if you need a Dialogflow CX bot.

Tips to learn how to use parameters in CX

Once you do these three things, you can actually understand CX parameters much more easily.

For example, obviously Dialogflow ES slot filling is a mess, so the form parameters introduced in CX provides a nice way to fix the issues while keeping the core functionality working well. If you never understood why I asked my clients to stay away from slot filling in ES, the way form parameters work in CX will probably make very little sense.

You can use input and output contexts to retain information provided by the user. But these contexts also made it hard to create fine grained conversations (such as a Quiz bot) because you always had to be mindful of the problems caused by a large lifespan. CX has completely eliminated this problem by getting rid of contexts and using session parameters which can “store” input from practically any point in the conversation.

I am not saying it is impossible to make beginner level tutorials for this topic. I am just saying that it will take a lot of time and effort to produce them if they actually need to be at the beginner level. Instead of waiting for these tutorials to show up, you would probably be better off following these steps:

1 Learn why slot filling is a problem in ES, and think of ways to design your conversation to avoid it. This will give you a LOT of insight into how ES contexts work.

2 Understand the challenges of using a large context lifespan, and think of ways to design your conversation using a context lifespan of 1. Again, this will give you a lot of insights into how you can store information provided by the user throughout the whole conversation.

3 Learn how session variables can be simulated in Dialogflow ES

4 By now, you are already very clear on what is “missing” in ES. Now import all the prebuilt agents in Dialogflow CX and start testing them one by one, and CX parameters will start to make a lot more sense.

Or, skip all these steps and just go through my Dialogflow CX course (preview at the bottom of this page). I go over the different kinds of parameters, how they compare to Dialogflow ES, why they are better in Dialogflow CX and more.