ASHIK
03/25/2026, 12:30 PMMarvin
03/25/2026, 12:30 PMMarvin
03/25/2026, 12:32 PMfrom prefect import flow
from prefect.task_runners import ThreadPoolTaskRunner
@flow(task_runner=ThreadPoolTaskRunner(max_workers=8))
def my_flow():
...
- Processes (explicit):
from prefect import flow
from prefect.task_runners import ProcessPoolTaskRunner
@flow(task_runner=ProcessPoolTaskRunner(max_workers=4))
def my_flow():
...
Rule of thumb
- Changing a Cloud concurrency limit will never create more threads/processes.
- Changing the task runner or its max_workers will never bypass Cloud concurrency limits.
- For a tagged task, the number actually running at once is bounded by both the task runner’s parallelism and the relevant limit (e.g., tag limit).
If you can share which limit you’re tuning (work pool, deployment, task tag, or a named/global limit) and which task runner you’re using, I can help you pick the right settings and expected “max parallel tasks” for your case.ASHIK
03/25/2026, 12:37 PMASHIK
03/25/2026, 12:48 PMMarvin
03/25/2026, 12:48 PMMarvin
03/25/2026, 12:51 PMfrom prefect import flow
from prefect.task_runners import ThreadPoolTaskRunner
@flow(task_runner=ThreadPoolTaskRunner(max_workers=8))
def my_flow():
...
- Processes (explicit):
from prefect import flow
from prefect.task_runners import ProcessPoolTaskRunner
@flow(task_runner=ProcessPoolTaskRunner(max_workers=4))
def my_flow():
...
Notes
- Concurrency limits are enforced when your flows/tasks are orchestrated by your OSS Prefect server. Pure “local runs” that don’t talk to the server won’t use server-side limits.
- Choosing processes vs threads is a performance choice (CPU-bound → processes, IO-bound → threads), not a concurrency-limits concern.
Docs
- Task runners: Task runners
- Work pools: Work pools
- Deployments (concurrency): Deployments
- Tag-based task limits: Tag-based task concurrency
- Global limits: Global concurrency limits
If you share which runner you’re using and which limit (work pool, deployment, tag, or global) you’re tuning, I can help compute your expected “max parallel tasks” in OSS.