Charles Bannister
05/04/2026, 1:58 PMMarvin
05/04/2026, 1:58 PMMarvin
05/04/2026, 1:59 PMWebhook block / Call webhook action, your headers should usually be:
Content-Type: application/json
And that's typically it.
A few important details:
Slack does not need an Authorization header for incoming webhooks.
The secret is embedded in the webhook URL itself.
So in your Prefect Webhook block, headers can be either:
{
"Content-Type": "application/json"
}
or possibly empty if you're calling the block directly with a Python dict payload.
But if you're using the Call webhook automation action, the payload is rendered as a string, so it's safest to set:
{
"Content-Type": "application/json"
}
Example Slack payload body:
{
"text": "Hello from Prefect"
}
So your setup should look roughly like:
URL
<https://hooks.slack.com/services/>...
Method
POST
Headers
{
"Content-Type": "application/json"
}
Payload
{
"text": "Flow run failed"
}
Gotcha: make sure the payload is valid JSON, especially if you use Jinja templating in the Call webhook action.
Example:
{
"text": "Flow {{ flow_run.name }} failed"
}
If you want, I can also show you the exact Call webhook payload template to use for a Slack message in a Prefect automation.
Relevant docs:
- Events and automations
- Slack incoming webhooks