Hi, I'm currently facing a challenge with automati...
# ask-community
m
Hi, I'm currently facing a challenge with automating retries for a crashing flow. Ideally, I'd like to set up automation that simply restarts a flow run if it crashes. While we've achieved a solution where a new flow run is triggered upon a crash, this is far from perfect as it restarts everything from the beginning. Is it possible to only restart the existing flow run when it crashes?
n
hi @Maciej Wysocki
Is it possible to only restart the existing flow run when it crashes?
in general, not necessarily. a
Crashed
flow run often means that there's an issue with the infrastructure its trying to run on, so you cannot always guarantee that the same infrastructure will be around for a retry is your concern with this cost?
While we've achieved a solution where a new flow run is triggered upon a crash
what type of infra do you have?
m
I'm concerned about the time spent on repeating the tasks, which were already finished. I understand that a Crash might typically indicate an infra problem, but in our case typically waiting and restarting the flow does the job. We use a docker container to run prefect on one of our machines and also use the prefect cloud with that.
n
> I'm concerned about the time spent on repeating the tasks, which were already finished have you configured results? if you've already called a task with specific arguments and use
cache_key_fn=task_input_hash
then you'd pull the cached result from your result storage
m
this sounds good, I will have a look. Otherwise, I saw that in the automations tab it's possible to change a flow's state state from Crashed to Running. Does it "reset" the flow to retry execution?