Assets represent objects your workflows produce.
s3://
, postgres://
, snowflake://
) and can be hierarchically organized based on their path structure.
Assets exist in three primary states within Prefect:
@materialize
decorator, which functions as a specialized task decorator that tracks asset creation intent.
The materialization process operates on an “intent to materialize” model: when a function decorated with @materialize
executes, Prefect records the materialization attempt. Success or failure of the materialization is determined by the underlying task’s execution state.
asset_deps
parameter, which is particularly useful for modeling dependencies on external systems or when the task graph alone doesn’t fully capture the data dependencies.
asset_deps
parameter allows direct specification of asset dependencies, enabling modeling of relationships that aren’t captured in the task execution flow.
AssetProperties
class, which provides organizational context and improves discoverability:
add_asset_metadata()
function, allowing runtime information like row counts, processing times, and data quality metrics to be attached to materialization events.
prefect.asset.materialization.{succeeded|failed}
and are emitted when assets are referenced by the @materialize
decorator, with status determined by the underlying task execution state.prefect.asset.referenced
and are emitted for all upstream assets when a materialization occurs, independent of success or failure.prefect.asset.materialization.succeeded
for downstream assets and prefect.asset.referenced
for upstream assetsprefect.asset.materialization.failed
for downstream assets and prefect.asset.referenced
for upstream assetsadd_asset_metadata()
, while reference events contain basic asset identification information. This enables rich event-driven automation based on both asset state changes and associated metadata.
s3://
, postgres://
) are grouped together