Hi! Great to see the enhancements of 2.7! I was wo...
# prefect-community
s
Hi! Great to see the enhancements of 2.7! I was wondering if you can schedule a cancellation of flow runs? That would then allow a start and stop time to be configured on the scheduling level.
1
b
Hey Sander, You can set a timeout on the flow decorator which would have the same effect as what you're trying to do?
s
But the you’d have some fixed running time right?
b
Yeah, a maximum time the flow can run for. Sorry that's what I thought you're asking for?
s
I’m thinking about something like start at 9am CET and stop at 4pm NY time.
that time depends a bit on DST.
But that construct will work indeed most of the time.
b
Right, technically you could do it if you had a parent flow, kick off some sub flow and monitor it until some time and then cancel that flow with an api call
s
Hmm. Interesting. Guess that should work.
👍 1
But then you’d encode the stop time in the logic. Nicer would be to encode it at the orchestration level.
b
You could encode it as a timedelta? Or even a dynamic parameter in the parent flow/deployment
🙌 1
s
That should work indeed. Will try it out and see how it feels:) thanks!
z
We’ve also got a Cloud feature in alpha that will do this for you.
Are timeouts not sufficient for what you’re doing?
s
Most of the time that should work but having a timezoned start/stop I think would be best.
The parameterization would then be optimal and no intermediate tweaking during the year would be needed.
z
👍 cool idea. cc @Will Raphaelson
🚀 1
🙏 1
w
Thanks! Sander I’d love to chat more about this use case - if you’re interested in trying out the automations feature while its in beta, send me a dm?