Prefect

Events duplicated when emit_event used outside flow run context

warning
configurationUpdated May 1, 2025(via Exa)
Technologies:
How to detect:

Using emit_event outside flow run context (e.g., in long-running server processes) causes events with same ID to be emitted multiple times, hours or days apart.

Recommended action:

Use EventsClient directly with a long-lived client instance instead of emit_event when working outside flow run context.