Build UiPath Chatbot With Dialogflow in Less than 15 Minutes

UiPath Chatbot With Dialogflow

Chat-bots needs no introduction as its being currently used by all of us in same ways or other in day to day life …

And trust me its not new even …

If you are following the latest trend in the Intelligent Automation you are probably aware of that the chat-bots and RPA are widely adopted AI Technologies today. With the help of these two super-cool combinations we can create many self-services to perform range of tasks across various system.

Well, how about combing the power of two technologies (RPA + Chatbot) together to solve the real-life problem…?

Lets see how UiPath Works with Chatbot to create intelligent conversational experiences for customers and employees, reduce business costs and increase the productivity of agents.

In this ultimate guide to build Uipath chatbots in 15 Minutes I’ll cover:

  1. How to Build Quick Chatbot /Dialogflow Agent
  2. How to Create Simple UiPath Workflow to service Chatbot request
  3. How to Connect Orchestrator service to begin mapping intents to processes for fulfillment of chat requests
  4. How to Map intents to processes
  5. Test & Deploy your Chatbot

So, if you want to create a quick Chatbot Agent for you using Uipath, you’ll love this guide.

Let’s get started.

Introduction

When it comes to integrating your automation with chatbots its really quick and simple with the help of https://chatbot.uipath.com/ .

When you create your account at chatbot.uipath.com it will show you three step process.

  • Build your chatbot
  • Map intents to processes
  • Launch your chatbot

However, it requires multiple components tide together to work in coordinated ways. So, for sake of simplicity I have divided the guide into multiple section so that you can follow them steps by step.

Trust me if you have every thing handy such as your google dialogflow console, UiPath orchestrator you will be able to start quickly and play with your chatbot in less than 15 minutes…

In case you need to set-up every thing it might take longer…

Lets first see what is required –

  1. You need to have access to chatbot.uipath portal.
  2. You need UiPath Studio to build quick process to take input from chatbot
  3. You need to have access to Orchestrator service so that you can publish Uipath Process and use API keys to connect your Orchestrator instance at chatbot.uipath portal
  4. You need to have dialogflow account private keys (Admin Access) /Console access to create intent

Here is step by step guide you need to follow to build your first awesome chatbot

Step 1 – Connect your Orchestrator instance at Chatbot.Uipath Portal

When you login into Chatbot.Uipath Portal and navigate Build tab you will see two options there-

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 1
  1. Connect your Dialogflow Agent
  2. Connect your Orchestrator Service

Click on the Connect, this will open pop-up window asking you for details around the User Key, Account Logical Name, Tenant Logical Name, Client ID.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 2

You will also find the steps to get those details are listed.

All you need to do here is copy paste the details from API Access Window of your orchestrator instance.  You can get those details on Service page. Click the … button and everything would be listed there.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 3
Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 4

You might need to wait few minutes for connection to be established between your Orchestrator and portal.

That’s all for now for this step.

Step 2 – Build Simple Workflow to Service your chatbot Request.

Well this is pretty easy step…all you need to do is build quick workflow which takes same argument as input and provide some output based on work done by your UiPath Robot.

The important aspect here to keep in mind is integration works on the basis of mapping the chatbots intent param with your process parameter so you need to logically layout how your chatbot will work, what will be input and output …

As of now think from user prospective, Let’s say for my example …I’ll build a chatbot which will take food item name as input and will return the recipe& calory details.

Pretty cool! Right…

So the input here will be the fooditem(example tea,coffee,butter chicken…or whatever you like ) .. Let’s say this as SerachTerm

Now the basis on input (SerachTerm) I will return recipe result with additional details… Let’s say OutPutHTML as output parameter to be shown to user in chat window.

You can build as complex workflow you want but for this guide I have used API provided by https://api.edamam.com/api/food-database/parser to get food database result using http request…

You can implement your idea here …just take care of input and output as those will be used in next step when we build chatbot at dialogflow portal.

Once done make sure you publish the workflow to orchestrator after quick test.

My workflow looks like below – Important here is Arguments (SearchTerm & OutPutHTML) which will be used in further steps.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 5

Step 3 –Create Your Dialog Flow agent and Generate Private Key

Now it’s time to create your first agent. If you already have Dialogflow Account you can heads to console to create your first Agent.

In case you don’t have Dialogflow Account, you can sign up free account using your google credentials. You might need to perform some addition step here as It views and manage your access on Google Developers.

Once you successfully logged in into https://dialogflow.cloud.google.com/# , Go to Create Agent & Fill required details.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 6
  1. Agent Name – This will be displayed as Agent at Chatbot Portal.
  2. You can select your primary language for agent.
  3. Important! You need to specify Google Project you have if any or create new. This will be further required to get the private key.
  4. Click “Create”

Once done you need to get Private key for service account so that you can connect your Dialogflow agent at chatbot.uipath portal.

  1. Go to the Dialogflow Console
  2. Select your agent near the top of the left sidebar menu
  3. Click the settings button next to the agent name
  4. Click on the Service Account email to open the Google Cloud Platform project
  5. This will open new page which will display the service account for the selected project.
  6. Create Keys for Actions and save it to local drive. We will use this in next step.
Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 7

That’s all for step no 3, we are done with creating agent and we have required service account with private keys now to proceed for next step.

Step 4 –Connect You Dialog Flow agent at Chatbot.uipathportal

Go back to chatbot.uipath portal and Navigate to Build à Then Dialogflow agent.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 8

You need to enter the credentials here to connect your dialog flow agent created in previous step.

  1. Project Id – Mapped with Google Cloud Console
  2. Service Account – Make sure Service account have admin access
  3. Private Key for the Service Account.

In case you have not noted these details form previous step you can get those form Agent Home Page and clicking setting icon(Gear Box near Agent Name) form dialogflow console.

Important point here to copy the private key from the Keys file Downloaded in the previous step.  You need to carefully extract the value of Private Key from the Saved file.

Step 5 –Create Intent & Response for Your Chatbot

For creating our awesome bot, lets to go to Dialogflow.

This part of the tutorial will cover performing additional steps with your existing Agent and in the end, you’ll be able to see your bot’s first response (While testing).

Explaining the exact working and detailed information on Dialogflow is beyond scope of this article so you can refer the Official Document for more details.

Read documents here – https://cloud.google.com/dialogflow/docs/

For our example we need to create Intents and configure the required response to work with Uipath Chatbot.

Create Intents

Go to Intent tabs and click Create INTENT

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 9

The key terms that we need to understand here is Contexts, Training Phrases, Parameter Name and Entity.

An intent categorizes an end-user’s intention for one conversation turn, we can define many intents or combine multiple of them to handle the complete and complex conversation.

So basically, we need to match the expression input by end-user to extract useful information for my system to query result for user.

For example – “I love black coffee” in this conversational phrase I am interested in extracting the coffee so that I can give recipe result back to end user.

Next is Training phrases, which are nothing but few examples for what user might say or input. The beauty here is we don’t need to define each and every possible combination because Dialogflow’s built-in machine learning expands on your list with other, similar phrases

For example – if I will give few Training phrases like below it will automatically gets trained to find similar phrases.

  1. “I love black coffee”
  2. “Butter Chiken is my favorite”
  3. “tea”
  4. “coffee”

The other key term we need to understand here is Parameters, As discussed above Dialogflow provides the extracted values from the end-user expression as parameters. Which can be used to perform some logic or generate responses.

In our example we have renamed Parameter as SearchTerm (Recall the workflow build in uipath as input argument) so that we can pass extracted value to Uipath.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 10

Create Response

Last but not the least, the most important part is Responses. We can define text, speech, or visual responses to return to the end-user. These may provide the end-user with answers, ask the end-user for more information, or terminate the conversation.

For our example, we will build the response text using the Output Received from Uipath Workflow (Recall OutPutHTML defined as Out Argument in Uipath Workflow)

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 11

Let’s See all of these terms in action. You might feel some difficulties while creating these at first instance so make sure you save Intent when ever you do changes.

You can try your intent on the same page just by typing your input to see how its works. Quite obvious it will not return result from uipath but it will print the Response Message defined above.

the key aspect here is <OutPutHTML>…which is displayed as it is as we have no response for this variable as we have not connected the Dilaogflow with UiPath.

Lets do that in next step.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 12

Step 6 –Map Intents Param with UiPath Workflow  

This step is pretty simple and quick if you already connected the two different parts of technology on portal.

Go to Map Tab at Chatbot.UiPath Portal , You will see all you intent will be listed there , All you need to do is select the RPA process and Input parameter to map with intent to get your work completed.

Notice Input & Parameter here- They must be same be same to work your integration perfectly.

Here is how it will look like for our example.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 13
Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 14

All right… So far so good and we are only 1 step away to see our Chatbot & RPABot In action.

Step 7 –Test & Launch your Chatboot

As of Now Uipath Chat bot portal only support two way of integration to enable end users to interact with your chatbot by connecting to channels either using Web Or Slack .

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 15

for now we will use the web method to integrate the chat bot. Lets first Test it…

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 16

You might be thinking why the response looks like JSON… This is intentional as i wanted to let you know that that you can further enhance your response to display rich snippet result /widgets or cards like look and feel. You can refer more details here – Documents

You can further customize your agent to Change Name and default Message.

Build UiPath Chatbot With Dialogflow in Less than 15 Minutes 17

Once Done You can copy the HTML Embedded Code and Paste that in Your Website .

<script>
window.addEventListener("message", function (event) {
if (event.data.hasOwnProperty("frameSize")) {
const size = event.data.frameSize;
document.getElementById("uipath-chatbot-iframe").style.height = size.height;
document.getElementById("uipath-chatbot-iframe").style.width = size.width;
}
});

That’s all ! Happy Automation !

Conclusion

I hope you have enjoyed working through all the steps for building exciting and interesting chatbot .

Great work! But remember, At the moment chatbot.uipath provide only limited functionality and for building complex project you might consider creating custom activity with Uipath.

Which will give you more programmatic way to deal with various tasks.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top