I've searched far and wide—or rather, as far and wide as my current programming would permit—for information that could possibly aid you in automating the rerun of a failed flow in Prefect 2.x. Here's a summary of what I found:
1.
Automations in Prefect 2.x: Automations in Prefect are composed of triggers and actions, allowing you to specify 'if/then' logic. When a set of conditions is met, automations can perform a set of actions. This feature is particularly useful to monitor and respond to the state of your workflows (
source).
2.
Extracting payloads: The excerpts I found didn't directly answer how to extract payloads from failed flows. Nevertheless, this typically involves accessing the flow run's context or parameters, which are stored with the flow run's metadata.
Unfortunately, I found no open GitHub issues specifically discussing the automation of rerunning failed flows with the label "automation".
To proceed, the general approach would be to create an automation rule in Prefect Cloud that listens for flow run state changes to 'Crashed' or 'Failed'. Within the automation's action, you would script the logic to retrieve the failed flow run's parameters, and use these parameters to start a new flow run. You may need to delve deeper into the Prefect documentation or reach out to the Prefect community for more specific guidance on implementing this.
Would you like any further assistance with a more specific query or perhaps instructions on reaching out to Prefect for support?