In order to integrate slack (through the `state_ha...
# ask-community
l
In order to integrate slack (through the
state_handler
) with prefect cloud, does the webhook URL have to be stored in Prefect Secrets, or can it just be available as an environment variable (my use case would be loading an eternal secret to an eks cluster)
k
Hey @Leon Kozlowski, the
run
method of the SlackTask has a webhook_url kwarg. You can use that task inside a state handler by invoking the run method
l
Ok, I was looking at this - it looks like
slack_notifier
explicitly loads a Prefect Secret
k
That…is kinda deprecated
l
I see
k
I dunno, it will work, but I don’t think it gives you the same flexibility as the SlackTask
l
I can prob just use
SlackTask
k
Yeah you can use it in a state handler with
SlackTask.run()