Home / DialogFlow ES / When NOT to use follow up intents in DialogFlow
DialogFlow ES | Conversation Design

When NOT to use follow up intents in DialogFlow

Originally published: May 2017 Updated: July 2020

There are some situations where you shouldn’t use followup intents, because it will not work.

The while loop

There was a chatbot called the Florist bot that was originally used as an example bot in the Dialogflow documentation (when it was still called API.AI).

This is what the flowchart of the Florist bot looked like.

In the figure below, the area marked in red is actually a while loop. In theory, the user can just keep indefinitely adding red roses into the bouquet and never say “No, thanks” and exit the loop. This is the “while loop” in software terminology.

While loop inside a Dialogflow conversation flow

It is not possible to use followup intents for this conversation flow, since you wouldn’t know how many levels deep you need to go.

The Split and Merge pattern

Another common conversation flow pattern is the split and merge pattern.

The flowchart for a Quiz bot would follow a split and merge pattern and would look a little like this:

Note that at various points the conversation splits, and then merges back.

You can in theory use followup intents for the split-and-merge pattern, but you would be duplicating a lot of intents. And the longer your conversation (for e.g. more questions in the Quiz bot above), the more duplication you will have in your follow-up intents.

Graph Theory notation

This section is somewhat advanced, but I am hoping the figures will illustrate what I am talking about.

Directed tree

There is the regular directed tree. To go from any node A (represented by a circle) to any other node B, there is exactly one path. If your flow structure looks like this, followup intents are a good choice.

Directed Acyclic Graph

If you have a directed acyclic graph, you potentially have a split-and-merge pattern. In the directed acyclic graph below, it is possible to go from node a to node d via two different paths. You can go a->b->d or a->c->d. But you cannot follow the arrows and go back to the same node where you started.

If your flow structure has split-and-merge patterns like the directed acyclic graph, you will end up creating a lot of duplicate intents.

Directed graph with cycle

In the graph below, you can start at node a, go along edge 1 to node b, then along edge 2 to node c, and then along edge 3 and go back to node a. This is a “cycle” in graph notation. If your conversation flows like this, you have a while loop in your flowchart.

If your flow structure looks like a directed graph with a cycle, you cannot use followup intents.


You might believe that you won’t have split-and-merge patterns and it is safe to use followup intents. Sometimes this is true, but sometimes you might be surprised down the line. So unless you are also fairly confident your conversation flow will not change much down the line, I would recommend avoiding followup intents and instead using input and output contexts to simulate them.

<— End of article —>

This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
"Much clearer than the official documentation to be honest"

Thanks a lot for the advice (of buying and following your videos)! They helped a lot indeed. Everything is very clear when you explain, much clearer than the official documentation to be honest 🙂

Neuraz T
Review for Learn Dialogflow CX
"I will strongly recommend this course because even I can learn how to design chatbot (no programming background)"

I think Aravind really did a great job to introduce dialogflow to people like me, without programming background. He organizes his course in very clear manner since I have been a college professor for 20 years. It is very easy for me to recognize how great Aravind’s course is! Very use-friend and very easy to follow. He doesn’t have any strong accent when he gives the lectures. It is so easy for me to understand. Really appreciate it.

Yes, I will strongly recommend this course because even I can learn how to design chatbot (no programming background) after studying Avarind’s course, you definitely can!

Ann Cai
Review for Learn Dialogflow ES

Similar Posts

    • Sammy, thanks! But in reality, it is not a true state machine. This is because of the way contexts work. You can watch this video where I explain it.