dathey
01/15/2025, 8:22 PMMarvin
01/15/2025, 8:22 PMwait_for
parameter in your flow or task definitions.
Here's a basic example:
python
from prefect import flow, task
@task
def task_a():
pass
@task
def task_b():
pass
@flow
def first_flow():
result = task_a.submit()
return result
@flow
def second_flow():
# Wait for first_flow to complete
result = first_flow()
task_b.submit(wait_for=[result])
# Run the second flow, which will wait for the first flow to complete
second_flow()
In this example, second_flow
will not proceed to execute task_b
until first_flow
has completed.
For more details, you can refer to the Prefect documentation on specifying upstream dependencies.dathey
01/15/2025, 8:25 PMMarvin
01/15/2025, 8:25 PM