Dialogflow CX | How to let the bot initiate the conversation?

Viewed 2069

Dialogflow ES has an event called 'WELCOME' which makes it possible for the bot to initiate the conversation.

How can I do the same in Dialogflow CX?

There is no entry fulfillment option in the Start Page of Dialogflow CX.

Edit:

  1. Delete the 'Default Welcome Intent' route. I am unable to perform this. I get the following error. enter image description here

  2. In 'Default Welcome Intent' change the intent from 'WELCOME' to nothing. I get the following error. I have set the condition to true. I have also set the page transition to 'onboarding' page.

enter image description here

Please let me know if more screenshots are required.

3 Answers

To accomplish what you're asking, the easiest way would be to:

  1. Open the "Default Start Flow" and select its Start page.
  2. Remove all routes and add a new one.
  3. This new route takes a "custom condition" in the form of true (in the condition pane, click on customize expression and then just type true) and goes to a new page called "Onboarding" (on the bottom of the route creation page, click on new page and name it Onboarding).
  4. Go to the Onboarding page and add an entry fulfilment "Hello there, how are you doing today?"

in this way every time the default start flow is activated (window is opened) the bot will use that fulfilment.

EDIT:

ok, i tried creating a new agent and i think i solved the problem. it seems as though we can't erase the default welcome intent, but it doesn't matter.

i created two pages: onboarding and first page. from start i added an always true route to the onboarding page, and i did the same with the onboarding and first page. As you can see from the testing console we only get the expected behaviour for the second transition, look at this:

start page: enter image description here

onboarding page: enter image description here

"first" page: enter image description here

After looking for info on the documentation i think i understood this: from the testing console, google doesn't let you see the actual behaviour of the conversation. If you see the screenshots, when i say "hi" and go the the onboarding page, i get immediately brought to the next page by that "true" transition. Since the same exact sequence is on the start page, the same behaviour should apply there: you only can't see it in the console because "opening the window" in the console is not the same as opening the conversation "in real life".

So, what i suggest you to do is create a new integration or develop a testing environment for the bot, say a website with the messenger integration, a telephony integration or whatever else, and test this onboarding on there. Speaking from personal experience, try with the messenger one maybe: you get a link and you just embed the script in any webpage (works well and easy).

It should work, as in, as soon as you open the conversation, the bot should go the onboarding page and say "hello there!"

So, I'm not sure what your end use-case is, but DFCX (at it's core) isn't exactly designed to initiate an unsolicited message because it's really just a language model with a bunch of features built on top of it.

With that being said, if you want to create a pop-up window for your website chat-widget, you can actually configure this in the integration settings with your embed code. Here's an example:

//The DF Messenger element: 
 
<df-messenger df-cx="true" chat-title="Agent Name" agent-id="<your agent ID>" language-code="en" expand="true"></df-messenger>

 //The window load script : 

<script src="https://www.gstatic.com/dialogflow-console/fast/messenger-cx/bootstrap.js?v=1"></script><script>
window.addEventListener('dfMessengerLoaded', function (event) {
  const dfMessenger = document.querySelector('df-messenger');
  const openText = ('<The Text You Want To Display On Page Load>');
dfMessenger.renderCustomText(openText);
});

</script>

Please note this will only work if you have the DF Messenger Integration enabled on your agent. See the docs for integrating DF Messenger here

1.Use the attribute intent inside the df-messenger tag in your UI/HTML page

2.Then create a Custom Event in Dialogflow CX (By clicking on Event handler '+' icon)

3.Check the 'use custom event' checkbox and provide event name and provide a text response in fulfillment section of this custom event.

4.Finally provide this custom event name as value to the attribute intent(mentioned in step 1)

please refer to this document for df-messenger HTML customizations https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger#html-customize

Related