https://prefect.io logo
#prefect-community
Title
# prefect-community
m

Matthew Seligson

06/01/2022, 2:29 PM
Is there way to pause flow execution? If there are running tasks, let them finish, and ensure that downstream tasks do not run.
k

Kevin Kho

06/01/2022, 2:47 PM
How do you want it to resume? The manual_only trigger pauses flows and you need to restart them in the UI. It should continue work that’s already in progress
m

Matthew Seligson

06/01/2022, 2:58 PM
I’m talking more operationally. If I use the manual trigger it will always pause at that part of the flow. I’m talking about pausing any given flow regardless of its triggers.
k

Kevin Kho

06/01/2022, 3:03 PM
I guess there’s no further built-in thing. What will continue the flow from pausing in your case?
m

Matthew Seligson

06/01/2022, 3:05 PM
It doesn’t have to be a built in thing. I’m wondering what workarounds are possible. Can we set all pending tasks to paused using the API?
k

Kevin Kho

06/01/2022, 3:08 PM
You could but the only concept of paused is the
manual_only
so you would need to click the UI or hit the API to unpause them. I’d rather block execution with a time.sleep but that wont play well when you have other Dask workers to pick up work
m

Matthew Seligson

06/01/2022, 3:10 PM
Hitting the API is totally fine. We just need to build tools to do things the UI can't. So you’re saying we can use the API to put all pending tasks in a paused state, and then use the API to put all paused tasks in a pending state again?
k

Kevin Kho

06/01/2022, 3:22 PM
Yes I believe that should be possible by moving it to the Paused state with the
set_task_run_state
mutation
10 Views