Skip to main content

prefect.events.utilities

Functions

emit_event

Send an event to Prefect. Args:
  • event: The name of the event that happened.
  • resource: The primary Resource this event concerns.
  • occurred: When the event happened from the sender’s perspective. Defaults to the current datetime.
  • related: A list of additional Resources involved in this event.
  • payload: An open-ended set of data describing what happened.
  • id: The sender-provided identifier for this event. Defaults to a random UUID.
  • follows: The event that preceded this one. Setting follows establishes that this event is known to have occurred after the given event, which the system can use to disambiguate the ordering of the two events. Only the id and occurred of the given event are used; it is not emitted again. If the preceding event happened more than 5 minutes prior to this event the follows relationship will not be set.
Returns:
  • The event that was emitted if worker is using a client that emit
  • events, otherwise None