https://prefect.io logo
Title
d

Denis

11/08/2022, 1:08 PM
Hello, what is the proper way of triggering the same flow with different parameters in prefect 2, and then wait for all of them to finish. Example of what I want to achieve:
flow_run_ids=[]
for param in params:
    flow_run_id = create_flow_run(
            flow=flow_model,
            parameters=run_params,
            name=run_name,
            state=state
        )
    flow_run_ids.append(flow_run_id)

wait_for_flows(flow_run_ids)
Thanks for any help
m

Mason Menges

11/09/2022, 5:30 PM
Hey Dennis, I think you should be able to accomplish this with the run_deployment function here https://github.com/PrefectHQ/prefect/blob/main/src/prefect/deployments.py#L44
🙏 1
d

Denis

11/10/2022, 8:04 PM
Awesome thank you, we stumbled on this in the meantime and utilized it, thank you for confirming.