Short answer: yes.
In Prefect 3.x you can use Automations and the Events system to audit:
- All flow runs: Create an Automation with an Event trigger that matches all flow-run events (e.g., match on resource type = flow-run). Send the full event payload to a webhook, Slack, or email for your audit sink.
- Deployment changes: Create a Deployment Event trigger for create/update/delete events on deployments and route those events to your audit sink as well.
Common ways to implement this:
- UI: Automations → New automation
- Trigger: Event → match resource type = flow run → posture Reactive → Action: Call webhook (or Send notification) to forward each event.
- Trigger: Deployment event → choose Created/Updated/Deleted → Action: Call webhook (or Send notification).
- API: Use the Automations REST endpoint to create Event/DeploymentEvent triggers and attach CallWebhook/SendNotification actions. See API refs below.
If you need a durable, centralized audit trail:
- Use an Automation with a webhook action to ship every matching event payload to your logging/SIEM (e.g., Splunk, Datadog, S3).
- Or subscribe to the Events feed and persist it yourself; you can also emit custom events from flows if needed.
Additional auditing in Prefect Cloud:
- Prefect Cloud provides account-level audit logs (user sign-ins, API keys, invites, etc.) for security/compliance. This is separate from run/deployment events and complements your automation-based event capture.
- Docs:
Cloud audit logs
Helpful references:
- Create Automations via API:
Create automation API
- Example of event-driven automations:
Chaining deployments with events
- Events and automation types in code (what triggers/actions exist):
prefect.events Python API
Quick CLI you can use today (manage, not create):
- List automations
prefect automation ls
- Inspect an automation
prefect automation inspect "<name>"
- Pause/Resume
prefect automation pause "<name>"
prefect automation resume "<name>"
A couple of clarifying questions so I can share exact steps or example payloads:
- Are you on Prefect Cloud or self-hosted?
- Do you want these audit events forwarded to Slack, a generic webhook, or another system (e.g., S3/Datadog/Splunk)?
- For flow runs, do you want every state transition or just failures? And for deployments, do you want just create/update/delete or all changes?