You don’t need external imports and what not to make your intervals flexible; corn expressions allow you to describe nearly anything (as long as it’s in the constraints defined by the schedule interval; 1min by default – the
EVENTBUS_SCHEDULER_INTERVAL variable you mentioned).
You can also have multiple triggers on the same script to make the expressions simpler and to cover different cases.
It is configurable when you define the script; if you’d need to change the interval you’d need to edit the script.
The variable defines the lowest granularity that an interval can be; by default, it is 1min IIRC.
You can change it, but we don’t recommend it as it can cause quite a performance hit for no real benefit.
Here is one out-of-the-box option; let’s consider an example where you need to do some interval processing for your clients, where your clients can ask for a specific day of a month for it to run on (a recurring subscription for example).
You can define an internal that runs unconditionally every single day.
The first block of code of your script would check if it has any clients to process based on their preferences (you fetch the records with some filter).
If there are any clients, you process them, else you don’t.
Would this fit your needs? While we’re at it, you could also consider switching from automation scripts to workflows.