Prefect 2.7 is out with Pause & Resume and robust Cancellation functionality

And many more enhancements!

Anna Geller
8 min readDec 1, 2022

Prefect 2.7 ships with robust flow run cancellation, pause and resume functionality allowing manual approval from the UI, logging of print statements, and agent concurrency limits.

We’ll cover the enhancements in this post. As always, check the release notes and our documentation to learn more.

Flow run cancellation

We’re excited to announce a new robust way of canceling remote workflow execution. Flow runs can be canceled from the CLI, UI, REST API, or Python client. For example, to cancel a given flow run from the CLI, use:

prefect flow-run cancel flow_run_id

How does it work?

When cancellation is requested, the flow run is moved to a Cancelling state. The agent monitors the state of flow runs and detects that cancellation has been requested. The agent then sends a signal to the flow run infrastructure, requesting termination of the run. If the run does not terminate after a grace period (default of 30 seconds), the infrastructure will be killed, ensuring the flow run exits.

How does it differ from Prefect 1 implementation?

--

--