can I enforce order of the tasks in the flow ? tod...
# prefect-server
p
can I enforce order of the tasks in the flow ? today I noticed that some tasks were scheduled before even though they are right at the end in my code
a
yup, you can use
upstream_tasks
as follows:
Copy code
from prefect import task, Flow

@task
def first_task():
    pass

@task
def second_task():
    pass

@task
def third_task():
    pass

with Flow("ex") as flow:
    a = first_task()
    b = second_task(upstream_tasks=[a])
    c = third_task(upstream_tasks=[b])

flow.visualize()
👍 1
p
thanks a ton, let me try it out