Prefect 2 introduced several new features and changes compared to Prefect 1:
-
Agents: In Prefect 2, there is only one generic agent type. The agent polls a work pool looking for flow runs.
-
Flexibility: Prefect 2 offers more flexibility thanks to the elimination of flow pre-registration. It also provides more flexibility for flow deployments, including easier promotion of a flow through development, staging, and production environments.
-
Async Support: Prefect 2 has native async support.
-
Validation: Out-of-the-box pydantic validation is available in Prefect 2.
-
Blocks: Prefect 2 introduced Blocks that allow you to securely store UI-editable, type-checked configuration to external systems and an easy-to-use Key-Value Store. All these components are configurable in one place and provided as part of the open-source Prefect 2 product. In contrast, the concept of Secrets in Prefect 1 was much more narrow and only available in Prefect Cloud.
-
Notifications: Notifications are available in the open-source Prefect 2 version, as opposed to Cloud-only Automations in Prefect 1.
-
Subflows: Prefect 2 introduced a first-class subflows concept. Prefect 1 only allowed the flow-of-flows orchestrator pattern. With Prefect 2 subflows, you gain a natural and intuitive way of organizing your flows into modular sub-components.
For more details, you can check out the
migration guide.