Starting job via Orchestrator API - stuck in PENDING state

I’m able to create job using StartJob API ( https://platform.uipath.com/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs) however it does not execute at all and stuck in Pending state.
Also, when I try to initiate another one it does not create another entry on the job list.
I’m using Postman by the way just for testing.

Below are the parameters I’ve supplied, is there anything I’m missing?
image

UPDATE:
My mistake. I specified the wrong robot ID.
On the job capacity though, per testing, I can only queue up at most 2 jobs when continuously initiating job thru API. Starting at the third one it won’t create new entry on the job list.

Hi,

I’m new to Uipath API. Any sample code to start a job with API would be great help …I need to you that in my process

Hi,
Assuming you already have a package that is published into the Orchestrator, all setup and ready to be started remotely, first I suggest you learn the flow of API calls when ‘Starting a UiPath job’ via orchestrator. For this part you can use API tools such as Postman to easily do mock api calls or just use Swagger api for Orchestrator. *Note you have to be logged in to platform.uipath.com.

Basically, here are the high level steps or flow of API call you need to start a job and the associated [METHODS] (e.g. GET, POST, etc)

  1. [POST] Authenticate using your Orchestrator credentials in the body. Copy the token/results in the response.

2.1. [GET] Using the token in step 1, get your list of PROCESSES (e.g. automation workflow package pusblished in orchestrator) and get its ID

2.2 [GET] Still using your token in step 1. Get list of available robots (connected to machine) or specific robot you want and get its ID.

  1. [POST] Start your job using the process ID, robot ID and the same token you used for the previous calls.

Now as for the code, if you are using .NET, specifically C#, you could start by learning how to make calls to a REST API.

Thanks and hope this helps.
Russel

1 Like

Hi @zell12,

Did you solve the issue with only 2 jobs are allowed?

You can, but it should be allocated to another robot.

So you just make dynamic allocation? But if you are out of available robots, then jobs through the API will just be declined?

Did you got an answer?

Yes. Jobs will be declined if already in status pending.