New to Kestra?
Use blueprints to kickstart your first workflows.
Build governed staging and mart analytics assets with DuckDB and Kestra. Materialize tables, register assets, and track end-to-end data lineage automatically.
Turn a plain SQL data pipeline into a fully governed analytics workflow with DuckDB and Kestra Assets. This blueprint materializes staging and mart tables in DuckDB (backed by MotherDuck), registers each result as a first-class Kestra asset, and automatically builds a data lineage graph from external source to staging to marts. It solves the common problem of untracked, undocumented SQL tables that nobody can trace, audit, or trust.
create_staging_layer_asset runs io.kestra.plugin.jdbc.duckdb.Query to build a trips table from sample_data.nyc.taxi. It declares sample_data.nyc.taxi as an input asset and registers trips as an output io.kestra.plugin.ee.assets.Table with metadata.model_layer: staging.for_each is an io.kestra.plugin.core.flow.ForEach over passenger_count and trip_distance.create_mart_layer_asset runs a DuckDB Query computing AVG({{taskrun.value}}), declares trips as its input asset, and registers avg_{{taskrun.value}} as an output Table asset with metadata.model_layer: mart.pluginDefaults points every DuckDB task at MotherDuck via jdbc:duckdb:md:my_db and sets fetchType: STORE.avg_passenger_count, avg_trip_distance).trips to mart aggregates.model_layer) that makes layers discoverable in the catalog.DuckDB executes SQL but has no scheduler, no lineage tracking, and no asset catalog. Kestra adds declarative YAML pipelines, event and schedule triggers, retries, and full execution observability. Crucially, Kestra Assets capture input and output relationships across tasks, so lineage, dependency graphs, and impact analysis come for free, something a DuckDB connection alone cannot provide.
MOTHERDUCK_TOKEN: the MotherDuck access token used in the DuckDB JDBC URL.MOTHERDUCK_TOKEN secret to your Kestra instance.sample_data.nyc.taxi for your own source tables.ForEach values list to generate extra marts.metadata with owners, descriptions, or quality tags.