When a Dag exists only to produce one asset, @asset writes it in one function:
@asset(schedule="@daily", start_date=pendulum.datetime(2026, 11, 1, tz="UTC"))
def daily_sales(self, context):
day = context["ds"]
...
yield Metadata(self, {"day": day})
This creates an asset named daily_sales, a Dag with the id daily_sales, and one task, also daily_sales, whose outlet is the asset. The module-level name daily_sales is now the asset, so another definition can be scheduled on it: @asset(schedule=daily_sales).
Three parameter names are reserved: self (the asset being produced), context (the run's context, so context["ds"] in a scheduled run and context["triggering_asset_events"] in an asset-triggered one) and outlet_events. Any other parameter named after an asset declares an inlet: it records that this asset reads that one, but it does not schedule anything.
@asset suits asset-first pipelines. If you have used Dagster, this is the closest Airflow comes to an asset definition, but each @asset is still a Dag with one task. A @dag with outlets does the same job with more room for several tasks.