Hi!
If you’ve been wondering how to increase the efficiency of your Robots at work through the most effective process management, you’ve come to the right place.
In my company, I have prepared a solution that maximizes the use of licenses by filling free spaces on machines by running selected processes (fast or high-volume).
This solution has been working in my company since February 2020 and I would like to share this project with you.
The presented process is only the skeleton (frame) of the working Robot, where the entire logical layer is located.
Much will depend on you, because the Robot is built based on API communication with the Orchestrator. What you will have to do is prepare communication for specific 9 API services:
GET / odata / ProcessSchedules / UiPath.Server.Configuration.OData.GetRobotIdsForSchedule(key=//key})
You can learn how to create such a web service here:
Documentation
Name: Process_Scheduler
Purpose
Running processes (Job) on machines that have the status READY (not working) from previously prepared Triggers for a specified time, ie. until the next scheduled start of another process.
Mode of Action
Specification
- The process uses API queries to communicate with the Orchestrator PROD database (equivalent of queries available in SWAGGER: https: //orchestrator.domain/swagger/ui/index#/ ).
- After starting:
- you can verify the selected queue;
- If the number of new transactions in the indicated queue = 0, the robot exits.
- Machine states are checked.
- Machines in the READY state (not working) are processed further
- The machine is available;
- When the next scheduled process (Job) will start later than the previously defined minimum time ( e.g. 15 minutes machine availability), a trigger will be prepared which:
- will be modified in terms of the process runtime (setting the time when the process is to end),
- will be modified in terms of the start time (setting the start at a specific time (date and time)) - one-time start ,
- will be enabled to start the Process.
Functions
Specification
- ability to run on any process previously prepared schedule (Trigger)
- the ability to verify the queue whether it contains ‘New’ transactions (so as not to generate empty runs of triggered processes when new transactions = 0 )
Requirements
Specification
- Specification of the Machines on which the process is to start in the format: machine1 | machine2
- separated by the sign: | ( pipe )
- *e.g. VM0000xxx | VM0000xxx | VM0000xxx
- The Machine Name is also the SUFFIX name of the Trigger
- e.g .: Rxxx_Scheduler_R???_ VM0000xxx
- Specifying the Trigger Name ( PREFIX )
- e.g .: Rxxx_Scheduler_R???_
- Specification of the minimum machine availability time in seconds
- e.g. 900 (i.e. 15 min)
- Specifying the name of the queue to be checked (optional)
- default phrase: none
- or for example: Claims_ABC
Reports network location
\\ your_server \ your_Report_Folder_location
ASSET Orchestrator Settings
Trigger Preparation
Specification
- Trigger Name:
- PREFIX + SUFFIX
- e.g. Rxxx_Scheduler_R???_VM0000000
- Robot term as in the name of the Trigger
- e.g. VM000000x
- After saving, the Trigger should be turned off
- Other parameters irrelevant (the robot will make the necessary adjustments)
Sample report
Table view
State MachineName Status Trigger ID Enabled OK VM0000xxx BUSY OK VM0000xxx BUSY ??? VM0000xxx The time interval is too short. Rxxx_Scheduler_R???_ VM0000xxx 1 NO OK VM0000xxx BUSY OK VM0000xxx BUSY ??? VM0000xxx The time interval is too short. Rxxx_Scheduler_R???_ VM0000xxx 2 NO OK VM0000xxx BUSY OK VM0000xxx BUSY
Process map
UiPath Project & Orchestrator Swagger Screenshots
Authenticate:
GET Queue Definitions:
GET Queue Processing Records Stats:
GET Process Schedule (‘Enabled’):
GET Robot Ids For Schedule:
GET / odata / ProcessSchedules / UiPath.Server.Configuration.OData.GetRobotIdsForSchedule(key={key}) settings
GET Robots (1: by ID):
GET Sessions (available):
GET Process Schedule by Schedule Name:
GET Robots (2: by Machine Name):
PUT Process Schedules (Edit):
POST Process Schedule Set Enabled:
Arguments
List of Type of Arguments in process
"arguments": {
"input": [
{
"name": "bearerToken",
"type": "System.String",
},``
{``
"name": "getJobsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfJobDto",
},
{
"name": "getRobotsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfRobotDto",
},
{
"name": "getRobotLogsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfLogDto",
},
{
"name": "getQPRResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfQueueProcessingRecordDto",
},
{
"name": "getQDefResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfQueueDefinitionDto",
},
{
"name": "getQueueStatsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfQueueProcessingStatusDto",
},
{
"name": "getSessionsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfSessionDto",
},
{
"name": "getReleasesResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfReleaseDto",
},
{
"name": "getPSResponse",
"type": "UiPathWebApiNamespace.ProcessScheduleDto",
},
{
"name": "getEnaDisaResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfBoolean",
},
{
"name": "getRobotIdsResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfInt64",
},
{
"name": "getPSchedResponse",
"type": "UiPathWebApiNamespace.ODataResponseOfListOfProcessScheduleDto",
},
{
"name": "getPutPSchedResponse",
"type": "UiPathWebApiNamespace.ProcessScheduleDto",
}
}
Workflow
Process_Scheduler_UiPath_Forum.7z (41,0 KB)
Workflow includes:
- Main process as logic
- Create_CRON.xaml - workflow to create CRON expression based on the given date