from prefect import Flow, task
from prefect.tasks.prefect.flow_run import StartFlowRun
import prefect
@task
def test(x):
return x+1
with Flow("flowA") as flow1:
test(1)
with Flow("flowB") as flow2:
test(1)
flow1.register("omlds")
flow2.register("omlds")
with Flow("main") as flow:
a = StartFlowRun("flowA", "omlds",
new_flow_context=prefect.context.get('config'),
wait=True,
parameters={'x': 1})()
b = StartFlowRun("flowA", "omlds",
new_flow_context=prefect.context.get('config'),
wait=True,
parameters={'x': 2})()
b.set_upstream(a)
flow.register("omlds")
🙌 1
c
Chris White
06/08/2021, 5:39 PM
You can also achieve this via a Cloud automation 😉
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.