Luiza
03/04/2026, 1:00 PMMarvin
03/04/2026, 1:00 PMMarvin
03/04/2026, 1:03 PMprefect automation inspect "<automation-name>" --yaml
# or
prefect automation inspect --id <automation-id> --json
2) Watch the event stream to see what’s actually happening
- This is the primary way to tell whether the events your trigger expects are occurring, with the right resource IDs/tags, and within the time window.
prefect events stream --format text
# or JSON and save to a file
prefect events stream --format json --output-file events.log
# In Prefect Cloud, include account-wide audit logs:
prefect events stream --account
What to look for:
- Do the event names match your trigger’s expect?
- Do the resource labels/ids/tags match your match / match_related filters?
- Are they arriving within the within window and meeting the threshold?
Also look for automation-specific events:
- prefect.automation.triggered
- prefect.automation.resolved
- prefect.automation.action.triggered / .executed / .failed
3) Check in the UI
- Automations page: confirm it’s enabled and review the trigger config.
- Events feed: watch for the events you expect to drive the automation.
- Flow run detail pages: view the events attached to a specific run to confirm what actually fired.
4) If you’re self‑hosting, enable debug logs to see evaluation decisions
- The server’s trigger evaluator logs why a trigger is or isn’t ready (thresholds, time windows, for_each buckets).
- Set:
PREFECT_LOGGING_LEVEL=DEBUG
Then watch your server logs; you’ll see messages indicating whether an automation met its threshold, still has time remaining in the window, or was not ready to fire.
Common gotchas to check:
- The automation is paused/disabled.
- Event names don’t match expect (e.g., expecting Completed vs Succeeded).
- match / match_related filters don’t align with actual `resource.id`/tags on the events.
- within window too short or threshold too high.
- for_each bucketing on a label that isn’t present on your events, so the trigger is evaluating per empty key.
If you can share the automation definition (YAML/JSON) and the event you expected to trigger it, I’m happy to help pinpoint the mismatch.Luiza
03/04/2026, 8:02 PMMarvin
03/04/2026, 8:02 PMMarvin
03/04/2026, 8:05 PMprefect automation watch command, so use prefect events stream and filter by the automation’s resource id (prefect.automation.<automation-id>) or name.
Quick steps:
1) Get the automation id
prefect automation inspect "<automation-name>" --json | jq -r .id
2) Watch all events for that automation (triggered/resolved/actions)
AUTOMATION_ID=<paste-id>
prefect events stream --format json | jq --arg id "prefect.automation.$AUTOMATION_ID" 'select(.resource.id == $id)'
3) Only watch when it triggers/resolves
AUTOMATION_ID=<paste-id>
prefect events stream --format json | jq --arg id "prefect.automation.$AUTOMATION_ID" 'select(.resource.id == $id and (.event=="prefect.automation.triggered" or .event=="prefect.automation.resolved"))'
4) Only watch action lifecycle for that automation
AUTOMATION_ID=<paste-id>
prefect events stream --format json | jq --arg id "prefect.automation.$AUTOMATION_ID" 'select(.resource.id == $id and (.event=="prefect.automation.action.triggered" or .event=="prefect.automation.action.executed" or .event=="prefect.automation.action.failed"))'
Alternatively, filter by name:
prefect events stream --format json | jq --arg name "My Automation" 'select(.resource.name == $name)'
Programmatic watch (Python)
import anyio
from prefect.events.clients import get_events_subscriber
from prefect.events.filters import EventFilter, EventResourceFilter, EventNameFilter
automation_id = "<your-automation-id>"
filt = EventFilter(
resource=EventResourceFilter(id=[f"prefect.automation.{automation_id}"]),
event=EventNameFilter(name=[
"prefect.automation.triggered",
"prefect.automation.resolved",
"prefect.automation.action.triggered",
"prefect.automation.action.executed",
"prefect.automation.action.failed",
])
)
async def main():
async with get_events_subscriber(filter=filt) as sub:
async for ev in sub:
print(ev.event, ev.occurred, ev.resource.name)
anyio.run(main)
If you share the automation name, I can give you a copy/paste command that targets it directly.