docs/v3/api-ref/python/prefect-server-events-models-automations.mdx
prefect.server.events.models.automationsemit_automation_created_event <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L28" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>emit_automation_created_event(automation: Automation) -> None
Emit an event when an automation is created.
emit_automation_updated_event <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L36" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>emit_automation_updated_event(automation: Automation) -> None
Emit an event when an automation is updated.
emit_automation_deleted_event <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L44" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>emit_automation_deleted_event(automation: Automation) -> None
Emit an event when an automation is deleted.
automations_session <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L60" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>automations_session(db: PrefectDBInterface, begin_transaction: bool = False) -> AsyncGenerator[AsyncSession, None]
read_automations_for_workspace <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L68" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_automations_for_workspace(db: PrefectDBInterface, session: AsyncSession, sort: AutomationSort = AutomationSort.NAME_ASC, limit: Optional[int] = None, offset: Optional[int] = None, automation_filter: Optional[filters.AutomationFilter] = None) -> Sequence[Automation]
count_automations_for_workspace <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L96" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>count_automations_for_workspace(db: PrefectDBInterface, session: AsyncSession) -> int
read_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L108" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_automation(db: PrefectDBInterface, session: AsyncSession, automation_id: UUID) -> Optional[Automation]
read_automation_by_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L122" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_automation_by_id(db: PrefectDBInterface, session: AsyncSession, automation_id: UUID) -> Optional[Automation]
create_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L194" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>create_automation(db: PrefectDBInterface, session: AsyncSession, automation: Automation) -> Automation
update_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L210" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>update_automation(db: PrefectDBInterface, session: AsyncSession, automation_update: Union[AutomationUpdate, AutomationPartialUpdate], automation_id: UUID) -> bool
delete_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L259" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>delete_automation(db: PrefectDBInterface, session: AsyncSession, automation_id: UUID) -> bool
delete_automations_for_workspace <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L300" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>delete_automations_for_workspace(db: PrefectDBInterface, session: AsyncSession) -> bool
disable_automations_for_workspace <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L322" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>disable_automations_for_workspace(db: PrefectDBInterface, session: AsyncSession) -> bool
disable_automation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L334" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>disable_automation(db: PrefectDBInterface, session: AsyncSession, automation_id: UUID) -> bool
relate_automation_to_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L387" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>relate_automation_to_resource(db: PrefectDBInterface, session: AsyncSession, automation_id: UUID, resource_id: str, owned_by_resource: bool) -> None
read_automations_related_to_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L418" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>read_automations_related_to_resource(db: PrefectDBInterface, session: AsyncSession, resource_id: str, owned_by_resource: Optional[bool] = None, automation_filter: Optional[filters.AutomationFilter] = None) -> Sequence[Automation]
delete_automations_owned_by_resource <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/models/automations.py#L449" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>delete_automations_owned_by_resource(db: PrefectDBInterface, session: AsyncSession, resource_id: str, automation_filter: Optional[filters.AutomationFilter] = None) -> Sequence[UUID]