<@U06RKAMK0UC> If i want to compose a workflow wit...
# ask-ai
e
@ancient-wolf-19325 If i want to compose a workflow with two tasks but they don't depend on each other, but I explicitly want task 2 to wait on task 1 to complete, what is the best way to communicate that in the workflow definition?
a
In Flyte 1, you can specify execution order without data dependency using the
>>
operator:
task1() >> task2()
. This enforces that
task2
runs after
task1
, even if they don't share inputs or outputs. Example:
Copy code
@workflow
def wf():
    promise1 = task1()
    promise2 = task2()
    promise1 >> promise2
According to Flyte Fundamentals: Tasks, Workflows, and Launch Plans, this is the idiomatic way in Flyte 1. In Flyte 2, the
>>
ordering notation is removed. Instead, sequential calls in the workflow/task body naturally enforce order: calling
task1()
before
task2()
ensures
task2
waits for
task1
to finish, even if there is no data dependency. See Union.ai migration gotchas. Would you like more detail or code examples for both Flyte 1 and Flyte 2? Sources: - Flyte Fundamentals: Tasks, Workflows, and Launch Plans - Union.ai migration gotchas 👍 1 button 👎 0 button 💡 Hint: Mention @ancient-wolf-19325 in the thread for followups.