Jon Ruhnke
08/11/2022, 7:11 PMNate
08/11/2022, 7:22 PMcreate_flow_run.map([{'child_arg': 'value'}, ...], flow_name=unmapped(my_flow_name))
or you could define your own task using the python client, which you could again map over like
@task
def trigger_flow_run(arg: Tuple) -> None:
child_flow_name, params = arg
print(f'Starting child flow run {child_flow_name}')
client = Client()
client.create_flow_run(
run_name=f"{context.flow_run_name}-{child_flow_name}",
version_group_id="YOUR_CHILD_FLOWS_VERSION_GROUP_ID",
parameters=params
with Flow('Parent Flow') as flow:
children = [
('child_flow_1', {'child_arg': 'value_1'}), ('child_flow_2', {'child_arg': 'value_2'})
]
trigger_flow_run.map(children)
Jon Ruhnke
08/11/2022, 7:53 PMwith Flow('pipeline-sap-child') as child_flow:
entity_config = assemble_config({'name': 't141t'}, 'sap')
raw_data = extract(entity_config)
with Flow('pipeline-sap-parent') as parent_flow:
child_run_id = create_flow_run(flow_name='pipeline-sap-child')
if __name__ == '__main__':
parent_flow.run()
Anna Geller
08/12/2022, 1:49 PM