Scheduled job in Orchestrator doesn't stop

orchestrator
schedule

#1

Hi,

I have scheduled a job to run after every five minute. In the ‘Actions’ tab I configure “Stop after” 35 min so the job should run for around 7 times but it never stops even after 35 min, it continue to run every 5 min.

Now to check it, I change the stop after time to 1 min only so the schedule job should not start after 5 min but again same happens.

Attached the second screenshot where i reduced the ‘stop after’ time to 1 min.

Experts out there can suggest what could be the reason here?


#2

Where are you scheduling your Robot to run every 5 minutes? I guess you need to use CRON expression for this kind of requirement.

For eg: This runs Daily(Mon-Fri) at 9 am every 5 minutes and Stops after 9:35 am.

0,5,10,15,20,25,30 0 9 ? * MON,TUE,WED,THU,FRI*

image

image

You can customize your CRON expression here

https://www.freeformatter.com/cron-expression-generator-quartz.html


#3

May be a silly question but have you placed a Soft Stop command within your workflow to stop at a certain point?


#4

I guess you mean “Should stop”.

@humayunmalik I think you don’t quite understand the purpose of the “Stop after” function. What it does is stopping the running process (if it contains a Should Stop of course) after a certain time.
But by reading your question, I understand that you want the schedule to disable itself after 35 min, which is not possible this way.


#5

No, I dont think it is needed and don’t know how to merge it with in the workflow.

I prefer it to stop through scheduler since we have a job schedule functionality.


#6

Absolutely correct.

How can i use ‘should stop’ if i need to run the script for 6 times a day and it takes 10 minutes to complete one script.

Also now what I understand is, ‘Stop After’ is used when your job is taking time to complete so you use this to stop it forcefully after specific time. Is my understanding correct now?


#7

Correct! :slight_smile:

To be more precise:

  • “Stop After” from the Orchestrator sends a stop order to a robot running a process
  • The “Should stop” activity in a process catches this stop order if it exists and stops the process
  • This is especially useful for processes that are loops, place a Should stop in the loop so that it can stop at the end of an iteration
  • If there isn’t any “Shoud stop” activity in your process, the stop order from the orchestrator won’t ever get caught by your process

If you want to run your process 6 times a day and you know it takes roughly 10 minutes, an easy solution would be to make 6 schedules (i.e. starting at 10:00, 10:10, 10:20, 10:30, 10:40, 10:50). Don’t worry, even if your process that started at 10:00 isn’t finished at 10:10, it will start again directly after it finished because the Orchestrator will make a “Pending” job for it.