In this detailed post, Report Queue Data in UiPath from Orchestrator I will cover:
- How to use Orchestrator API to get Queues Data
- How to use Orchestrator API to get Queues Data without additional authentication
- Get required fields from queues column mapping
- Create a formatted report
Lets get started !
Background /Introduction
Queue are perfect way to work upon in case you have same set transaction that need to be applied on various items that you want to process by Robot.
Its also help in ensuring the automatic workload distribution across the robots in case you need multiple robot to work on your use case…
But the most important part is reporting the processing done by ROB after completion of job…
Lets say for example you need to know how many Data-items or Cases have been processed by robot for EOD reporting…
Recently… I was working on process where we need to perform task on several hundred items every day and for ROI computation and effectiveness of ROB we need to report the Queues data back to business.
You must be wondering why we need to worry about this when we have Kibana + Elastic search enabled with UiPath Infrastructure, so we can straight away go and create Data Visualization …
There could be other approach to report data such as storing the transactions logs or creating excel inside the process itself and send the report once the jobs finished.
Other way could be from Orchestrator, As the Information stored in queue items is displayed in Orchestrator, in the Transaction Details window, under Specific Data. Additionally, if the item failed and was retried, the history of the item is displayed in the same window.
We can export all the transactions and information related to a given queue to a .csv file, by clicking the Export export_button button, in the Transactions page. All page filtering options apply to the generated file, too.
But we took different Approach …
We used Orchestrator API to get required Reports and send it to Business over email…It all depends on how you going to further use that export as input …
Alright !
Lets see how we can use , Orchestrator API to Get Queue Data based on Filters & Generate the report in required format.
How to use Orchestrator API to get Queues Data
You got two different ways of using Orchestrator API to get Queue Data.
- Using the Orchestrator HTTP Request Activity (You don’t need additional Auth Mechanism )
- Using the HTTP Request to UiPath.WebApi endpoints using specified credentials.
There is also difference in End Points exposed by UiPath.WebApi based on your Orchestrator instance(For Authentication).
For example if you are using cloud.uipath.com(Community edition) you need to connect using USERKEY, ACCOUNTLOGICALNAME,TENANTLOGICALNAME,CLIENTID to get Auth Token for subsequent API call
Same can be obtained from services page of your Orchestrator instance.
In-case you are using Enterprise Edition/on-perm in that case you need to authenticate based on TENANCYNAME, USERNAME/EMAIL, PASSWORD to get Auth Token for hitting API endpoints.
Steps to Get Queue Data (When Using HTTP Request )
- Identify you Orchestrator instance Type
- Get Auth Token by using Appropriate Authentication of the user (based on user name and password in case on-perm or based on API keys if community edition)
- Find Queue ID using Queue Name (Optional in case you don’t have same Queue Name in multiple Tenants )
- Get Queue Items As JSON output
- Perform Data filtration & Write Data to report format.
Steps to Get Queue Data (When Using Orchestrator HTTP Request Activity )
UiPath.Core.Activities.OrchestratorHttpRequest
Performs HTTP requests to the Orchestrator API by authenticating under the Robot it is executed on. So you don’t need Steps rquired for getting Auth Token. So your steps would become…
- Find Queue ID using Queue Name (Optional in case you don’t have same Queue Name in multiple Tenants )
- Get Queue Items As JSON output
- Perform Data filtration & Write Data to report format.
Please note that for each request you might need different rights on the Orchestrator Robot role, depending on what requests you are doing, and the Robot has to be connected to Orchestrator.
Detailed Explanation of Working Example.
Download Working Example
You can clone github repo to start using the code snippet by amending the required config values.
Do let me know in-case you face any issues while implementing in your workflow.
References –