Orchestrator Web Service - Start Job, 1 Instance, Allocate Dynamically

Hi UiPath Friends,

We are kicking off a job on orchestrator via the web service. It’s all working, basically as per the example in the documentation here - Read me

However, what I’d like to do is start it as “Allocate Dynamically” rather than target a specific robot ID, just in case that one is busy. I just want to start one instance. Any thoughts on the right things to send it?

Use strategy NumberOfRobots, pass a non-zero number and leave specific robots array as empty array.
That’s basically what StartJob activity does.

Thanks @andrzej.kniola, but I must have something wrong still.

I am sending:
{
“startInfo”: {
“ReleaseKey”: “eda84b28-65a0-489f-b9a1-495db122a35d”,
“RobotIds”: [ ],
“JobsCount”: 0,
“Strategy”: “NumberOfRobots”,
“NoOfRobots”: 1,
“Source”: “Manual”
}
}

And the response is:

{
“statusCode”: 400,
“body”: {
“message”: “Requested value ‘NoOfRobots’ was not found.”,
“errorCode”: 0,
“resourceIds”: null
},
“headers”: {
“cache-control”: “no-cache”,
“pragma”: “no-cache”,
“content-type”: “application/json; charset=utf-8”,
“expires”: “-1”,
“x-content-type-options”: “nosniff”,
“x-frame-options”: “DENY”,
“strict-transport-security”: “max-age=31536000; includeSubDomains”,
“set-cookie”: [
“; SameSite=lax”
],
“server”: “”,
“date”: “Mon, 04 Mar 2019 04:39:40 GMT”,
“connection”: “close”,
“content-length”: “90”
}
}`

Ok, looking at the new model for the StartJobs call, available here:

 inline_model_21 {
startInfo (StartProcessDto, optional)
}StartProcessDto {
ReleaseKey (string):

The unique key of the release associated with the process. ,
Strategy (string, optional):

States which robots from the environment are being run by the process. = ['All', 'Specific', 'RobotCount', 'JobsCount']stringEnum:"All", "Specific", "RobotCount", "JobsCount",
RobotIds (Array[integer], optional):

The collection of ids of specific robots selected to be run by the current process. This collection must be empty only if the start strategy is not Specific. ,
NoOfRobots (integer, optional):

DEPRECATED. Number of pending jobs to be created in the environment, for the current process. This number must be greater than 0 only if the start strategy is RobotCount. ,
JobsCount (integer, optional):

Number of pending jobs to be created in the environment, for the current process. This number must be greater than 0 only if the start strategy is JobsCount. ,
Source (string, optional):

The Source of the job starting the current process. = ['Manual', 'Schedule']stringEnum:"Manual", "Schedule",
InputArguments (string, optional):

Input parameters in JSON format to be passed to job execution.
} 

I’ve remembered wrong - the Strategy should be RobotCount, not NumberOfRobots (which is used as the property name in the activity StartJob, but not in the API).

Also these API calls have changed since I last needed to write anything against it (~2016.2) and it looks like RobotCount is deprecated now (indirectly - what’s deprecated is NoOfRobots, which is required for it to work).
Could you check with a call like this?

{
"startInfo": {
"ReleaseKey": "eda84b28-65a0-489f-b9a1-495db122a35d",
"RobotIds": [ ],
"JobsCount": 1,
"Strategy": "JobsCount",
"Source": "Manual"
}
}
2 Likes

Thanks @andrzej.kniola, that works.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.