Possibility to hold/pause *Flow/Deployment*


We have been experimenting with the “Pause” feature for flow_runs, and they are great! Appreciate the convenient API for pausing a flow run from both in-process and out-process. What we have been trying to figure out is if there is a way to pause Flow/Deployment.

A quick background on what we are trying to do here:
If a Flow/Deployment is pause/hold:

  1. Flow runs of this flow should be Paused
  2. Scheduled flow runs from this Flow/Deployment will enter a Paused state directly from Scheduled
  3. Attempt to run a quick run from this deployment would fail/raise an error message in the UI
  4. Attempting to run this specific deployment via run_deployment() or other API calls should either create a Paused flow run or just fail.

Some background on what is our use case: we sometimes want to hold a set of Flows so that none of the will run in a 2~3 hr window, in which we can perform updates and test the external scripts/DB these flows call. More broadly, we feel it is a quite common use case to want to put some Flows/Deployments on hold/freeze, so that we can do roll-outs。

hi @PPPSDavid - it sounds like you could satisfy your use-case by using a set of automations (docs) to cancel flow runs during a certain period of time. You could have one additional automation that enables / disables the automation during a certain time period (or you could do this programmatically).

Does that sound like it would work for your use case?

Thanks @nate for the fast response here. Since our use cases require a programmatic way of holding flows, adding/removing automation every time through the UI seems sub-optimal. I noticed there is now an automation API, but seems like the documentation is still quite bare-bone. Will this API be integrated into a Python client?

Another question would be that currently, as you kindly noted, we can only have automation cancel a flow run. Since our use case is more like holding/pausing it, it would be nice if we can have automation that can pause a flow run as well. Since pausing already has its API, this seems quite straightforward. Would Prefect be willing to consider such a feature request?