<@ULVA73B9P> what is the difference between `flow....
# ask-marvin
t
@Marvin what is the difference between
flow.serve
and
flow.deploy
methods?
m
Here are the key points regarding the flow.serve and flow.deploy methods from Prefect documentation: 1. flow.serve: - Running the script with this method allows remotely triggered or scheduled runs to be executed. - It acts as a long-running process. Your script must be running for the schedules to be active. - Mainly used for single flow deployments. - Example usage:
Copy code
python
   get_repo_info.serve(
       name="my-first-deployment",
       cron="* * * * *",
       tags=["testing", "tutorial"],
       description="Given a GitHub repository, logs repository statistics for that repo.",
       version="tutorial/deployments",
   )
- More details here 2. flow.deploy: - Used to create and register deployment objects with the Prefect API. - It creates a deployment definition and can include various configuration options like storage, infrastructure, and schedules. - Example usage:
Copy code
python
   slow_deploy = slow_flow.to_deployment(name="sleeper", interval=45)
   fast_deploy = fast_flow.to_deployment(name="fast")
   serve(slow_deploy, fast_deploy)
- More details here Both methods are related to deploying flows, but flow.serve keeps the script running to manage scheduling, while flow.deploy registers the flow deployment with Prefect's API for more managed execution.