Learn how to automate tasks with UiPath and Bizagi

In this tutorial, you will learn how to create a Bizagi case using the UiPath robot. The solution will cover a common Customer Service scenario where a customer sends an email related to many possible request types. Then a person has to analyze the email and make a decision based on the request. The final automation will be in charge of receiving and understanding every email.

Customer Service scenario (UiPath and Bizagi automation)

UiPath and Bizagi

Bizagi can be integrated with many external systems using different integration types and protocols. In some cases, there are repetitive or non-productive tasks that end-users still have to do.

As an example here is a list of most common ones:

  • log into applications to search, copy and paste data
  • retrieve emails and analyze their content
  • store files in folders and register their data or metadata into a process
  • register any information on an external website and save the results in a Bizagi process

UiPath robots look to emulate human intervention in these repetitive and non-productive tasks by interacting with other systems. As a result, it allows end-users to focus on tasks that add value to the business.

Together, UiPath and Bizagi can create powerful solutions for process innovation.

Use Case

The customer sends an email to the Support team. The member of the Support team retrieves the email and creates a new case in Bizagi. All data from the email are entered manually into the form and then the case is submitted.

Task Automation

First, I will walk you through the UiPath automation: read the email and based on its data, trigger a new case in Bizagi. Secondly, we will create and configure the Bizagi process.

UiPath automation

Create a new project and call it Start New Case In Bizagi. Fill in the rest of the details as in the image below.

New UiPath Process

Rename the flow as Start New Case in Bizagi and drag and drop a new sequence activity. Connect it to the Start point. Rename the sequence as Read Emails and Start case.

UiPath canvas

Open the sequence. In this step, I am going to replicate the flow from the Download email attachment with UiPath article.

Create 3 new variables:

  • EmailAddress – String type
  • EmailPassword – String type
  • MailMessages – List<MailMessage> type (System.Net.Mail.MailMessage)

Then, add to the sequence the following activities:

Read Emails and Start case in Bizagi

The configuration of each activity can be found in Download email attachment with UiPath article. Don’t forget to configure your Gmail account for IMAP/POP3 protocols and generate and use an App password from Google. For more details follow this link .

The next activity is For Each. We have to loop through retrieved emails and get the sender’s email address, the subject and the body of the email.

For Each activity
  • Subject = item.Subject.Replace(“”””,” “)
  • From = item.From.ToString.Replace(“”””,” “)
  • Body = item.Headers(“PlainText”).ToString.Replace(“”””,” “)

Next, add the Bizagi Scope activity. This activity doesn’t come with UiPath. You must download and install it. If you already installed the package you should be able to see the Bizagi activities under the Integration section. If not, then go to Manage Packages and search for Bizagi. As you can see in the image below, I already installed UiPath.Bizagi.Activities by Alex Vasile.


Add the Bizagi Scope activity and create these 3 new variables:

  • BizagiServerAddress (String)
  • BizagiClientId (String)
  • BizagiClientSecret (String)
Bizagi Scope
Configure Connection for Bizagi Scope container

The Bizagi Scope container provides scope for all Bizagi activities, like in our example we have to use Create Case activity to trigger the creation of a new case in Bizagi.

The access to Bizagi processes is done through OAuth access keys. So, let’s create a new access key for our Robot. Go to the Bizagi portal application, log in and select Admin > Security > OAuth 2 Applications from the menu. Go on and create a new key: enter the name, define Grant Type as Client Credentials, select API, select admin as User Name and Save.

OAuth 2 Applications Bizagi
OAuth keys

Use the values from Client Id and Client Secret to configure the Bizagi Scope in UiPath.

Inside the Bizagi Scope container, add 2 new activities: Assign and Create Case, then create 3 new variables:

  • BizagiCaseJSON (String)
  • BizagiProcessName (String)
  • BizagiCaseNumber (String)
Bizagi JSON

Assign the following string to the BizagiCaseJSON variable,

“{“”xpath“”: “”mRPASupport.kmRPAIncomingEmail.sFrom“”,””type“”:””VarChar“”,””value“”: “””+From+”””},

{“”xpath“”: “”mRPASupport.kmRPAIncomingEmail.sSubject“”,””type“”:””VarChar“”,””value“”: “””+Subject+”””},

{“”xpath“”: “”mRPASupport.kmRPAIncomingEmail.sBody“”,””type“”:””VarChar“”,””value“”: “””+Body+”””}”

The JSON contains all the information we want to pass to the new Bizagi Case (From, Subject, and Body). Include here all the data you want to pass.

Hint: Empty fields will throw an error: Create Case: Could not create case for process id […]. Object reference not set to an instance of an object.

This is a list of multiple JSON objects separated by comma. Each JSON object must contain these 3 attributes: xpath, type, and value.

Hint: Use ” (double quote) as an escape character.

Hint: To find all possible OData data types please refer to this Bizagi link.

Assign the name of the Bizagi process to the BizagiProcessName variable. In this example, the name is RPA Support.

Configure the Bizagi Create Case activity as in the image below:

Bizagi Create Case

The number of the new Bizagi case is saved into the BizagiCaseNumber variable. Use the variable to display it on the screen using a Message Box activity.

Message Box

“A new Bizagi case was created (“+BizagiCaseNumber+”)”

… and we’re done. The UiPath automation is completed. All we have to do now is to complete the Bizagi process. Let’s do this!

Bizagi process

Bizagi version 11.2.3

Go to Bizagi Studio and create a new project (RPAGeek). Then create a new process (RPA Support).

Bizagi Studio 11.2.3

Design the flow as in the image below:

Bizagi workflow

Define the Data Model of the process. Set the name of the process entity as mRPASupport. Then create a new entity called mRPAIncommingEmail. This entity will store the email information. Add the following attributes:

  • sFrom (String)
  • sSubject (String)
  • sBody (String)
Bizagi data model

mRPASupport { kmRPAIncomingEmail }; mRPAIncomingEmail { sBody, sFrom, sSubject }

The next step is to create the necessary forms: one on the Start event and the second one on the user activity New Request for Support.

The start form must contain all the fields you are passing into your JSON. Otherwise, you will get an error Forbidden ‘{forbiddenFields}’ Fields were sent.

Start form

The second form displays the information passed by the UiPath robot.

Email vizualization form

If you like, the process can be extended to a more complex degree. For this tutorial, I decided to go with a simple flow. I haven’t configured the Performers for the user task and also I haven’t configured the security of the application.

Now let’s test it

I sent an email with the following information:

Test email

The Robot picked up the new email, read it’s content and created a new case in Bizagi.

Confirmation message

… and a new Bizagi case was created (case number 103)

Bizagi case
Details of the Bizagi case

Download the solution

Click on the button below to download the source of the demo. The ZIP file contains the UiPath automation and the database backup of the Bizagi project.

About Valeriu B

RPA Developer (UiPath certified)