Ah, Prefect 2.0. It's a bit like a jigsaw puzzle, lots of pieces that fit together to form a complete picture. Here's a more detailed rundown of its basic components:
-
Flows: These are the heart of Prefect. A flow is a collection of tasks with defined dependencies - a blueprint of your workflow. Each task in a flow is a step in your workflow, and Prefect makes sure each step is carried out in the right order.
-
Tasks: Tasks are the individual steps within a flow. They are the smallest unit of work in Prefect and can be anything from data fetching, data cleaning, data transformation, to data loading. Tasks have inputs and outputs, and can be dependent on one another to form a sequence of operations.
-
Agents: Agents are the workers of Prefect. They are responsible for executing the tasks defined in your flows. In Prefect 2.0, there's only one type of agent, and its job is to look for tasks to run. The agent polls a work pool looking for flow runs.
-
Deployments: Deploying a flow means putting it into action. Prefect 2.0 offers flexibility for flow deployments, making it easier to move your flows through different stages of development, from testing to production. It eliminates the need for flow pre-registration, allowing for more flexibility in deployments.
-
Async Support: Prefect 2.0 provides native async support. This means it can manage tasks that don't need to be completed in a specific order, allowing for more efficient execution of workflows.
-
Pydantic Validation: Prefect 2.0 comes with out-of-the-box Pydantic validation. This feature checks your data to ensure it's in the right format, adding an extra layer of security to your workflows.
-
Blocks: These are a way to store configuration information. They're secure, editable through the user interface, and they check your data types for you. This makes it easy to manage the settings for your flows and tasks. Blocks allow you to securely store UI-editable, type-checked configuration to external systems and provide an easy-to-use Key-Value Store.
-
Notifications: Prefect 2.0 can send notifications about the status of your workflows. This feature is available in the open-source Prefect 2 version, allowing you to stay updated on the progress of your workflows.
-
Subflows: This is a way to organize your flows into smaller, more manageable pieces. You can think of a subflow as a mini-flow that's part of a larger flow. Prefect 2.0 introduces a first-class subflows concept, providing a natural and intuitive way of organizing your flows into modular sub-components.
Remember, these are just the basics. Prefect 2.0 is a powerful tool with a lot more to offer. I'd recommend checking out the
official documentation for a more in-depth look.