Start a Job using Orchestrator API

How to start the job using Orchestrator API?

In order to start a Job using API, make HTTP POST request to the below endpoint:
[Orchetsrator URL]/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Using the above HTTP POST activity, multiple jobs can be run in different Robots, in one shot.

How to make API Request:

  • Using Orchestrator HTTP Request Activity:
    • To use this Robot should be connected to Orchestrator and it does not require to authenticate the Orchestrator using Authenticate API.
    • Pass the relative endpoint in the "RelativeEndpoint" like "/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs"
    • Refer below link to know more about this:
  • Using HTTP Request Activity:
    • Robot connectivity with Orchestrator is not required and we need to authenticate the Orchestrator by making HTTP POST request to below API endpoint:
      • [Orchestrator Url]/api/Account/Authenticate
    • Its response will return a token, which is stored in the "result" key of the JSON response
    • The above parameters need to be passed in header, to make HTTP Post Request to Start Jobs API.

Description of Payload or Body :

Below is the format ,with dummy data ,of the payload that we need to pass while making HTTP Post request to Start Jobs API
{
  "startInfo": {
    "ReleaseKey": "3821CA918-C153-4995-8218-B5VA2C79694429",
    "Strategy":"Specific",
    "RobotIds": [6],
    "NoOfRobots": 0,
    '"JobsCount":0,
     "Source":" Manual",
    "InputArguments":"{'id': '1', 'table_id': 'AAA'}"
  }
}

Release Key: It is the Unique key for the process that need to be run.To fetch the release key of the process,we need to make the HTTP GET request to below API EndPoint:
[Orchestrator URL]/odata/Releases
Above request will return the data for all the process created .This can be used to fetch the release wrt to the required process name and then pass it to Start Job API.

Or

Make use of [Orchestrator URL]/odata/Releases(ID)  to get the specific release id , with respect to the Id of the Process name.

Strategy –States which Robots from the environment are being run by the process.= ['All', 'Specific', 'RobotCount', 'JobsCount']

  • ‘All’:It will start the job for the all the robot present under the associated environment.
  • ‘Specific’:Using this we can run the job on specific robot and we need to pass the robot id in the "RobotIds" array.
  • ‘RobotCount’ :This is deprecated now.So do not use .
RobotIds: 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: Deprecated

InputArguments::Input parameters in JSON format to be passed to job execution.

Refer below link to know more about in details:
[Orchestrator Url]/swagger/ui/index#!/Jobs/Jobs_StartJobs