Hello everyone! Is there a way to have a prefect l...
# ask-community
y
Hello everyone! Is there a way to have a prefect local agent wait for all tasks it’s running to finish before starting to work on a new task? It’s running a very slow and intensive process and I want it to finish before starting work on a new one.
k
Hi @Yuliy Kuroki! I think the only suggestion I have right now is Task concurrency limiting. This is only available in the paid tiers of cloud though. Otherwise, I think what you have to do is just set them as dependencies of each other so they run sequentially.
y
Can I get the currently running flows dynamically at launch and set it as a dependency of the flow?
k
Not quite but you can make a new Flow that just calls other flows with
StartFlowRun
as a task and then chain them together as dependencies. If you want something more dynamic, I would say use the
Client
to query for flow run state. You may want the
prefect.client.client.Client.get_flow_run_state
. And then you can start the more resource intensive tasks if the state is SUCCESS?
y
Thanks! I’ll try that