How to make CRM speak the natural language?

SHARE

One of our clients approached us with a challenging task - help us to design a virtual agent being able to manage order systems using a chatbot. The main purpose of this project was to make their customer support more efficient and save unnecessary time for their real agents.

 

Build natural experiences with Dialogflow

The very first choice fell on Dialogflow which is a natural language understanding platform that makes it easy to design and integrate a conversational user interface into your mobile app, web application, device, bot, interactive voice response system, and so on. Using Dialogflow, you can provide new and engaging ways for users to interact with your product. Dialogflow is part of Google Cloud and uses its AI, which we really like.

As the second important step  we had to choose between editions Dialogflow Essentials (ES) or Customer Experience (CX).

One of the requirements was to be able to create and integrate more user stories in the future so the agents will get more complex in the future.  This led us to choose the CX option, which can abstract whole flows into smaller blocks (called sub-flows and pages). These blocks can be maintained separately so more people can work on the project. CX edition also provides diagram visualization into 2D diagrams which makes the flow more understandable.

 

Webhooks services as connector with external systems

The Important requirements for chatbots were to authorize users, and manage their products orders, including creation, listings and cancellations. These operations are performed in the customer's CRM system.

You can integrate any external system by using Webhooks.

Webhooks are services that host your business logic. During a session, webhooks allow you to use the data extracted by Dialogflow's natural language processing to generate dynamic responses, validate collected data, or trigger actions on the backend. A webhook can be written in Python and Node.js. It can be held in cloud servers like Google Cloud Platform, Heroku, AWS and local servers.

Dialogflow CX lets us use webhooks in almost every part of the flow. So we can for example trigger webhook in these scenarios:

  • Entering fulfilment

  • Taking a specific route in the flow

  • Setting a parameter

These possibilities allow us to validate data, retrieve orders, or send new orders to an external CRM system.

Easiest way to take advantage of Webhooks is to use Google Cloud Function, which is natively supported by Dialogflow. If we create them inside the same GCP project, Webhook calls are authorized by default service account.

 

Code

index.js

package.js

Based on https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#webhookresponse

Companies that use their custom CRM might consider to implement Dialogflow client library. This will give you the possibility to directly connect from CRM to Dialogflow and develop more complex scenarios.

Create your own chatbot today

Dialogflow is a powerful platform yet easy to maintain. It has extensive documentation on how you can use the platform, easy to find on Google Cloud website. If you just want to try to create a first chatbot, I suggest you start with Dialogflow ES. For more complex and custom solutions use the CX version as we did. Don't wait for approval,  create your first chatbot today and let me know if you have any questions I can help you with.

Cheers, Martin.