I have a job that restarts the machine due to an error. I want to start a new job afterwards with the job start activity, but I need a delay before the new job starts. Otherwise, the new job starts immediately and does not wait for the machine to restart. So an error occurs.
I have tried creating an item in a queue that has a trigger, but that would also start immediately, or does not work with a deferred item.
The problem is, that after the restart-job the orchestrator starts the next job immidieatly, not after the restart. Some seconds later, the machine restarts and the UiPath-robot-service stops with an error. So the new job fails and won’t start after the machine restart. If I do a delay in the restart job, this job will end with an error, as the UiPath-robot-service is terminated.
And I don’t want to produce errors if I can avoid that.
I solved it with a second robot machine: The restart-job produces a queue item with defer-time 2 minutes. While checking all queues, a second robot finds that item and sends a ‘start job’ for the restarting machine.
With theese 2 minutes delay, the UiPath-service is stopped and the new job is started, when the machine is restarted. So I don’t get any errors.
It works, but is not what I wanted, because you need some more machines looking for each other. If all machines have a problem, they won’t restart each other.
I wondered if it is possible to create a trigger by the orchestror API with the date/time you need and use it to start job. But in my swagger I can’t find anything about the triggers. So I don’t a better solution than mine using a second machine.