Blina
11/23/2023, 1:39 PMMarvin
11/23/2023, 1:39 PMflow.deploy
and flow.serve
are methods used in Prefect for different purposes.
flow.deploy
is used to deploy your flows to a specific work pool. This is useful when you want to control where your flow runs are executed. For example, if you create a deployment through the interactive command line experience, you can choose the work pool you just created. If you are deploying an existing prefect.yaml file, the deployment would contain the work pool details.
On the other hand, flow.serve
is used to serve your flows and is a long-running process. This is particularly useful for remotely triggered or scheduled runs to be executed. When you rerun a script with flow.serve
, you will find an updated deployment in the UI that is actively scheduling work. If you stop the script using CTRL+C, your schedule will be automatically paused.
Please note that these are general descriptions and the exact usage might vary based on your specific use case and Prefect setup. You can find more detailed information in the Prefect documentation.