<@ULVA73B9P> how do you set up an alert for when t...
# ask-marvin
a
@Marvin how do you set up an alert for when the workpool status changes?
m
thought for 71.5 seconds
In Prefect 3.x, the way to do this is with an Automation that listens for work pool events and then sends a notification. The important bit: for a work pool “status change,” you generally want to alert on pause/resume events. What to set up 1. Create a notification block / destination 2. Create an automation 3. Configure the trigger to watch work-pool-related events 4. Add a
SendNotification
action A typical pattern is: - alert when a work pool is paused - alert when a work pool is resumed I wasn’t able to verify the exact emitted event names from source in this session, but Prefect’s events/automations system does include work-pool-specific actions like
PauseWorkPool
and
ResumeWorkPool
, which strongly suggests work-pool lifecycle events are part of the automation model. UI approach In Prefect Cloud / Server: - Go to Automations - Create a new automation - Choose an event-based trigger - Filter to the specific work pool resource - Choose the event(s) corresponding to pause/resume or work pool state changes - Add a Send notification action If you only care about one pool, scope it to that pool’s resource. If you want all pools, scope it more broadly. What if you mean worker health instead of paused/resumed? Sometimes people say “work pool status” but really mean: - no workers polling - workers unhealthy/offline - queue not being serviced That is slightly different. In that case, a better alert is often: - trigger when flow runs stay late / scheduled too long - trigger when no worker activity is observed - or monitor worker/container/process health externally If direct work-pool status events aren’t exposed in your UI/version Use one of these workarounds: - Alert on late flow runs for deployments using that pool - Poll the work pool via API in a small monitoring flow and emit your own alert - Use external infra monitoring for worker processes Example workaround pattern: - schedule a monitoring flow every few minutes - query the work pool state / worker availability - if status changed or pool is not ready, send Slack/email/webhook Helpful docs: - Events and automations - Automations guide - Work pools If you want, I can help with either: 1. the click-by-click UI setup for a paused/resumed work pool alert, or 2. a monitoring flow example that alerts when a pool has no active workers.