If you want to send an alert when a flow fails by ...
# show-us-what-you-got
k
If you want to send an alert when a flow fails by adding only one decorator, use prefect-alert.
Copy code
from prefect import flow, task 
from prefect.blocks.notifications import SlackWebhook
from prefect_alert import alert_on_failure

@task
def may_fail():
    raise ValueError()

@alert_on_failure(block_type=SlackWebhook, block_name="test")
@flow
def failed_flow():
    res = may_fail()
    return res

if __name__=="__main__":
    failed_flow()
Thanks @Ryan Peden for contributing the collection!
gratitude thank you 1
👍 1
2
💯 1
🙌 8
🎉 4
🔥 7