worried-airplane-87065
09/15/2025, 6:38 PMancient-wolf-19325
09/15/2025, 6:38 PMacoustic-parrot-22802
09/18/2025, 6:11 PMancient-wolf-19325
09/18/2025, 6:11 PMfrom flytekit import task, workflow, map_task
@task
def increment(x: int) -> int:
return x + 1
@workflow
def default_parallelism_wf(data: list[int]) -> list[int]:
# All subtasks run in parallel (default behavior)
return map_task(increment)(x=data)
@workflow
def limited_parallelism_wf(data: list[int]) -> list[int]:
# Only 2 subtasks run in parallel at a time
return map_task(increment, concurrency=2)(x=data)
According to map_tasks.md, the concurrency argument controls the number of parallel executions; if omitted, all run in parallel.
Would you like a more detailed explanation of how this works?
Sources:
- map_tasks.md 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.