How to integrate with UIPath robots
Scenario: You have an unattended UIPath robot that executes some actions. These actions can now include PROCESIO. And the robot itself can also be started from PROCESIO.
Attended robots cannot be controlled from an external source, including PROCESIO.
In this scenario we have three elements:
- UIPath robot
- A process started by the robot
- A process that can start the robot
In this example we create a simple unattended robot in UIPath Automation Cloud. If you have an unattended robot already created you can use it instead.
Step 1. Go to "Orchestrator", select Tenant folder and in the "Machines" tab press the Add machine button and select Standard machine.
Step 2. Configure the machine, allocate 1 Production (Unattended) license and press the Provision button.
Step 3. Select the Shared folder, go to "Home" tab, press the Machines group and press the Manage Machines in Folder button.
Step 4. Select the machine you added and press the Update button.
Step 5. Use the Copy Machine Key to Clipboard button or the ... button to select Edit Machine and copy the Machine key.
The machine key configured in the UIPath Orchestrator will be used when configuring the unattended robot machine.
Step 1. Go to "Admin" -> "Accounts & Groups" and in "Users" tab press the Invite Users button.
Step 2. Add an email address for an unattended user, select Automation Developers and press the Invite button.
The user email address does not have to be valid. It will work even if the invite is not accepted.
Step 3. Press the Allocate Licenses button, select Automation Developer - Named User and press Save.
Step 1. Go to "Orchestrator", select Shared folder and in the "Home" tab press the Users group.
Step 2. Press the Assign Account/Group button.
Step 3. In the "Account or Group name" field search for the robot user you created and select it.
Step 4. In "The Roles for the account selected above" select Robot and press Save.
Step 5. Press the More Actions button next to the robot user and select Edit.
Step 6. In User & Roles press the Next button and toggle Unattended Robot to Enabled.
Step 7. Check Machine login credentials and configure the Domain\Username and Password used by the robot to run the process.
The robot uses Windows credentials by default. In this case you only need a Windows user with a password. And domain is the machine name:
Domain\Username: <machine_name>\<username>
You can find the machine name in "Control Panel" -> "System and Security" -> "System" -> Computer name.
Step 8. Press the Update button to add the changes.
In this example we are configuring a new machine for the robot. If you have a machine already configured you can use it instead.
Step 1. Prepare a Windows machine with a local user account that is password protected.
Step 2. Download on this machine UIPath Studio from the "Home" page in UIPath Automation Cloud.
Step 3. Install UIPath Studio and select Custom (recommended for Enterprise/Advanced Users) during the install process.
Step 4. Select Unattended Robot for the installation package and press the Install button.
Step 5. When installation is completed close the installer.
Step 6. Find the UIPath Assistant application using the Start button or search bar, right-click it and select Run as administrator.
Step 7. In UIPath Assistant press the user icon on the title bar and select Preferences.
Step 8. In Preferences select Orchestrator Settings and copy/paste your UIPath Orchestrator URL. The URL should use this format: https://cloud.uipath.com/<your_account>/<your_tenant>/orchestrator_
Step 9. In Machine Key paste the machine key you saved when you created the machine in UIPath Automation Cloud. Then press the Connect button.
Once the UIPath Assistant is connected the UIPath robot can use it to execute processes.
Once a process is configured in PROCESIO you can access it through the Web API. Read more details in the PROCESIO API Documentation article.
Step 1. In PROCESIO "Process Designer" configure your process and save it. Run the process to check it works correctly.
Step 2. Copy the process ID from the "Process Designer" page URL and save it for later. The URL uses this format: https://procesio.app/admin/process/designer/<process_id>.
Step 3. In PROCESIO go to "Settings", select the API Key tab and press the Create api key button.
Step 4. Copy both the Key name and Key value and save them for later. They will be used in UIPath to access the PROCESIO Web API.
Step 1. Go to UIPath Automation Cloud, login and download UIPath Studio from the home page.
Step 2. Install UIPath Studio using the Quick (recommended for Community Users) option.
Step 3. Launch UIPath Studio and in the "New Project" tab select Process.
Step 4. Configure the project information, press the Create button and click Open Main Workflow in the center of the page when finished.
Step 5. Press Manage Packages button in the toolbar, select "Official" in the left menu and search for UiPath.WebAPI.Activities. Once found select it and press the Install and Save buttons.
Step 6. In Activities search for HTTP Request. Once found under "Available" -> "App Integration" -> "Web" drag it on the main workflow.
Step 7. Use HTTP Request Wizard to configure the API call to PROCESIO using the process ID you saved:
- End point: "https://webapi.procesio.app/api/Projects/<process_id>/run"
- Request Method: POST
Step 8. After pressing the Ok button go to Properties pane to add the rest of the API information.
Step 9. In "Options" group set the following values:
- Body: "{\n\"connectionId\": \"string\"\n}"
- Body format: application/json
- Headers:
Name | Direction | Type | Value |
---|---|---|---|
key | In | String | the Key name you saved, in quotes (eg: "<key>") |
value | In | String | the Key value you saved, in quotes (eg: "<value>") |
- Parameters:
Name | Direction | Type | Value |
---|---|---|---|
runSynchronous | In | String | "true" |
secondsTimeOut | In | String | "10" |
Step 10. Debug the project.
Step 11. Go to PROCESIO, select "Process Designer", press the ... button next to your process and select View Instances. Check if the process was started by UIPath.
Step 12. Once the PROCESIO process is started from UIPath press the Publish button in UIPath Studio.
Step 13. In Publish Process dialog configure the Package Name and Version. Then select "Publish options" in the left menu and in Publish to select Orchestrator Tenant Processes Feed.
Step 14. Press the Publish button when ready to add the process to UIPath Automation Cloud.
Step 1. Go to UIPath Automation Cloud and select "Orchestrator".
Step 2. Select the Shared folder, press the Processes group and press the Add process button.
Step 3. In Package Overview click the Package Source Name field, search for the published process and select it.
Step 4. Press the Next button until the last page and then press the Create button.
You can now start the process using the robot.
Step 1. In UIPath Automation Cloud go to "Orchestrator", select Shared folder and press the Processes group.
Step 2. Press the Start a Job button next to the process.
Step 3. In the Execution Target tab use the Account field to select the robot user created at the start of this guide. Also use the Machine field to select the machine you configured.
Step 4. In the Runtime license field select Production (Unattended).
Step 5. Press the Start button.
Any UIPath unattended robot can be started by a PROCESIO process. Here are the steps involved:
Step 1. Go to UIPath Automation Cloud and select "Admin".
Step 2. Select External Application and press the Add Application button.
Step 3. In the Add Application page set the Application Name and press the Add Scopes button.
Step 4. In the Edit Resource panel click on the Resource field and select Orchestrator API Access.
Step 5. Select Application Scope(s), search execution and check OR.Execution. Also search jobs and check OR.Jobs.
Step 6. Press the Save button to close and panel and the Add button to add the application.
Step 7. Copy and save the App ID and App Secret and press the Close button.
There are multiple actions involved in starting an UIPath robot. The complete process should look like this:
Step 1. Go to "Process Designer", create a new process and save it.
Step 2. Add a Call API Action and in the side panel set the Node name to RefreshToken.
Step 3. Go to "Credential Manager", press the Add new button and use these values:
Name: UIPathRefreshToken Credential type: REST API Configuration
Step 4. Press the Next step button and use these values:
URL: https://account.uipath.com/oauth/ Method: GET Test endpoint: token Authentication method: No authentication
Step 5. Press the Save button, go to "Process Designer" and edit the process created at Step 1.
Step 6. Select the RefreshToken action to show the side panel. In Select API configuration select UIPathRefreshToken.
Step 7. Press the Configure Request button and add these values:
Verb: POST Endpoint: /oauth/token Headers:
Key | Value |
---|---|
X-UIPATH-TenantName | <your_tenant> |
Your tenant name can be copied from the UIPath Automation Cloud Orchestrator URL. The URL uses this format: https://cloud.uipath.com/<your_account>/<your_tenant>/orchestrator_
Body:
Client ID and User Key can be found in UIPath Automation Cloud: "Admin" -> "Tenants" -> expand your tenant -> Orchestrator "API Access" button (cloud icon).
Step 8. Go to "Data Model Designer" and press the Create data model button.
Step 9. In Display name write UIPathTokenResponse and press the Create button.
Step 10. Use the Add attribute button to add these attributes:
Display name | Name | Type | Single value | JSON property |
---|---|---|---|---|
access_token | access_token | String | ✔ | access_token |
token_type | token_type | String | ✔ | token_type |
Step 11. Use the Create data model button and in Display name write UIPathRelease.
Step 12. Use the Add attribute button to add these attributes:
Display name | Name | Type | Single value | JSON property |
---|---|---|---|---|
Key | key | String | ✔ | Key |
Name | name | String | ✔ | Name |
OrganizationUnitId | organizationUnitId | Integer | ✔ | OrganizationUnitId |
Step 13. Use the Create data model button and in Display name write UIPathReleasesResponse.
Step 14. Use the Add attribute button to add this attribute:
Display name | Name | Type | Single value | JSON property |
---|---|---|---|---|
value | value | UIPathRelease | ❌ (List) | value |
Step 15. Go to "Process Designer" and edit the process created at Step 1.
Step 16. Add a new variable in the process:
Name | Type | Default value | Single value | Set as |
---|---|---|---|---|
refreshTokenResponse | UIPathTokenResponse | | ✔ | Output |
Step 17. Select the RefreshToken action, press the Configure Request button and in Body Output add the refreshTokenResponse variable.
Step 18. Add a Map Process Data action and in the side panel set the Node name to PrepareAuth.
Step 19. Press the Map Process Data button and add the following variables:
AuthorizationValue <- refreshTokenResponse.token_type refreshTokenResponse.access_token
There is a space (' ') between token_type and access_token. Token_type will be Bearer and access_token your authorization token.
Step 20. Go to "Credential Manager", press the Add new button and use these values:
Name: UIPathReleases Credential type: REST API Configuration
Step 21. Press the Next step button and use these values:
URL: https://cloud.uipath.com/<your_account>/<your_tenant>/odata/ Method: GET Test endpoint: Releases Authentication method: No authentication
Your account and tenant names can be copied from the UIPath Automation Cloud Orchestrator URL. The URL uses this format: https://cloud.uipath.com/<your_account>/<your_tenant>/orchestrator_
Step 22. Press the Save button, go to "Process Designer" and edit the process created at Step 1.
Step 23. Add a new variable in the process:
Name | Type | Default value | Single value | Set as |
---|---|---|---|---|
releasesResponse | UIPathReleasesResponse | | ✔ | Output |
Step 24. Add a Call API Action and in the side panel set the Node name to GetReleases. In Select API configuration select UIPathReleases.
Step 25. Press the Configure Request button and add these values:
Verb: GET Endpoint: /Releases Body output: releasesResponse variable Headers:
Key | Value |
---|---|
X-UIPATH-TenantName | <your_tenant> |
X-UIPATH-OrganizationUnitId | <your_organization_unit_id> |
Authorization | AuthorizationValue (variable from Step 19.) |
X-UIPATH-OrganizationUnitId can be retrived by calling the Releases endpoint without the X-UIPATH-OrganizationUnitId header: - remove the X-UIPATH-OrganizationUnitId from the GetReleases action - run the process and in the Check instance page copy the value of the releasesResponse variable - in this value each process will contain the OrganizationUnitId value - copy the OrganizationUnitId for your process and add it for X-UIPATH-OrganizationUnitId in the GetReleases action Headers
Step 26. Add a new variable in the process:
Name | Type | Default value | Single value | Set as |
---|---|---|---|---|
filteredReleases | UIPathRelease | | ❌ (List) | Output |
Step 27. Add a Beta -> List filter action and in the side panel set the Node name to FilterReleases.
Step 28. Press the Configure button and add these values:
List to filter: releasesResponse.value variable Filtered list: filteredReleases variable Filter JSON configuration:
You can find the UIPath process name in UIPath Automation Cloud -> Orchestrator -> Shared -> Processes.
Step 29. Add a new variable in the process:
Name | Type | Default value | Single value | Set as |
---|---|---|---|---|
releaseInfo | UIPathRelease | | ✔ | Output |
Step 30. Add a List -> Get X Element action and in the side panel set the Node name to GetReleaseKey.
Step 31. In the side panel add these values:
Input a list: filteredReleases variable Input the index of the element: 0 Result: releaseInfo variable
Step 32. Go to "Credential Manager", press the Add new button and use these values:
Name: UIPathStartRobot Credential type: REST API Configuration
Step 33. Press the Next step button and use these values:
URL: https://cloud.uipath.com/<your_account>/<your_tenant>/odata/Jobs Method: GET Test endpoint: UiPath.Server.Configuration.OData.StartJobs Authentication method: No authentication
Your account and tenant names can be copied from the UIPath Automation Cloud Orchestrator URL. The URL uses this format: https://cloud.uipath.com/<your_account>/<your_tenant>/orchestrator_
Step 34. Press the Save button, go to "Process Designer" and edit the process created at Step 1.
Step 35. Add a Call API action and in the side panel set the Node name to StartRobot. In Select API configuration select UIPathStartRobot.
Step 36. Press the Configure Request button and add these values:
Verb: POST Endpoint: /UiPath.Server.Configuration.OData.StartJobs Headers:
Key | Value |
---|---|
Content-Type | application/json |
Authorization | AuthorizationValue (variable from Step 19.) |
X-UIPATH-TenantName | <your_tenant> |
X-UIPATH-OrganizationUnitId | <your_organization_unit_id> |
X-UIPATH-OrganizationUnitId can be retrieved as explained at Step 25.
Body:
Step 37. Connect all actions in sequence:
Step 38. Save the process, validate and Run.
Congrats! The process will now start your UIPath process using the configured robot.