Hi Prefect gurus. I’ve been using tasks hooks to s...
# ask-community
s
Hi Prefect gurus. I’ve been using tasks hooks to send notifications to slack on completion or failure. However, is there any way to run the hook on any state change (not only completion or failure). As I want to update the slack notification whenever there’s a state change to a task. E.g. when the task starts running
k
my first suggestion would be to call a notify function at the beginning of each task, but it sounds like you're looking for something generic that can be applied to the decorator like the other state change hooks
s
Yes, a more general state change hook (which runs on any state change) would be handy