Advanced scheduling across queues and processes

orchestrator
schedule

#1

Does anyone have any experience with advanced process scheduling in Orchestrator apart from simple cron expressions, intervals and specified datetimes? For instance, is it possible to set up triggers (i.e. a certain mail enters the mail inbox) or have one robot automatically switch what process to work on based on transaction priorities across different queues?

Let us imagine the following scenario:

• We have one robot
• We have 4 processes, P1, P2, P3 and P4
• P1 has 100 transactions, with each transaction requiring a 3 minutes average processing time
• P2 has 20 transactions, with each transaction requiring a 10 minutes average processing time
• P3 has 5 transactions, with each transaction requiring a 2 minutes average processing time
• P4 has one transaction, requiring 10 minutes processing time
• All of the processes are to run between 08:00 and 17:00
• P1 can run whenever, so long as it is finished at 17:00
• P2 must be run every 20th minute
• For every fourth transaction handled in P2, one transaction from P3 must be handled immediately afterwards
• P4 is triggered if the stock price of Apple rises with 0.2 % from yesterday’s closing price (alternatively if a mail with the subject “GoGo4” enters the Outlook Inbox)

The above situation would require interval scheduling, switching between processes automatically on one robot, business rules (only start P3 if [P2 handled today]mod4==0), and external triggers (apple stock or mail inbox).

Thank you!


#2

@TDagsvik Did you ever find a good solution for your problem?

Currently we have a similar problem.
We have a process that checks for new email in a specific mailbox, and converts emails to queue items for other processes.

We want to guarantee that this email-checker runs every (or close to) 15 minute, but other processes have to continue where they left off.
We can set all processes with a “should stop” after 15 min, but that means we now have to prioritize all our processes so the most important one starts first, instead of the one that was already running.

Example:
P5 is scheduled to run at every 15+1 min (01, 16, 31, 46), and P6 is at 15+2 min.
P6 is running and have multiple more items in the queue.
Then the email-checker needs to run and all other processes stops.
The email-checker adds 100 queueitems to P5.
Now after the email checker is complete, i want to continue P6, but in the current setup P5 starts first, and starts processing the 100 queueitems.

Any ideas would be appreciated! :slight_smile:


#3

What if you build a shared custom priority scheduler workflow module that is used by every robot. At the point where it starts a new transaction, you call this module to determine whether you should continue processing or exit gracefully. It may need to read emails to get new message counts or make API calls to get counts in queues to execute your business priority rules, so it may slows things down a little…
Or the custom priority scheduler is the only robot that is scheduled. It runs every 5 min. and checks all of these priorities and makes an API call to start/cancel the necessary jobs based on priorities.


#4

I don’t fully understand it, but i think you are on to something. I’ll look further into it when i can.

Thanks scottl :slight_smile: