https://prefect.io logo
Title
a

alex

08/11/2020, 10:42 PM
Hello, I'm using
slack_notifier
as my flow's state_handler, but it does not seem to get called when my task fails. I get notified when it starts and ends. My pipeline is set such that failing_task -> task (trigger_will_fail) -> recovery_task (task triggers only on fail and sets state to success, otherwise is skipped). I ideally want to be notified that we encountered a failure, even though we do end up doing failure recovery and setting the final state to a success.
c

Chris White

08/11/2020, 10:45 PM
Hi Alex - you can attach state handlers on either Tasks or Flows. It sounds like you attached yours to your Flow, which means it will only get called on your Flow’s state transitions. If you want to have it called on an individual task, you should attach it to the task you are interested in getting failure alerts for
a

alex

08/11/2020, 11:14 PM
Oh I see, thought a flow would take the state of its tasks. Thanks!
c

Chris White

08/11/2020, 11:14 PM
No problem!