https://prefect.io logo
Title
a

Alex Wilcoxson

03/22/2023, 3:46 PM
Hey there, if I am using subflows with the entrypoint flow running on k8s. Can subflows be run as separate k8s jobs?
1
d

Deceivious

03/22/2023, 3:58 PM
Each of the subflows need a seperate deployment if u want the sub flow to run on a separate infra block
a

Alex Wilcoxson

03/22/2023, 4:13 PM
gotcha, and if they have separate deployments, simply calling the flow function from the entrypoint flow would be enough to start subflow on own infra?
d

Deceivious

03/22/2023, 4:26 PM
Theres a run_deployment method
U can call the deployment u deployed for subflow to run it by the deployment name
So instead of calling
subflow()
You will have:
deploy_subflow(flow=subflow,deployment_name=dep_name)# u have to write this method
run_deployment(dep_name) # this method is in prefect
🙌 1
a

Alex Wilcoxson

03/22/2023, 5:01 PM
👍 thanks!