Skip to main content

prefect event

prefect event [OPTIONS] COMMAND [ARGS]...
Stream events.

prefect event stream

prefect event stream [OPTIONS]
Subscribes to the event stream of a workspace, printing each event as it is received. By default, events are printed as JSON, but can be printed as text by passing --format text.

Options

--format
Output format (json or text)
--output-file
File to write events to
--account
Stream events for entire account, including audit logs
--run-once
Stream only one event

prefect event emit

prefect event emit [OPTIONS] EVENT
Emit a single event to Prefect.

Arguments

EVENT
string
required
The name of the event [required]

Options

--resource
Resource specification as ‘key=value’ or JSON. Can be used multiple times.
--resource-id
The resource ID (shorthand for —resource prefect.resource.id=<id>)
Related resources as JSON string
--payload
Event payload as JSON string
Example:
# Simple event with resource ID
prefect event emit user.logged_in --resource-id user-123

# Event with payload
prefect event emit order.shipped --resource-id order-456 --payload '{"tracking": "ABC123"}'

# Event with full resource specification
prefect event emit customer.subscribed --resource '{"prefect.resource.id": "customer-789", "prefect.resource.name": "ACME Corp"}'