Skip to main content

prefect.server.events.schemas.lifecycle

Typed payloads and builders for prefect.<object>.{created,updated,deleted} lifecycle events. Each payload is the shape of the event’s payload field for a domain object — what a consumer sees on the event without reading the object back from the API. The shapes mirror Prefect Cloud’s lifecycle-event payloads so the two emit the same thing. The builders here are pure functions of an ORM object and a timestamp, with no dependency on the model layer, so any model module can import them without risking a circular import.

Functions

variable_created_event

variable_created_event(variable: 'ORMVariable', occurred: DateTime) -> Event
Create an event for variable creation.

variable_updated_event

variable_updated_event(variable: 'ORMVariable', occurred: DateTime) -> Event
Create an event for variable updates.

variable_deleted_event

variable_deleted_event(variable: 'ORMVariable', occurred: DateTime) -> Event
Create an event for variable deletion.

flow_created_event

flow_created_event(flow: 'ORMFlow', occurred: DateTime) -> Event
Create an event for flow creation.

flow_updated_event

flow_updated_event(flow: 'ORMFlow', occurred: DateTime) -> Event
Create an event for flow updates.

flow_deleted_event

flow_deleted_event(flow: 'ORMFlow', occurred: DateTime) -> Event
Create an event for flow deletion.

block_type_created_event

block_type_created_event(block_type: 'BlockType', occurred: DateTime) -> Event
Create an event for block type creation.

block_type_updated_event

block_type_updated_event(block_type: 'BlockType', occurred: DateTime) -> Event
Create an event for block type updates.

block_type_deleted_event

block_type_deleted_event(block_type: 'BlockType', occurred: DateTime) -> Event
Create an event for block type deletion.

block_document_created_event

block_document_created_event(block_document: 'BlockDocument', occurred: DateTime) -> Event
Create an event for block document creation.

block_document_updated_event

block_document_updated_event(block_document: 'BlockDocument', occurred: DateTime) -> Event
Create an event for block document updates.

block_document_deleted_event

block_document_deleted_event(block_document: 'BlockDocument', occurred: DateTime) -> Event
Create an event for block document deletion.

concurrency_limit_v2_created_event

concurrency_limit_v2_created_event(concurrency_limit: 'ConcurrencyLimitV2', occurred: DateTime) -> Event
Create an event for global concurrency limit creation.

concurrency_limit_v2_updated_event

concurrency_limit_v2_updated_event(concurrency_limit: 'ConcurrencyLimitV2', occurred: DateTime) -> Event
Create an event for global concurrency limit updates.

concurrency_limit_v2_deleted_event

concurrency_limit_v2_deleted_event(concurrency_limit: 'ConcurrencyLimitV2', occurred: DateTime) -> Event
Create an event for global concurrency limit deletion.

concurrency_limit_created_event

concurrency_limit_created_event(concurrency_limit: 'ConcurrencyLimit', occurred: DateTime) -> Event
Create an event for tag-based concurrency limit creation.

concurrency_limit_updated_event

concurrency_limit_updated_event(concurrency_limit: 'ConcurrencyLimit', occurred: DateTime) -> Event
Create an event for tag-based concurrency limit updates.

concurrency_limit_deleted_event

concurrency_limit_deleted_event(concurrency_limit: 'ConcurrencyLimit', occurred: DateTime) -> Event
Create an event for tag-based concurrency limit deletion.

artifact_collection_created_event

artifact_collection_created_event(artifact_collection: 'ORMArtifactCollection', occurred: DateTime) -> Event
Create an event for artifact collection creation.

artifact_collection_updated_event

artifact_collection_updated_event(artifact_collection: 'ORMArtifactCollection', occurred: DateTime) -> Event
Create an event for artifact collection updates.

artifact_collection_deleted_event

artifact_collection_deleted_event(artifact_collection: 'ORMArtifactCollection', occurred: DateTime) -> Event
Create an event for artifact collection deletion.

automation_created_event

automation_created_event(automation: 'Automation', occurred: DateTime) -> Event
Create an event for automation creation.

automation_updated_event

automation_updated_event(automation: 'Automation', occurred: DateTime) -> Event
Create an event for automation updates.

automation_deleted_event

automation_deleted_event(automation: 'Automation', occurred: DateTime) -> Event
Create an event for automation deletion.

Classes

VariableEventPayload

The payload of a variable lifecycle event: its name, value, and tags. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

FlowEventPayload

The payload of a flow lifecycle event: its name, tags, and labels. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

BlockTypeEventPayload

The payload of a block type lifecycle event: its identity, presentation, and protection. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

BlockDocumentBlockType

The block type a block document belongs to, nested on its block schema. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

BlockSchemaEventPayload

The schema a block document conforms to, with its block type nested. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

BlockDocumentEventPayload

The payload of a block document lifecycle event: its name, the non-secret string values of its data, and the nested block schema (capabilities and block type). Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

ConcurrencyLimitV2EventPayload

The payload of a global concurrency limit lifecycle event: its name, limit, active flag, and slot decay rate. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

ConcurrencyLimitEventPayload

The payload of a tag-based (v1) concurrency limit lifecycle event: the tag it applies to and its limit. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.

ArtifactCollectionEventPayload

The payload of an artifact collection lifecycle event: the collection key, the artifact type, and its data and description. The latest artifact and its flow/task runs ride the event’s related resources, not the payload. Methods:

model_validate_list

model_validate_list(cls, obj: Any) -> list[Self]

reset_fields

reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set. Returns:
  • A new instance of the model with the reset fields.