docs/v3/api-ref/python/prefect-server-events-actions.mdx
prefect.server.events.actionsThe actions consumer watches for actions that have been triggered by Automations and carries them out. Also includes the various concrete subtypes of Actions
record_action_happening <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1813" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>record_action_happening(id: UUID) -> None
Record that an action has happened, with an expiration of an hour.
action_has_already_happened <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1818" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>action_has_already_happened(id: UUID) -> bool
Check if the action has already happened
consumer <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1824" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>consumer() -> AsyncGenerator[MessageHandler, None]
ActionFailed <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L109" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Action <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>An Action that may be performed when an Automation is triggered
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L127" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
Perform the requested Action
fail <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L130" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>fail(self, triggered_action: 'TriggeredAction', reason: str) -> None
logging_context <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L313" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>logging_context(self, triggered_action: 'TriggeredAction') -> Dict[str, Any]
Common logging context for all actions
model_validate_list <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L56" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>model_validate_list(cls, obj: Any) -> list[Self]
reset_fields <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/_internal/schemas/bases.py#L85" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reset_fields(self: Self) -> Self
Reset the fields of the model that are in the _reset_fields set.
Returns:
succeed <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L225" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>succeed(self, triggered_action: 'TriggeredAction') -> None
DoNothing <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L330" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Do nothing when an Automation is triggered
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L335" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
EmitEventAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L342" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L343" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
create_event <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L352" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>create_event(self, triggered_action: 'TriggeredAction') -> 'Event'
Create an event from the TriggeredAction
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
ExternalDataAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L356" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that require data from an external source such as the Orchestration API
Methods:
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
JinjaTemplateAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L450" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that use Jinja templates supplied by the user and are rendered with a context containing data from the triggered action, and the orchestration API.
Methods:
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
instantiate_object <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L501" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>instantiate_object(self, model: Type[PrefectBaseModel], data: Dict[str, Any], triggered_action: 'TriggeredAction', resource: Optional['Resource'] = None) -> PrefectBaseModel
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
templates_in_dictionary <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L480" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>templates_in_dictionary(cls, dict_: dict[Any, Any | dict[Any, Any]]) -> list[tuple[dict[Any, Any], dict[Any, str]]]
validate_template <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L469" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_template(cls, template: str, field_name: str) -> str
DeploymentAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L700" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that operate on Deployments and need to infer them from events
Methods:
deployment_id_to_use <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L729" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>deployment_id_to_use(self, triggered_action: 'TriggeredAction') -> UUID
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
selected_deployment_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L719" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_deployment_requires_id(self) -> Self
DeploymentCommandAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L745" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Executes a command against a matching deployment
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L750" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L780" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
Execute the deployment command
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
selected_deployment_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L49" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_deployment_requires_id(self)
RunDeployment <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L789" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Runs the given deployment with the given parameters
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L750" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L818" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L780" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
Execute the deployment command
instantiate_object <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L501" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>instantiate_object(self, model: Type[PrefectBaseModel], data: Dict[str, Any], triggered_action: 'TriggeredAction', resource: Optional['Resource'] = None) -> PrefectBaseModel
render_parameters <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L932" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>render_parameters(self, triggered_action: 'TriggeredAction') -> Dict[str, Any]
templates_in_dictionary <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L480" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>templates_in_dictionary(cls, dict_: dict[Any, Any | dict[Any, Any]]) -> list[tuple[dict[Any, Any], dict[Any, str]]]
validate_parameters <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L875" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_parameters(cls, value: dict[str, Any] | None) -> dict[str, Any] | None
validate_template <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L469" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_template(cls, template: str, field_name: str) -> str
PauseDeployment <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1056" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Pauses the given Deployment
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L750" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1063" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L780" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
Execute the deployment command
ResumeDeployment <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1072" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resumes the given Deployment
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L750" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1079" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L780" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', deployment_id: UUID, triggered_action: 'TriggeredAction') -> Response
Execute the deployment command
FlowRunAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1088" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>An action that operates on a flow run
Methods:
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
flow_run <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1091" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>flow_run(self, triggered_action: 'TriggeredAction') -> UUID
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
FlowRunStateChangeAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1107" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Changes the state of a flow run associated with the trigger
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
flow_run <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1091" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>flow_run(self, triggered_action: 'TriggeredAction') -> UUID
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
Return the new state for the flow run
ChangeFlowRunState <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Changes the state of a flow run associated with the trigger
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1172" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
Return the new state for the flow run
CancelFlowRun <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1185" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Cancels a flow run associated with the trigger
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1190" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
Return the new state for the flow run
SuspendFlowRun <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1197" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Suspends a flow run associated with the trigger
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1114" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1202" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
new_state <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1111" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>new_state(self, triggered_action: 'TriggeredAction') -> StateCreate
Return the new state for the flow run
ResumeFlowRun <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1216" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resumes a paused or suspended flow run associated with the trigger
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1221" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
flow_run <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1091" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>flow_run(self, triggered_action: 'TriggeredAction') -> UUID
CallWebhook <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1250" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Call a webhook when an Automation is triggered.
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1327" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
ensure_payload_is_a_string <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1264" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>ensure_payload_is_a_string(cls, value: Union[str, Dict[str, Any], None]) -> Optional[str]
Temporary measure while we migrate payloads from being a dictionary to
a string template. This covers both reading from the database where values
may currently be a dictionary, as well as the API, where older versions of the
frontend may be sending a JSON object with the single "message" key.
instantiate_object <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L501" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>instantiate_object(self, model: Type[PrefectBaseModel], data: Dict[str, Any], triggered_action: 'TriggeredAction', resource: Optional['Resource'] = None) -> PrefectBaseModel
templates_in_dictionary <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L480" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>templates_in_dictionary(cls, dict_: dict[Any, Any | dict[Any, Any]]) -> list[tuple[dict[Any, Any], dict[Any, str]]]
validate_payload_templates <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1281" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_payload_templates(cls, value: Optional[str]) -> Optional[str]
Validate user-provided payload template.
validate_template <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L469" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_template(cls, template: str, field_name: str) -> str
SendNotification <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1350" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Send a notification when an Automation is triggered
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1401" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
instantiate_object <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L501" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>instantiate_object(self, model: Type[PrefectBaseModel], data: Dict[str, Any], triggered_action: 'TriggeredAction', resource: Optional['Resource'] = None) -> PrefectBaseModel
is_valid_template <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1361" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>is_valid_template(cls, value: str, info: ValidationInfo) -> str
render <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1413" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>render(self, triggered_action: 'TriggeredAction') -> List[str]
templates_in_dictionary <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L480" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>templates_in_dictionary(cls, dict_: dict[Any, Any | dict[Any, Any]]) -> list[tuple[dict[Any, Any], dict[Any, str]]]
validate_template <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L469" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>validate_template(cls, template: str, field_name: str) -> str
WorkPoolAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1417" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that operate on Work Pools and need to infer them from events
Methods:
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
selected_work_pool_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1437" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_work_pool_requires_id(self) -> Self
work_pool_id_to_use <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1446" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>work_pool_id_to_use(self, triggered_action: 'TriggeredAction') -> UUID
WorkPoolCommandAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1462" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1481" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1510" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_pool: WorkPool, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Pool
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
target_work_pool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1467" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>target_work_pool(self, triggered_action: 'TriggeredAction') -> WorkPool
PauseWorkPool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1519" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Pauses a Work Pool
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1481" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1526" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_pool: WorkPool, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1510" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_pool: WorkPool, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Pool
target_work_pool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1467" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>target_work_pool(self, triggered_action: 'TriggeredAction') -> WorkPool
ResumeWorkPool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1535" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resumes a Work Pool
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1481" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1542" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_pool: WorkPool, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1510" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_pool: WorkPool, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Pool
target_work_pool <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1467" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>target_work_pool(self, triggered_action: 'TriggeredAction') -> WorkPool
WorkQueueAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1551" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that operate on Work Queues and need to infer them from events
Methods:
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
selected_work_queue_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1570" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_work_queue_requires_id(self) -> Self
work_queue_id_to_use <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1580" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>work_queue_id_to_use(self, triggered_action: 'TriggeredAction') -> UUID
WorkQueueCommandAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1596" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1599" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1629" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_queue_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
selected_work_queue_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L216" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_work_queue_requires_id(self) -> Self
PauseWorkQueue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1638" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Pauses a Work Queue
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1599" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1645" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_queue_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1629" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_queue_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue
ResumeWorkQueue <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1654" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resumes a Work Queue
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1599" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1661" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_queue_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1629" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, orchestration: 'OrchestrationClient', work_queue_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue
AutomationAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1670" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Base class for Actions that operate on Automations and need to infer them from events
Methods:
automation_id_to_use <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1699" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>automation_id_to_use(self, triggered_action: 'TriggeredAction') -> UUID
describe_for_cli <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L19" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>describe_for_cli(self) -> str
A human-readable description of the action
selected_automation_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1689" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_automation_requires_id(self) -> Self
AutomationCommandAction <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1715" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1718" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1746" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, events: PrefectServerEventsAPIClient, automation_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue
events_api_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L374" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>events_api_client(self, triggered_action: 'TriggeredAction') -> PrefectServerEventsAPIClient
orchestration_client <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L360" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>orchestration_client(self, triggered_action: 'TriggeredAction') -> 'OrchestrationClient'
reason_from_response <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L386" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>reason_from_response(self, response: Response) -> str
selected_automation_requires_id <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/events/actions.py#L258" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>selected_automation_requires_id(self) -> Self
PauseAutomation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1755" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Pauses a Work Queue
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1718" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1762" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, events: PrefectServerEventsAPIClient, automation_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1746" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, events: PrefectServerEventsAPIClient, automation_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue
ResumeAutomation <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1771" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>Resumes a Work Queue
Methods:
act <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1718" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>act(self, triggered_action: 'TriggeredAction') -> None
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1778" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, events: PrefectServerEventsAPIClient, automation_id: UUID, triggered_action: 'TriggeredAction') -> Response
command <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/actions.py#L1746" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>command(self, events: PrefectServerEventsAPIClient, automation_id: UUID, triggered_action: 'TriggeredAction') -> Response
Issue the command to the Work Queue