Dialogflow CX Beginner Tutorial – 9/14: Add state transitions

Course outline


All right.

So now let’s add more state transitions into our pot if you go.

And click on this state 25 the state you will see that the only thing that we have right now is you have entered state 25 the entry dialog.

What I’m going to do is I’m going to add an intent in the intent routes in this page.

So here this is one of the nicest features in Dialogflow CX you can just reuse an intent you have declared before .

So in our case we know that we already created this add a quarter intent which has this phrase which just says add a quarter.

And now when I select that intent notice that it allows me to change the response in other words you can have different responses for the same intent based on which page you have added that intent into that is what is the state [m1] the current state of the part.

And that makes perfect sense if you think about it because if you are in state 25.

And you add 25 cents by adding a quarter and.

Let’s say that the agent is going to give you the balance right if it’s in state 0.

And you add a quarter of the balance here it should say 25 cents.

On the other hand, if you are already in state 25.

And then you add a quarter the ball balance should say 50 cents it shouldn’t say 25 cents right.

So this is an important distinction because in the case of Dialogflow years you will come back it will come back with the same response I when I say it comes back with the same response what I’m really saying is yes it you can select from a set of possible responses but that’s actually selected at random as – you know – right here the concept is very different you took an intent which we have already declared but you have changed the response not random randomly selected from a list but [m2] you have actually changed the – you know – the meaning of the response because you are able to edit the fulfillment depending on which state you are in right now.

But in our case I’m just going to say you have added a quarter I’m not going to provide the balance here that’s what I mean but I will change the state to state 50.

That is, I’m going to transition to the page called state 50..

So let’s save this now let’s go to state 50.

And if it doesn’t open you can actually click on this edit here.

And in the fulfillment I’m going to say you have entered state 50.

OK, now save it.

And let’s test it quickly I’m going to start with add a quarter you can see that it’s coming back with okay I added a quarter you have now [m3] entered state 25 it’s already in state 25 so.

If I were to say add a quarter again you can see that it says you have added a quarter you have entered state 50 which is exactly what we want.

So let’s continue in that same fashion now we are in state 50 let’s edit state 50.

And go to the page view of.

What I’m going to do is minimize this.

And expand this state 50 we will add a new intent well we are just adding the old intent back into this new page.

And once again the agent says okay you have added quarter.

And then it will transition to state 75 right let’s save that.

And let’s go to state 75.

And in the entry dialog we will just say [m4] you have now entered state 75 that’s pretty much all we have for the in terms of changing the state.

So let’s go ahead.

And test the agent we start by saying add a quarter you have entered state 25 then I say add a quarter you have entered state 50. you say add a quarter .

And you can see that it’s now entered state 75 we don’t allow the user to add any more quarters you remember the logic of the vending machine.

So this is explaining to you what is going on in terms of the state transitions that is the page transitions in our bot.

And if you come to the visualization of the flow you can see that it’s got this nice I guess you can say that it’s got this nice flow diagram where you can see that [m5] the bot is able to move from start to state 25 to state 50 to state 75.

Now, you may not be able to see the full details.

So, if you remember the image that I had here you can even see exactly which text moves it from which state to which state that level of granularity is not available in the overall view in your CX console but you could click on this right.

And then you can see you should click on this specific intents.

And you do have this information here.

And of course the reason for that is because they are trying to provide you with the most compact representation of the flow diagram if it was if they tried to provide all this information in one view I am pretty sure that there will be so much information on this page that you will not be able to make sense of what is going on.

So they have to – you know – decide on some kind of trade-offs as to how how much of a high level [m6] picture they can show on this flow diagram and.

I think that to me it looks like a reasonably good balance till now.

So what we have done now with this particular video is that we have added all the state transitions into our Vendee bot

<— End of article —>

This website contains affiliate links. See the disclosure page for more details. 
Check out the Learn Dialogflow ES and Learn Dialogflow CX courses if you would like to learn Dialogflow in depth.
"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