https://prefect.io logo
t

Thomas Opsomer

01/19/2022, 2:44 PM
Hello community ! Is it possible to limit/prevent some tasks to run at the same time ? I've read the doc on concurrency limits, but it doesn't seem to handle my use case. For instance if y a have 2 tasks A and B, I'd like to either prevent them to run at the same time or to limit the number of A and B that can run simultaneously.
k

Kevin Kho

01/19/2022, 2:47 PM
If you just want them to run sequentially, you can set A as upstream of B. If you want to limit the number of simultaneous runs, you can give them the same tag for task-level concurrency limits
t

Thomas Opsomer

01/19/2022, 3:09 PM
Thanks @Kevin Kho šŸ™‚ I see for the shared tag, but I was thinking more to have conditions on each task and also conditions on the combinaison of both like: • allow A to have a concurrency of 5 • allow B to have a concurrency of 1 • A cannot run simultaneously as B
k

Kevin Kho

01/19/2022, 3:14 PM
In that case you really need an upstream. If B is mapped as well, the current behavior is only one mapped task is run at a time (not an explicit feature)
šŸ‘ 1