Is there way to pause flow execution? If there are...
# ask-community
m
Is there way to pause flow execution? If there are running tasks, let them finish, and ensure that downstream tasks do not run.
k
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
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
I guess there’s no further built-in thing. What will continue the flow from pausing in your case?
m
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
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
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
Yes I believe that should be possible by moving it to the Paused state with the
set_task_run_state
mutation