New to Kestra?
Use blueprints to kickstart your first workflows.
Ingest JSON from Amazon S3, merge and curate it with DuckDB, and register raw, staging, and curated dataset assets as governed Kestra assets with lineage.
This blueprint turns a pile of raw JSON files in Amazon S3 into a curated, governed dataset with end to end lineage. It downloads matching JSON objects from an S3 bucket, merges them into one unified file, stages that file back to S3, curates it with DuckDB, and registers each transformation as a tracked dataset asset. It solves a common data engineering problem: ingesting semi-structured JSON from object storage while keeping a clear, auditable trail of how raw inputs became a clean, queryable dataset.
download_json_from_s3 (io.kestra.plugin.aws.s3.Downloads) pulls every object in the bucket matching the regexp filter from the chosen region and registers them as a raw dataset asset (raw_json_files).concat_dynamic_one (io.kestra.plugin.core.storage.Concat) merges the downloaded files into a single unified-data.json and registers it as a staging dataset asset.upload_unified_json_to_s3 (io.kestra.plugin.aws.s3.Upload) writes the unified file to processed/{{ flow.id }}/unified-data.json and registers a staging_s3 asset.duckdb_process_and_query (io.kestra.plugin.jdbc.duckdb.Queries) loads the unified JSON into DuckDB with read_json, builds a unified_dataset table, and persists a curated dataset asset (with outputDbFile enabled).ship_assets (io.kestra.plugin.ee.assets.AssetShipper) exports the curated dataset as JSON for downstream consumers.S3 and DuckDB have no shared scheduler or cross-tool lineage. Kestra ties the download, merge, upload, and curation steps into one declarative YAML flow, with event triggers, retries, and asset lineage that the individual tools cannot provide on their own. Every step registers a typed io.kestra.plugin.ee.assets.Dataset, so the catalog shows exactly how raw inputs flowed into the curated table, something neither S3 lifecycle rules nor DuckDB can track.
An S3 bucket containing JSON files (the defaults expect names like lead-001.json) and a Kestra Enterprise Edition instance for asset governance.
AWS_ACCESS_KEY_ID: IAM access key with read and write access to the source bucket.AWS_SECRET_KEY_ID: IAM secret key paired with the access key.bucket, regexp, and region inputs to target your JSON files.AWS_ACCESS_KEY_ID and AWS_SECRET_KEY_ID secrets in Kestra.Schedule or S3 event trigger to run the flow automatically on new files.errors handling to quarantine malformed JSON.