Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

Note: This tutorial is for the older UiPath Studio 19.5. Please refer to the latest Integration with UiPath Robotic Process Automation for the latest UiPath Studio 20.10, which provides a much simplified sign in and first run experience compared to previous releases.


Table of Contents


Introduction to UiPath

...

  • Library: A process library describes a system of activities that are reusable for sharing

  • Schedule: Enables jobs to be executed in a preplanned manner

  • Asset: Usually represent shared variables or credentials that can be used in different projects.

  • Queue: A place to store multiple types of data, such as invoice information or customer details.

...

Get Started with UiPath

UiPath provides the Orchestrator API for integration.

The most commonly used function is Starting a Job, which should satisfy a majority of use cases. We will use this function in the following integration tutorial.

Get Started with UiPath

Step 1: Sign Up for UiPath Cloud Platform

Step 1: Sign Up for UiPath Cloud Platform

Let’s sign up for an account at https://www.uipath.com/platform-trial. There is a Community plan to get started for free, so we’ll Choose Community to register.

...

Using any API testing tool, submit a POSTGET request to

https://platform.uipath.com/cloudrpa/api/getAccountsForUser with a request header

...

Using any API testing tool, submit a POSTGET request to

https://platform.uipath.com/cloudrpa/api/account/[accountLogicalName]/getAllServiceInstances with a request header

...

Copy the value for serviceInstanceLogicalName from the response:

 


Code Block
[
   {
       "serviceInstanceName": "DemoDefault",
       "serviceInstanceLogicalName": "DemoDefaultzous50676",
       "serviceType": "ORCHESTRATOR",
       "serviceUrl": "https://platform-community.azurewebsites.net"
   }
]

...

https://platform.uipath.com/odata/Releases with a request headerheaders

Code Block
Authorization: Bearer [idaccess_token]
X-UIPATH-TenantName: [serviceInstanceLogicalName]

Copy the Copy the value for Key from the response:

...

Code Block
{
   "@odata.context": "https://platform.uipath.com/odata/$metadata#Jobs",
   "value": [
       {
           "Key": "e811bd29-26fb-4cc3-af91-7fd6308ca643",
           "StartTime": null,
           "EndTime": null,
           "State": "Pending",
           "Source": "Manual",
           "SourceType": "Manual",
           "BatchExecutionKey": "382e7a96-a5b9-4343-b258-26a80cf87f80",
           "Info": null,
           "CreationTime": "2019-06-12T08:02:03.2595408Z",
           "StartingScheduleId": null,
           "ReleaseName": "Demo Process",
           "Type": "Unattended",
           "InputArguments": null,
           "OutputArguments": null,
           "HostMachineName": null,
           "HasMediaRecorded": false,
           "Id": 10169582
       }
   ]
}

 


Integrate UiPath with Joget

...

Step 1: Sign Up for Joget Workflow On-Demand

If you already have your own installation of the Joget platform, you can use it and skip this step. Otherwise, you can sign up for Joget Workflow On-Demand, a hosted version of the Joget platform that allows you to quickly get started.

Image Removed

Visit https://cloud.joget.com and click on Sign Up Free to register a new account.

Image Removed

Once you have successfully verified your email, you will be linked to your own running installation of Joget Workflow where you’ll be able to visually build a full app in 30 minutes without coding.

Image Removed

...

How to Integrate with UiPath

UiPath provides the Orchestrator API for integration.

The most commonly used function is Starting a Job, which should satisfy a majority of use cases. We will use this function in the following integration tutorial.


Design a Process to Start a UiPath Job

Since the UiPath Orchestrator API is a REST API with data in JSON format, we can use the Joget JSON Tool to invoke the API.

...

  • refresh_token (Refresh Token)

  • serviceInstanceLogicalName (Service Instance Logical Name)

  • Key (Release Key)


Step 1. Design New App

First, let’s design a new app by clicking on Design New App in the Joget App Center.

...

Fill in desired values for the App ID and App Name, and click Save.


Step 2. Design New Process

Click on the Processes menu, then on the Design Process button to launch the Process Builder.

...

Click on the edit pencil icon after hovering over the process name along the top. Enter a suitable process name and create 3 workflow variables to store the response values from UiPath API call:

  • status,

  • Id_token

  • access_token 

Click on Deploy.


Step 3. Configure First Tool to Get UiPath Access Token

Once the process has been deployed, close the Process Builder. In the process view page, select the Map Tools to Plugins tab.

...

Click on Configure Plugin for the first tool and select JSON Tool, then key in the following configuration:


 

JSON URL

https://account.uipath.com/oauth/token

Call Type

POST

POST Method

Custom JSON Payload

Custom JSON Payload

{

   "grant_type": "refresh_token",

   "client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN",

   "refresh_token": "[refresh_token]"

}

 


Under Store to Workflow Variable, map the variables to store the tokens in the matching workflow variables i.e.

...


access_token

access_token

id_token

id_token

 


Click on Submit to save.


Step 4. Configure Second Tool to Start Job Using the Access Token

Click on Configure Plugin for the second tool and select JSON Tool, then key in the following configuration:


 

JSON URL

https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs 

Call Type

POST

POST Method

Custom JSON Payload

Custom JSON Payload  (Replace [Key] with the actual Release Key)

{ "startInfo":

  { "ReleaseKey": "[Key]",

    "Strategy": "All",

    "RobotIds": [ ],

    "JobsCount": 0,

    "Source": "Manual"

  }

}

Request Headers (Replace [serviceInstanceLogicalName] with the actual Service Instance Logical Name

Authorization: Bearer #variable.access_token#

X-UIPATH-TenantName: [serviceInstanceLogicalName]

 


Under Store to Workflow Variable, map the status variable to the State attribute in the response JSON  i.e.

...


status

value[0].State

 


That’s it. The Joget process has been configured to invoke the UiPath Orchestrator API to start a job.


Step 5. Run the Process

Now, let’s test the process. Click on the Run Process button at the top, then Run Process again in the confirmation dialog.

...

If you are running Joget on-premise and have access to the system logs, you will be able to see the tool requests and responses if the debugging option is enabled.

Sample log output: 

Code Block
INFO 12 Jun 2019 09:28:38 org.joget.apps.app.lib.JsonTool - POST : https://account.uipath.com/oauth/token
INFO 12 Jun 2019 09:28:38 org.joget.apps.app.lib.JsonTool - Custom JSON Payload : {_ "grant_type": "refresh_token",_ "client_id": "5v7PmPJL6FOGu6RB8I1Y4adLBhIwovQN",_ "refresh_token": "CBZcOD6vrP2FQ9qa8fuqDdfoEwnVPuR2Kpz-hitbTAIzG"_}_
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - https://account.uipath.com/oauth/token returned with status : 200
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - {"access_token":"eyJ0eX...","scope":"openid profile email offline_access","expires_in":86400,"token_type":"Bearer"}
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - POST : https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - Custom JSON Payload : { "startInfo":_ { "ReleaseKey": "b27c7363-459c-4520-bae5-660d4a1d3813",_ "Strategy": "All",_ "RobotIds": [ ],_ "JobsCount": 0,_ "Source": "Manual" _ } _}_
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - Adding request header Authorization : Bearer eyJ0eX...
INFO 12 Jun 2019 09:28:39 org.joget.apps.app.lib.JsonTool - Adding request header X-UIPATH-TenantName : DemoDefaultzous50676
INFO 12 Jun 2019 09:28:40 org.joget.apps.app.lib.JsonTool - https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs returned with status : 201
INFO 12 Jun 2019 09:28:40 org.joget.apps.app.lib.JsonTool - {"@odata.context":"https://platform.uipath.com/odata/$metadata#Jobs","value":[{"Key":"aa667a3e-04f9-4013-a8eb-ce701dac8799","StartTime":null,"EndTime":null,"State":"Pending","Source":"Manual","SourceType":"Manual","BatchExecutionKey":"68fa4d0a-0fcc-4d49-ae0d-b6631a7dfc78","Info":null,"CreationTime":"2019-06-12T09:28:12.9207318Z","StartingScheduleId":null,"ReleaseName":"Demo Process","Type":"Unattended","InputArguments":null,"OutputArguments":null,"HostMachineName":null,"HasMediaRecorded":false,"Id":10173064}]}

...

Back at the UiPath Orchestrator and UiPath Robot, you would also be able to monitor the execution of the job.

Sample Joget App

The sample app containing this process can be downloaded below:

...