Is there any way to resume a chat in dialogflow cx?

1,017 views
Skip to first unread message

Vasuki Vardhan G

unread,
Jun 16, 2021, 4:56:14 AM6/16/21
to Dialogflow CX Edition users

I'm trying to build a chatbot with DialogFlow CX. We have an existing chatbot built on DF ES where with the help of contexts we have implemented a resume chat feature, which enables our end users to come back to the chat anytime and continue from where they left off. So currently we are building out the exact same bot in CX and we are facing challenges in recreating the resume chat flow.

So any help regarding how to to do this will be really helpful.

Thanks in advance

Haoyan Sue

unread,
Jun 17, 2021, 10:44:04 PM6/17/21
to Dialogflow CX Edition users
Hi,
Maybe you can use "Session parameters" and "Webhooks" to solve this problem. Is it possible that you store the user dialogue history in your database when the user quit from your chat flow? When the user comes back, you can send its UserID (or something related with its ID) to identify the identity by calling a webhook, and then check out his/her dialogue history in your own database. The webhook in CX version can set session parameters in certain page or transition to target flow/page directly.  So when you find out the last end point of this user, you can transition to the certain page while set all neccessary session parameters for this users. In this way, the dialogue can be resumed.

Jessica Carolina Rodriguez

unread,
Jun 25, 2021, 7:34:45 PM6/25/21
to Dialogflow CX Edition users

Dialogflow CX conversation (session) can be described and visualized as a state machine, configured to collect information or parameters from the end-user. This information is relevant to the conversation state on that page. Please be noted that for each conversational turn, the current page will either stay the same or transition to another page. This also applies for resuming or continuing the current state of the conversation.

Here are possible ways to continue/resume a conversation by passing previously collected customer data from a previous conversation into a new conversation:

  1. You can create a custom implementation using a webhook wherein a function will store the parameter and forms you collected and use that to continue the chat from where the user left off during a conversation flow or a session. In the webhookResponse you can set the fulfillment_response, target_page fields and session_info field to update and send back the stored parameters you collected from the previous conversation. 

            Here’s an example of how to pass the session parameter, target page and fulfillment response from your webhook response:

             {
                  sessionInfo: {
                       parameters: {
                                param1: {
                                      value: "sample1"
                                 }
                       }
                    },
                   targetPage: projects / <Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>,
                   fulfillment_response: {
                                  messages: [{
                                            text: [“This is where you left”],
                                   }]
                    }
               }
           
         2. You can use APIs or Client Libraries  to set the queryParams.parameters and queryParams.currentPage in the detectIntent method.

              Here’s a sample reference using REST API to set the QueryParameters of the detectIntent method request body:

               {
                   queryParams: {
                          parameters: {
                                 param1: {
                                         value: "sample1"
                                  },
                         currentPage: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>,
                         }
                     }
                 }
Reply all
Reply to author
Forward
0 new messages