Start jobs via API

jobs
api

#1

Dear community

how can I start a not scheduled job via the API? Could not find a way. Do I really have to create a schedule first? What is meant by the “ReleaseKey”? I would like to just provide a Jobname with the package :wink:


Expose the Robot in Orchestrator as a REST API
Web service
UiPath Robot called by website
#2

Hi binaer,

ReleaseKey is the Process key that you want to start.

Check out this, you’ll find all the parameters for starting a job:
https://platform.uipath.com/swagger/ui/index#!/Jobs/Jobs_StartJobs

In order to find out the ReleaseKey, you will have to Get the processes first.


Is there a way to execute UI Path scripts through Python
#3

Technically you need to get releases first.

@binaer

One handy way to display it is to simply enter to your browser (when authenticated) search bar, preferably a “modern” one such Firefox or Chrome, orchestratorurl/odata/Releases (case sensitive).

This will display you the json objects, you need to pass your startjob the queue.
Of course you can get the same result if you use http request and loop through the json results to find the key your are looking for.


This should return only the process which were deployed on your environement(s)

You can also use more advance queries using odata synthax to get specific release by name (here expected as processname_environement

orchestratorurl/Releases?$filter=Name eq ‘" & In_StrReleaseName & "’"

Cheers


Can a robot start another robot?
How to Invoke back office bot with the help of front office bot
#4

Technically you’re right.

Processes were called Releases in the first versions of Orchestrator and that’s why it might get confusing. :worried:


#5

thanks guys, that worked…

  1. Authentication
  2. Get Releases
  3. StartJob

:slight_smile:


#6

Hii @binaer,
Can you please brief out how you performed the 3 steps, as even i have to do the same.
Thanks


#7

Hi,
Can someone help on how we can pass the parameters to process start API?


#8

Hi,

Can anyone please elaborate with example how exactly a ReleaseKey looks like in the parameters to
/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs

Given below is the swagger documentation for API and I am getting ERROR when calling with ReleaseKey as “ProcessName:Version”

All the existing entries in Jobs or when looking into the Jobs table itself, the keys look as follows.
dfc91c10-b90f-42c2-bc38-1b5323355db9


#9

hi

still required? Message me… apologies for the delayed answer, have not checked the forum for a while


#10

Hi binaer,

Thanks for responding.
Yes, can you provide an actual example of the startInfo or ReleaseKey, how it looks when passed to StartJobs?

Regards,
Vijay


#11

Finally, it works as follows.

  1. Get the authentication token as normal.
  2. Get the Releases by calling odata/Releases
  3. Pick the ‘Key’ corresponding to the process we are interested to run StartJobs
  4. Then, assemble the json for startInfo to call StartJobs as follows (example)
    {
    “startInfo”: {
    “RobotIds”: [
    19
    ],
    “NoOfRobots”: 0,
    “Strategy”: “Specific”,
    “ReleaseKey”: “39c12b32-4547-495e-87b2-52f70f747840”
    }
    }
  5. It worked only after making NoOfRobots to 0. More details shall be read from the Model and Examples of the swagger documentation provided by API.

The missing link/ clarity here is that, nowhere it’s clearly explained in the documentation the Key to be used in calling StartJobs is the Release key (Processes).


#12

The missing link/ clarity here is that, nowhere it’s clearly explained in the documentation the Key to be used in calling StartJobs is the Release key (Processes).

I don’t know why, but I get this feeling every time I’m trying to use the UiPath documentation. Not suitable.


#13

Sample implementation of Start Job API
GetReleaseAPI.xaml (9.3 KB)
StartJob.xaml (7.7 KB)
LoginAPI.xaml (9.7 KB)
StartJobAPI.xaml (9.6 KB)


#14

scottl, so you are using UiPath GUI to use UiPath API?
I thought, when using REST API you would be using something else. Please let me know if I am missing something here.


#15

There are some functions that are not supported directly by UIPath. For example, dependency scheduling is not supported (e.g., start consumer job when producer job completes). So you can use the APIs to have one robot start another as the last step before it completes. Note that functionality differs by UiPath version (newer versions have more features in standard activities that replace the need for some APIs).
Also, due to corporate policies, some developers may not be able to install additional tools (e.g., Postman) so providing working examples of the API calls in existing tools is helpful to simulate an external client using APIs.


#16

Thanks scottl, for the files and clarification.
It seems, from v2018.1 of Studio, there’s also possibility for activity, “Orchestrator HTTP Request” which seems to accept the JSON payload and different REST methods. But, we need to check in detail how best to use the same.


#17

Hi @scottl,
I’ve looked to the files you’ve added and it worked fine for me in order to start a job from UiPath. But, do you have any idea about how to start a job remotly from a browser? I’ve start a new topic about it, maybe you have a great idea of yours
Thanks :slight_smile:

https://forum.uipath.com/t/http-request-to-api-orchestratror-via-angular-js/51265