Charles Leung
04/12/2023, 10:33 PMMike Grabbe
04/13/2023, 1:32 AMwait_for
parameter when calling a task. wait_for
accepts a list of one or more tasks.Ryan Peden
04/13/2023, 1:43 AM@flow()
def main_flow() -> None:
result_1 = task_1()
result_2 = task_2(result_1)
task_3(result_2)
sub_flow_result = sub_flow()
result_4 = task_4(sub_flow_result)
result_5 = task_5(wait_for=[result_4])
sub_flow(wait_for=[result_5])
Charles Leung
04/13/2023, 4:51 PMfrom prefect import flow, task
@task
def task_1():
pass
@task
def task_2():
pass
@task
def task_3():
pass
@flow
def my_flow():
x = task_1()
# task 2 will wait for task_1 to complete
y = task_2(wait_for=[x])
task_3()
if __name__ == "__main__":
my_flow()
but my flow graph still came out like this. Am I invoking the tasks incorrectly?