Hey Guys I want to setup a flow dependency for my ...
# prefect-community
a
Hey Guys I want to setup a flow dependency for my task, basically I am running a flow, inside which I have a flow which downloads some data and then after this data has been downloaded I want to run some tasks, but when I try to do so the download flow runs successfully but the tasks after that end up failing, any idea why could that be happening and how can I fix it?
a
This is the default behavior in Prefect that, once you set dependencies between tasks, downstream tasks run only when upstream tasks are finished successfully. Example:
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])
a
In my case the upstream task is actually a flow, for which I have certain downstream tasks that will run once it is completed
a
maybe the one post above provides the answer then? https://prefect-community.slack.com/archives/CL09KU1K7/p1651665155726849 otherwise, can you share the code you have so far and explain why it doesn't match your expectations?
376 Views