Is it possible to trigger a flow on a bounded sche...
# ask-community
o
Is it possible to trigger a flow on a bounded schedule, e.g. 2 weeks? We have an ML inference job that we would like to run for a bounded period of time, say 10 days. Is that possible to provide Prefect 2.0 a start and end date and ensure a recurring daily schedule (e.g. every day at 2 am) that ends on a particular date?
d
There are practical reasons you can’t just toggle the deployment’s schedule on and off in the UI?
Assuming there is, here is a workaround 1. Create that deployment 2. Create a deployment for a new flow a. This deployment runs on the 10 day interval b. The flow sets the target deployment’s
is_schedule_active
to false and then saves it
d
U can do it with RRULE
o
@Dominic Tarro thank you for the advice! how do you programmatically set the
is_schedule_active
to false? I saw this field in the deployment yaml but I’d rather avoid manually modifying files and instead use the Prefect REST API
@Deceivious what’s RRULE?
Ahhh that’s amazing
RRULE:FREQ=MONTHLY;BYDAY=-2FR;COUNT=7
Thank you so much!
God I love Prefect
d
Great that you found rule by yourself 😂 that's kinda hard to explain
o
lol 😄