hello <@ULVA73B9P>, I want to send notifications t...
# ask-marvin
m
hello @Marvin, I want to send notifications to an AWS SNS topic when flows enter the Completed state. I'm doing an automations that on changing flow run state to Completed sends a notification to a CustomBlock created by SNSNotificationBlock, but it doesn't work. Can you confirm that automations can only work with the blocks I find in prefect\blocks\notifications.py?
m
It appears that Prefect supports numerous notification methods for flow state changes via its Automations interface, including Slack, Microsoft Teams, Opsgenie, PagerDuty, Twilio, and email. However, support for AWS SNS as a notification destination is not explicitly mentioned in the official documentation. Here are some relevant excerpts: - "Notifications with Automations": "Prefect supports sending notifications via Slack message, Microsoft Teams message, Opsgenie alerts, PagerDuty alerts, Twilio to phone numbers, and Email (requires your own server)." - "Creating Notifications": This guide showcases creating an email notification from a flow run completion, indicating that various types of notifications can be configured via the Automations interface. Given this, it seems that while Prefect provides a built-in capacity for various notification systems, AWS SNS is not natively supported. However, you could potentially implement a custom block or script that utilizes the AWS SDK to send notifications to SNS. To answer your question more directly: - Automations in Prefect are designed to work with the blocks provided in
prefect.blocks.notifications.py
. Custom blocks or additional integrations would require manual implementation and configuration. For more concrete steps or working examples of how you might achieve this with custom scripting, consider reaching out to the Prefect community or reviewing more detailed documentation on custom automations and block creation.