Hassam Daudi
03/19/2026, 3:00 PMprefect-slack 0.3.1 installed
• AWS ECS Fargate work pool (kanolytics-prefect-ecs)
What we're trying to do: Set up a Prefect Automation that sends a Slack notification when a flow enters a Completed, Failed, or Crashed state.
What we've tried:
1. Send a notification action using a Slack Webhook block (prefect.blocks.notifications.SlackWebhook) — no notification received
2. Call a webhook action with the Slack webhook URL hardcoded — no notification received
Send a notification action using a Slack Incoming Webhook block from prefect-slack — no notification received
Confirmed the Slack webhook URL works by testing via curl from the terminal — message lands in Slack successfully
Confirmed prefect.flow-run.Completed events are appearing in the Prefect event feed
Confirmed the automation is enabled and scoped to all flows
1. Confirmed no outbound firewall blocking <http://hooks.slack.com|hooks.slack.com>
2. No errors or logs in CloudWatch related to the automation firing
What we suspect: The automation trigger is detecting the event correctly but the action is silently failing with no logs or error messages anywhere — CloudWatch, Prefect UI, or event feed.
Question: Why would a Prefect Automation action silently fail to send a Slack notification despite the trigger event firing correctly, the webhook URL being valid, and no network restrictions in place?Marvin
03/19/2026, 3:00 PMMarvin
03/19/2026, 3:07 PM# Generate a Fernet key (44-char base64 string)
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# Example ECS task definition env for every server task/container:
PREFECT_SERVER_ENCRYPTION_KEY=YOUR_GENERATED_FERNET_KEY
Notes:
- There’s a deprecated alias ORION_ENCRYPTION_KEY; stick with PREFECT_SERVER_ENCRYPTION_KEY.
- If you previously ran without the env var, Prefect may have auto-generated and stored a key in the DB. Mixing an env‑var key on one server process with the DB‑stored key used by another will break decryption. Pick one approach and make it consistent everywhere.
Docs and references
- Self-hosted guide: Self‑hosted Prefect 3
- Security settings (context): Security settings
- Encryption utilities reference (how the key is read/used): prefect.server.utilities.encryption
2) After setting the key, restart the server services and re-test
- Re-save one of your notification blocks or the automation (to ensure it’s stored with the now-stable key), then trigger a flow to generate a Completed/Failed event.
- If you had created blocks/automations while the key was inconsistent, recreate those so they’re encrypted with the correct key.
3) Ensure the plugin is installed in the server image (only if you use the prefect‑slack block)
- The automations engine loads the block class server‑side. Make sure the Prefect server container has prefect‑slack installed (not just your worker image).
pip show prefect-slack
# or bake it into the server image / ECS task definition
Using the built‑in prefect.blocks.notifications.SlackWebhook does not require the plugin.
4) Enable more verbose logging temporarily on the server
- 3.6.21 does not always surface action exceptions well. Raising log level can help catch template/decrypt errors.
- In your server config or env:
PREFECT_LOGGING_LEVEL=DEBUG
Then reproduce and check server logs.
Optional sanity checksMarvin
03/19/2026, 3:07 PMcurl -v -X POST -H 'Content-type: application/json' \
--data '{"text":"Prefect test"}' <https://hooks.slack.com/services/>...
If you want, I can help you verify the key state. A few quick answers would help:
- Is PREFECT_SERVER_ENCRYPTION_KEY set on all Prefect server containers/tasks? If so, was it added after you created these blocks/automations?
- Is prefect‑slack installed in the Prefect server image (not only workers)?
- Are you running multiple server replicas or separate services (API and events/automations) that could have diverging env vars?
Once the encryption key is consistent, these Slack notifications typically start working immediately.