Shaveta Arya
Shaveta Arya

Reputation: 21

More than 10 nested flow transitions detected

Here are the details of the error I am facing with dialogflow CX

My bot is designed to go to different flows from the start page and from each flows it goes to anything else flow and back to start flow.

Recently, I have noticed that if we call a flow more than 3 times in same sessions, we get below error the 4th time:

More than 10 nested flow transitions detected

This also happens when we go to any 3 flows and same error occurs while performing the 4th task.

Upvotes: 2

Views: 704

Answers (1)

fcagnola
fcagnola

Reputation: 670

I encountered the same problem, and upon a bit of research I found a workaround. The problem is that by going from flow to flow you're not "closing" them and dialogflow finds itself in a 10 levels nested conversation: to solve it you need to close the flows each time you go anywhere else.

By default, Dialogflow will try to stick to a conversation flow until it reaches the end. If, while in conversation, you go to another flow it follows the pages until the end of the flow and then gets back to the last visited flow and goes on until it finishes that one too, and so on until and "End Session".

This allows you to build complex conversations with deviations from a "main path" but is more difficult to handle when you have multiple "main paths".

I had originally designed my bot to behave as yours, and got the same error, so I had to change strategy. I did as follows:

  1. Created a "Main flow" which had route groups going to all other flows and a few management pages (follow-up for certain questions, onboarding, profanity handling and so on). This flow was stationary, meaning that when you are in a given page you can't actually go anywhere else in the flow, only to other flows by means of route groups. If the user says Goodbye I end the session and that's all.
  2. Changed all other flows to go to the End flow page instead of going to the "main flow". This prevents dialogflow from encountering the error you're mentioning. Each flow now has its own pages and conversation, but when the task is finished instead of having a route going to "Main flow" you have a route going to "End flow". This allows dialogflow to close the flow you're using and not having, as you posted,

More than 10 nested flow transitions detected

So now, each time the conversation starts:

  1. you go to the main flow;
  2. then based on what you tell the bot you go to another flow (handling that intent);
  3. When you reach the end of that flow (perhaps you have completed and order or requested assistance), there is a route going to the "End flow" page (builtin).
  4. This brings you back to the last flow you've visited (in our case the "main flow").
  5. From here, you handle another intent, and so on until you go to a page "End Session" and the bot is closed.

The only thing you need to test is that you can't jump from other flows to other flows, but each flow is only accessible from the main flow (this will avoid being stuck inside the conversation).

Upvotes: 2

Related Questions