How blocks work
There are three layers to a block: its type, a document, and a Python class.Block type
A block type is essentially a schema registered with the Prefect API. This schema can be inspected and discovered in the UI on the Blocks page. To see block types available for configuration, useprefect block type ls
from the CLI or navigate to the Blocks page in the UI and click +.

SecretStr type which are stored with additional encryption and not displayed by default in the UI.
Block types are identified by a slug that is not configurable.
Users should rarely need to register types in this way - saving a block document will also automatically register its type.
Block document
A block document is an instantiation of the schema, or block type. A document contains specific values for each field defined in the schema. All block types allow for the creation of as many documents as you wish. Building on our example above:Block class
A block class is the primary user-facing object; it is a Python class whose attributes are loaded from a block document. Most Prefect blocks encapsulate additional functionality built on top of the block document. For example, anS3Bucket block contains methods for downloading data from, or upload data to, an S3 bucket; a SnowflakeConnector block contains methods for querying Snowflake databases.
Returning to our Cube example from above:
Pre-registered blocks
Built-in blocks
Commonly used block types come built-in with Prefect. You can create and use these block types through the UI without installing any additional packages.Built-in blocks should be registered the first time you start a Prefect server. If the auto-registration fails, you can manually register the blocks using
prefect blocks register.For example, to register all built-in notification blocks, run prefect block register -m prefect.blocks.notifications.Blocks in Prefect integration libraries
Some block types that appear in the UI can be created immediately, with the corresponding integration library installed for use. For example, an AWS Secret block can be created, but not used until theprefect-aws library is installed.
Find available block types in many of the published Prefect integrations libraries.
If a block type is not available in the UI, you can register it through the CLI.
Anyone can create a custom block type and, optionally, share it with the community.