cold-teacher-46250
02/17/2026, 4:18 PMancient-wolf-19325
02/17/2026, 4:18 PMasyncio.gather to execute all sequences in parallel. Each sequence can be parameterized for different inputs.
Example:
import asyncio
import flyte
env = flyte.TaskEnvironment("parallel_sequences")
@env.task
async def task_a(x: int) -> int:
return x + 1
@env.task
async def task_b(y: int) -> int:
return y * 2
@env.task
async def task_c(z: int) -> int:
return z - 3
@env.task
async def sequence(start: int) -> int:
a = await task_a(start)
b = await task_b(a)
c = await task_c(b)
return c
@env.task
async def main(starts: list[int]) -> list[int]:
tasks = [sequence(start) for start in starts]
results = await asyncio.gather(*tasks)
return results
This pattern allows you to run any number of independent A→B→C sequences in parallel, each with its own input, leveraging Flyte's distributed execution and true parallelism according to Flyte 2 async model and async example.
Would you like a step-by-step breakdown or more detail?
Sources:
- Parallelism in Flyte 1 vs Flyte 2
- llms-full.txt 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.cold-teacher-46250
02/17/2026, 4:21 PMancient-wolf-19325
02/17/2026, 4:21 PMmap operator to fan out the initial input, then chain B and C for each mapped result. The workflow DSL automatically parallelizes tasks that aren't dependent on each other, and map allows running a task multiple times in parallel with different inputs.
However, explicit async/await syntax and Python-native concurrency are not available in Flyte 1; parallelism is expressed via the workflow DSL and map operator, not Python async constructs. See Parallelism in Flyte 1 vs Flyte 2.
Would you like a code example or more detail?
Sources:
- Parallelism in Flyte 1 vs Flyte 2 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.