Jordan Fisher
08/02/2024, 11:08 AMMarvin
08/02/2024, 11:08 AMpython
# This is an example event-driven automation YAML configuration
automations:
- name: Handle Failed Flow
description: React to a failed flow by triggering a new flow run
enabled: true
trigger:
type: event
situational:
resource:
type: prefect.flow-run
failed:
role: any
actions:
- type: run-deployment
parameters: "parameters from the failed flow"
# You can access the failed flow's parameters in your new flow run
from prefect import flow
@flow
def new_flow(failed_flow_parameters: dict):
# Use the parameters from the failed flow
print(f"Failed Flow Parameters: {failed_flow_parameters}")
# This flow will be triggered by the automation when another flow fails
To get a clear, step-by-step guide tailored to your setup, refer to the official documentation links:
- Automations Guide
- Automations Concepts