Hi, when a certain task has completed successfully, I'd like to trigger another deployment from within a flow. Is it possible to use something like .submit(wait_for=task) as you can do with tasks? when running a deployment in a flow?
Copy code
from prefect import flow
from prefect_kubernetes import run_namespaced_job
from prefect.deployments import run_deployment
@task(name="task1")
def task1():
print("task1")
@task(name="task2")
def task2():
print("task2")
@flow(task_runner=DaskTaskRunner())
def myflow():
task1_result = task1.submit()
task2_result = task2.submit(wait_for=task1_result)
task3_result = run_deployment(<flowname/deploymentname>) # Can I make this deployment run wait for task2 to complete?
j
Jeff Hale
10/09/2024, 1:51 PM
Hi Mich. You could use a state change hook - in particular a task’s
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.