https://prefect.io logo
d

Daniel Nilsen

02/18/2022, 10:12 AM
how do I make one task run after the other even though they do not have any edges between them?
a

Anna Geller

02/18/2022, 10:30 AM
you can use the 
upstream_tasks
 argument:
Copy code
from prefect import task, Flow

@task
def task_1():
    pass

@task
def task_2():
    pass

@task
def task_3():
    pass

with Flow("flow_with_dependencies") as flow:
    t1 = task_1()
    t2 = task_2(upstream_tasks=[t1])
    t3 = task_3(upstream_tasks=[t2])
d

Daniel Nilsen

02/18/2022, 10:39 AM
ah nice, thanks:)
3 Views