In Prefect 2.x, deployment patterns have changed from Prefect 1.x. Prefect 2.x no longer requires flow pre-registration. Instead, you create deployments that specify the entry point to your flow code. For each deployment of the same flow, you can specify different details such as:
- Where to run your flow (your Infrastructure, such as a Docker Container, Kubernetes Job, or ECS Task).
- When to run your flow (a schedule like Interval, Cron, or RRule).
- How to run your flow (execution details such as parameters, task concurrency, etc.).
Creating different deployments for the same flow with potentially different entry points, schedules, infrastructures, and execution details is a standard way to handle various environments, like development and production, within Prefect 2.x. You can tailor each deployment to meet the requirements of its intended environment (development, testing, staging, production) by varying these details.
This makes it flexible for users to manage their flows across different stages of development and different runtime environments. You can have core logic shared across these deployments while tweaking only specific details relevant to each environment.