You can store your flow code in GitHub or a cloud provider such as AWS. I suggest creating a deployment with Prefect projects. Check out the Project tutorial docs [here](
https://docs.prefect.io/2.10.12/tutorial/projects/).
The worker’s job is to poll for work from the work pool on Prefect Cloud or a Prefect server instance. Then the worker kicks off the flow run in the infrastructure specified in the deployment.