Disconnecting bot from orchestrator

Hi @plobo,

Thanks a lot for your reply. We have tried the API mentioned by you but it isn’t releasing the license. Please find below details on the problem statement & solutions explored so far to release Unattended Bot license from workstation with the help of API calls:

Problem Statement: To be able to release the unattended bot license from a workstation & assign the license to a bot running on a different workstation, without accessing workstations to connect / disconnect robots manually. Target is to use a single floating unattended bot license & run the process sequentially from 5 different workstations.

Planned steps for execution:
• Assign license to bot running on Machine 1
• Run the process
• Release license from bot running on Machine 1
• Assign license to bot running on Machine 2
• Run the process
• Release license from bot running on Machine 2
• Repeat the process for 3 more machines.

Assigning & Releasing license needs to be handled either with help of API calls or any other programmatic solution without requiring manual intervention to connect / disconnect robots.

Solutions explored so far: We have explored Orchestrator API calls which allows us to Enable or Disable a Machine, so that the Robots connected to it do not consume NonProduction/Unattended licenses. We also have explored Orchestrator API calls which allows us to Enable or Disable a Robot.

Activity Used: Orchestator HTTP Request

Solution 1–>Enabling or Disabling a Machine:

Relative Endpoint: “/odata/LicensesRuntime(‘MachineName’)/UiPath.Server.Configuration.OData.ToggleEnabled”
JSON Payload:
{
“key”: “MachineName”,
“robotType”: “Unattended”,
“enabled”: false
}

Method: Post
Response:
• Status Code returned by the above request was 200, which suggest that the request was correct & was successfully executed.
• The machine did get disabled as shown in below screenshot but the bot on machine didn’t get disconnected & the license wasn’t released in this case.
image
• As per API documentation, once a machine is disabled, the Robots connected to it do not consume NonProduction/Unattended licenses. But the license isn’t getting released in this case.

Solution 2–>Enabling or Disabling a Robot Approach:

Relative Endpoint: “/odata/Robots/UiPath.Server.Configuration.OData.ToggleEnabledStatus”
JSON Payload:
{
“robotIds”: [
XXXXXX
],
“enabled”: false
}
Note: ‘XXXXXX’ used in above JSON Payload is the Robot ID

Method: Post
Response:
• Status Code returned by the above request was 200, which suggest that the request was correct & was successfully executed.
• The robot did get disabled as shown in below screenshot

• The bot on machine didn’t get disconnected but shows as Unlicensed. Please refer to below screenshot for more details.

• Even though the bot shows as Unlicensed but the license wasn’t released in this case. If we visit the License page on Orchestrator, we get to see that the Bot status still shows as Active & Licensed. Please refer to below screenshot for more details:

• Bot continues to consume the license until we manually disconnect the Robot / Deactivate the Robot from Orchestrator / stop UiPathRobotService.

It will be of great help if you could help us to release license either with the help of API calls or any other programmatic solution without requiring manual intervention to connect / disconnect robots.

Please let me know if any further information is needed.

Have a great day :slight_smile:

Thanks @RShimpukade for the detailed explanation. I am trying something similar. I will let you know how it goes.

@RShimpukade - I am trying to disable the machines and tried the following solution, I keep getting 403 error, though I have Admin rights. (I have Admin, Developer and Robot roles assigned). Any thoughts on what could be the issue?

Solution 1–>Enabling or Disabling a Machine:

Relative Endpoint: “/odata/LicensesRuntime(‘MachineName’)/UiPath.Server.Configuration.OData.ToggleEnabled”
JSON Payload:
{
“key”: “MachineName”,
“robotType”: “Unattended”,
“enabled”: false
}

Method: Post
Response:
• Status Code returned by the above request was 200, which suggest that the request was correct & was successfully executed.
• The machine did get disabled as shown in below screenshot but the bot on machine didn’t get disconnected & the license wasn’t released in this case.

Hi
How does the above solution work for Machine Templates?
Do you give the name of the Machine Template or Robot?

Can’t seem to get this work? Any help appreciated.

Regards
Davendra

Unattended - License is consumed by the machine according to the runtime capacity - you need to toggle the machine off in Licensing page to release the license.

Isn’t this working?

It wants name from 1 or 2 column ?

Cause if you provide Machine - it returns “Invalid machine name”

if you provide Template - nothing happens with code=200

1 Like

Confirming the same behavior @Bohdan_Levandivskyy1 described. Has someone found the correct call construction for this endpoint when using modern folders?

Hello all,

These steps solved me to connect the robot successfully again:

  1. Turn off UiPath Assistant
  2. Stop all UiPath services(I had 3 of them) from Windows Services - must be ran as Administrator
  3. Kill all tasks related to UiPath in Task Manager
  4. Start again services that you have disabled in 2.
  5. Start UiPath Assistant as Administrator

I tried all the steps mentioned in the post and still not able to toggle the license. I am getting the below response to my post request from postman :

{“message”:“; toggleMachineLicenseParameters must not be null”,“errorCode”:0,“traceId”:“00xxxxxxxxxxxxxxxxxxxxxxxxxx:”}

Any idea what is this toggleMachineLicenseParameters ?? I can not find this on the Swagger page documentation either.