can the Prefect `SlackTask()` be configured to sen...
# ask-community
k
can the Prefect
SlackTask()
be configured to send messages to different channels depending on what flow it is being run in?
d
Hi @kevin! That is possible, but not by configuring a channel name. Slack sets up webhooks that only post messages to a single channel. So, if you’d like different flows to send messages to different channels, you’ll need to register different webhooks and then use that webhook in the Flow
k
gotcha, so the onus is on slack to indicate which channel receives the message
d
I would suggest using a different Prefect Secret for each webhook (maybe with different channel names) and then pass the secret name for the channel you’d like to use:
webhook_secret="SLACK_WEBHOOK_URL"
Exactly
k
could an env var in a docker image be used as well or are Prefect Secrets more standard?
A Secret is a special concept in the Prefect world because we treat it very carefully and it’s encrypted at rest and in transit (we use Vault behind the scenes)
k
gotcha, thanks for the help 🙂
d
You bet! 😄