Hi all, I want to make a Flow where I run certain ...
# ask-community
l
Hi all, I want to make a Flow where I run certain tasks on different agents (some on Local, some on Kubernetes). For this purpose I've understood I need to wrap my Tasks in Flows, which have different run_configs depending on where they are run. I now have one parent Flow from which I launch child Flows using StartFlowRun. My question is how do I pass Parameters to these child Flows?
Copy code
extract_flow_task = StartFlowRun(flow_name=extract_flow.name, wait=True, project_name=PROJECT_NAME)
transform_flow_task = StartFlowRun(flow_name=transform_flow.name, wait=True, project_name=PROJECT_NAME)

#
# Parent flow, executed on Kubernetes agent
#
with Flow("parent_flow", storage=storage, run_config=KubernetesRun(labels=["kubernetes"])) as parent_flow:
    date_YYYYmmdd = Parameter("date_YYYYmmdd")
    extract_task = extract_flow_task() # How to pass date_YYYYmmdd to this flow/task?
    transform_flow_task(upstream_tasks=[extract_task]) # How to pass date_YYYYmmdd to this flow/task?
k
Hey @Lauri Makinen, the setup looks good!
StartFlowRun
takes an argument called
parameters
so it can be
transform_flow_task(upstream_tasks=[extract_task], parameters={"param_name", dateYYYmmdd})
l
Cool! Thanks @Kevin Kho!