Hi folks! This is a really simple question but I'm...
# ask-community
m
Hi folks! This is a really simple question but I'm not finding the answer in the documentation. I have a particular flow that occasionally fails due to temporary network outages, and when it does fail i'd like to trigger the entire flow to run again. I'm not finding anything super straightforward such as a flow-level parameter that retries the flow. Can you all point me to documentation for how to do this?
c
Hey Mary! At this moment what I’d recommend is a flow level state handler (check out the
state_handlers
kwarg on the Flow class) that uses something like:
Copy code
if new_state.is_failed():
    client = prefect.Client()
    client.create_flow_run(flow_id, parameters=prefect.context.parameters)
In the very very near future, we’ll be releasing a new Cloud “Automation Suite” that will allow you to configure this in the API instead of writing the code and attaching it your flow
m
ok awesome, thank you @Chris White!
👍 1