In Prefect 3.x, you can run subflows on different workers by using the concept of worker types and work pools. Prefect workers are responsible for executing flow runs and can be configured to match different execution environments. Here's how you could potentially achieve running subflows on different workers:
1.
Work Pools and Workers: Prefect workers can poll work pools for new flow runs to execute. Each worker type corresponds to an execution environment, like Kubernetes, Docker, ECS, etc. You need to ensure that your subflows are assigned to different work pools that match the desired worker type.
2.
Assigning Deployment to Work Pools: When you create a deployment for your flows, you assign them to specific work pools. This determines in which execution environment the flow runs will be executed.
3.
Worker Infrastructure: The worker manages the provisioning of the infrastructure required for running the flow. Hence, by assigning different subflows to different work pools (each associated with specific worker types), the subflows can be run on different workers.
You can find more details about workers in Prefect 3.x in the
Prefect documentation on workers.
If you need further help on setting this up, feel free to ask!