Hi i have a problem when i define three task and a...
# ask-community
a
Hi i have a problem when i define three task and add call them one by one under a flow they didn't run step by step !! how can i say to a flow to how run task (which task 1st which one 2nd and which one 3rd) ??? I'm adding a sample code as an reply to my message
a
@alins if you pass data dependencies, then you don’t need to set this at all. But if you don’t pass data, then: Method 1:
Copy code
with Flow(...) as flow:
    a = first_task()
    b = second_task()
    c = third_task(c_inputs, upstream_tasks=[a,b])
Method 2:
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()
a
Copy code
thanks @Anna Geller I will test you method and tell you if its work tnx again :heart:
👍 1