Get Pending Jobs Robot Alloaction

Trying to set something up so if a job is pending with a higher priority the current running job will request stop and start a new one to resume after the other takes priority.

With the get pending Jobs API call I’m trying to get what machine the pending job is allocated to but the HostName is always null so cant tell if its waiting for the current machine. Anyone ever found a work around?

@TomJones

When it is pending obviously hostname woukd be emoty…what will you do with hostname for pending ones?

you need the running job details ideally

and machine name and user would help here

cheers

The job thats pending, if its the same machine than the one that is currently running it would stop.
For example

  • robot is on Machine 01, if job is pending to use 02, no need to stop and would continue as usual

  • robot is on Machine 02, if job is pending to use 02, job will stop and allow higher priority to start.

The HostName should be populated if its running or not, the status of the job denotes if its actually currently active or not

@TomJones

but in multi bot machine is decided based on availability and then host would come

instead why not see if a job with same name is already running then end pending job

cheers

This is in an estate with now 15ish processes, some need to run on specific machines at specific times, the requirement is to see if the machine the process is currently on is needed by a more urgent process, if so allow it through and add itself to start afterwards.

If priority in orchestrator was more flexible it could be achieved without needing this, I’m just confused why the Machine a pending item is assigned to isn’t exposed through the API using /odata/Jobs?expand=fields&$filter=State eq ‘Pending’.

The arguments are there, and in orchestrator you can see the machine and user mapping it is assigned to but not in the JSON.

@TomJones

you need to get the trigger to get those details…like see the gob…find trigger…and then get details

as in pendign state nothing would be assigned as it would still be waiting for th pool even if it is assigned in trigger

cheers

I did think about trigger, but if there was more than 1 trigger for a job it complicates it, just don’t know why all the details aren’t exposed.

Very similar to how priority in there are I think or 10 levels ow, but the API only shows low medium and high. They need to flesh the get jobs out a little

@TomJones

the problem here is differet as even on orchestrator hostname and all are not displayed because it is still pending

as you said there there is more than one machine group then it should wait to check which machine is free rather than choosing 1 and waiting for it

going through trigger is complex may be few mre filters are to be added

cheers

  1. Runtime details
  • Start Time: 16/05/2024, 15:21:19
  • End Time: N/A
  • Machine template: XXX-AXS-AAA05
  • Robot: rbqbaymax-unattended
  • Account: rbqbaymax
  • Hostname: XXX-AXS-AAA05
  • keyboard_arrow_down Input Values: Object

in_blDownloadReports: false

in_TransactionStopNumber: 9999

in_strStopTime: 16:00:00

in_blCommitData: true

Output Values: null

  • Has Recording: false

The above is a pending Job in Ochestrator, it does show the machine its waiting for under HostName, that’s why I think the API is incorrect

@TomJones

but if you dont go into details then you would not see it…also in multi machine scenario also you would not see it

cheers

Is this thread still unsolved?

if you are using API’s to start jobs, JobPriority will set you up with Low Medium and High, but you can ignore parsing this parameter completely and in this scenario it will inherit the priority you set up in the orchestrator.