<@ULVA73B9P> I have a SlackWebhook block. I can se...
# ask-marvin
b
@Marvin I have a SlackWebhook block. I can send notifications as expected from code, but any notification I set from "Automations" on flow failure does not appear on the Slack channel. What could be the issue?
m
It appears you might be experiencing an issue with Slack notifications for flow failures in Prefect Automations. The documentation doesn't address this specific issue directly, but here are a couple of steps to troubleshoot the issue based on best practices: 1. Check Credentials: Ensure that the SlackWebhook block has the correct credentials saved. For a webhook, the URL should be in the format
<https://hooks.slack.com/services/>...
. For OAuth, make sure you have the correct Bot User OAuth Token starting with
xoxb-...
, and the scope must include
chat:write
. 2. Permissions & Scopes: If using OAuth, confirm that you've granted the proper permissions in Slack, namely
chat:write
, and after updating scope, that you have reinstalled the app to your workspace. 3. Verify Block Configuration: Ensure that the SlackWebhook block is properly configured in your Automations. The automation should be set up to trigger on flow failure and reference the SlackWebhook block you've saved. Please refer to the Prefect Slack integration documentation for setting up and configuring Slack credentials and ensure you've followed all the steps carefully. If you've checked these settings and the issue persists, it might be necessary to look at the logs from Prefect for errors during the Automations trigger, and investigate if there are any messages related to Slack notifications that might guide you to the root cause.
b
I know that all of that is correct, because sending from code like this works:
Copy code
SlackWebhook.load(my_prefect_block).notify(message)
but then if I configure an automation from the UI to notify using the same block when a flow run fails, then it doesn't work
n
b
If anyone is still looking for this, there are two blocks called
SlackWebhook
. You need to use the one in the core prefect library: https://linen.prefect.io/t/12111764/hi-guys-i-m-running-into-this-error-while-using-prefect-clou