Hi. In this example, if all the sub flows had the ...
# ask-community
c
Hi. In this example, if all the sub flows had the same parameters, how do I create a parameter at the parent flow to thread thru to the dependencies?
Copy code
flow_a = StartFlowRun(flow_name="A", project_name="examples", wait=True)
flow_b = StartFlowRun(flow_name="B", project_name="examples", wait=True)
flow_c = StartFlowRun(flow_name="C", project_name="examples", wait=True)
flow_d = StartFlowRun(flow_name="D", project_name="examples", wait=True)

with Flow("parent-flow", schedule=weekday_schedule) as flow:
    b = flow_b(upstream_tasks=[flow_a])
    c = flow_c(upstream_tasks=[flow_a])
    d = flow_d(upstream_tasks=[b, c])
I got it working
flow_a = StartFlowRun(flow_name="A", project_name="examples", wait=True)
flow_b = StartFlowRun(flow_name="B", project_name="examples", wait=True)
flow_c = StartFlowRun(flow_name="C", project_name="examples", wait=True)
flow_d = StartFlowRun(flow_name="D", project_name="examples", wait=True)
with Flow("parent-flow", schedule=weekday_schedule) as flow:
param = Parameter('name', default='carlo')
parameters = {'name': param}
b = flow_b(upstream_tasks=[flow_a], parameters=parameters)
c = flow_c(upstream_tasks=[flow_a], parameters=parameters)
d = flow_d(upstream_tasks=[b, c], parameters=parameters)
upvote 2
n
Nice @Carlo ! Yes, any args or inputs that a normal flow run would take can also be used in the start flow run task.