Matt Gordon
01/22/2021, 6:49 PMfrom prefect import Flow, Task, task, Parameter
from prefect.tasks.prefect import StartFlowRun
@task
def first(k):
return {k: 10}
@task
def second(foo):
foo['quux'] = 20
foo['foo'] += 3
return foo
with Flow('f1') as f1:
p = Parameter('k', default='foo')
x = first(p)
with Flow('f2') as f2:
foo = Parameter('foo', default={'foo': 20})
y = second(foo)
ft1 = StartFlowRun(flow_name='f1',wait=True) # project_name here or not?
ft2 = StartFlowRun(flow_name='f2', wait=True)
with Flow('f3') as f3:
_r = ft1()
r = f3.run()