Dialogflow CX 3 – Reusable flow to capture data

Dialogflow CX 3 – Reusable flow to capture data

One of the nice things about Dialogflow CX is that you can create different flows to isolate different parts of your conversation, have different developers teams working on them, scale better, … Another key benefit is reusing part of the conversation in different areas of your agent, and this is what I’m writing about here.

If you want to cover some close cases, that might no be exactly equal, you can have parameters defined before calling the flow, and then read some other parameters once the flow is finish, just like you do when functions while programming in any language.

Let me share one example of this use case:

As you can see both AskCustomerData and AskThirdParty are calling the same CaptureContactDetails flow. The idea is that they will call that flow to request user details (name, last name and phone number) and then with and End_Flow page the conversation will come back to calling page, and will continue from there. In order to create the logic for that pages, you need to have a parameter that tells you if the data has been collected or not:

If the parameter ContactDetailsCaptured is “NO”, it will route the agent to the flow. If it is “YES” will continue to the next page in the conversation. AskPolicyNumber in this case. To make sure we ask for the user data the first time we land in this page we define parameters presets in the Entry fulfillment like this:

Yo can see that I have a second parameter to capture the phone, which is optional in the sub-flow that I have defined, and the prompt that it would use to tell the user what we are looking for.

The sub-flow looks like this:

There is nothing special in this flow beyond the parameters names that we will use to capture the information:

Before the flow finishes you need to set the parameter that will prevent the agent to launch it again:

Once the sub-flow finishes, the session will return to the calling page, and it will follow the “YES” route, that is assigning the parameters we just captured and cleaning up the ones that we use temporarily:

If you interact with the simulator you would see the parameters as they get captured with your interactions:

I hope it is useful … happy “programming” with Dialogflow CX.

Jamarmu

===============================================================

I work for Google Cloud, but this post is about personal ideas and opinions

Leave a Reply