Tom Han
09/15/2025, 6:51 PMMarvin
09/15/2025, 6:52 PMMarvin
09/15/2025, 6:55 PMTom Han
09/15/2025, 7:13 PMMarvin
09/15/2025, 7:13 PMMarvin
09/15/2025, 7:22 PMTom Han
09/15/2025, 11:35 PMMarvin
09/15/2025, 11:35 PMMarvin
09/15/2025, 11:40 PMprefect.flow-run.Failed
) with the “Threshold … times within … minutes” options you’re seeing. That covers “N failures in M minutes”-style alerts.
- SDK/API: Metric-based automations do exist in the SDK as MetricTrigger
and MetricTriggerQuery
, but they’re not configurable in the UI yet. You can create them programmatically.
Useful links:
- Concepts: Automations & triggers in Prefect 3
- How-to: Creating automations and triggers
Note on CLI: There isn’t a CLI command to create automations; prefect automations
supports listing/inspecting/enabling/disabling/deleting existing automations only.
If you share which metric and condition you want (e.g., runtime > X, lateness > Y, success rate < Z), I can draft a concrete SDK snippet to create the corresponding metric-based automation.Tom Han
09/16/2025, 1:20 AMinference/inference
deploymeny with Late/Pending/Scheduled state, trigger a different deployment and send a notification using slack webhookMarvin
09/16/2025, 1:20 AMMarvin
09/16/2025, 1:31 AMprefect.flow-run.Scheduled
- prefect.flow-run.Pending
- prefect.flow-run.Late
- From the following resources: filter to your deployment
- Filter for events related to → Deployment → name equals inference/inference
- Threshold: 1
- Within: set a window that’s slightly larger than the expected cadence of that deployment (e.g., if it should schedule every 5 minutes, use 10–15 minutes)
- Evaluation options: leave defaults unless you need to scope evaluation further
This configuration means: “If we do not observe at least one Scheduled/Pending/Late flow-run event for the deployment inference/inference within the chosen window, fire the automation.”
2) Add the actions
- Add action → Run deployment → select the fallback deployment you want to kick off
- Add action → Send notification
- Choose your Slack Webhook block (or create one first under Blocks → Slack Webhook)
- Provide a message template (include details like the source deployment, window used, and the triggered deployment)
Notes and tips
- Pick a “Within” window that matches your expectations. If your deployment should be continuously scheduling, use a short window; if it’s cron-based, use a window larger than the cron interval.
- You can add all three events (Scheduled, Pending, Late) in the same trigger as separate rows under “Any event matching.”
- This approach is event-driven (absence of events). If you specifically want a metric/count-based check (e.g., “count of currently Scheduled/Pending/Late runs = 0”), that isn’t exposed in the UI yet; it’s possible via the SDK with a Metric-based trigger. I can draft that if you prefer an API-based setup.
References
- Automations and triggers overview: Automations & triggers in Prefect 3
- How-to guide for creating automations: Creating automations and triggers
If you share:
- The exact name of the deployment you want to trigger
- Your preferred “Within” window
- The Slack Webhook block name (or if you need help creating one)
I can provide a quick checklist and a suggested notification message body you can paste into the UI. If you want the SDK/API version instead (metric trigger + actions), I can draft that as well.