New to Kestra?
Use blueprints to kickstart your first workflows.
Detect new S3 files hourly, clean CSVs with Python and awswrangler, then upsert into an Apache Iceberg table on AWS Glue and Athena with Kestra.
Build an end-to-end ingestion pipeline that lands raw CSV files into an Apache Iceberg data lake on AWS. This blueprint detects new files in an Amazon S3 bucket, cleans and deduplicates them with Python and awswrangler, writes the result to an Iceberg table backed by AWS Glue, merges new records into a curated table with Amazon Athena, compacts small files, and archives processed inputs. It turns messy, periodically arriving CSV drops into a queryable, ACID-compliant lakehouse table without a separate ETL service.
list_objects task (io.kestra.plugin.aws.s3.List) lists objects under the prefix in the configured S3 bucket.check task (io.kestra.plugin.core.flow.If) evaluates outputs.list_objects.objects and only runs the downstream steps when new files exist.ingest_to_datalake task (io.kestra.plugin.scripts.python.Script) runs in a Docker taskRunner, installs awswrangler and kestra, reads the CSVs into a dataframe, filters and deduplicates rows, emits a nr_rows counter, and writes to an Iceberg table via wr.athena.to_iceberg.merge_query task (io.kestra.plugin.aws.athena.Query) runs a MERGE INTO to upsert raw records into the curated fruits table.optimize task runs OPTIMIZE ... REWRITE DATA USING BIN_PACK to compact small files.move_to_archive task (io.kestra.plugin.aws.cli.AwsCLI) moves processed files to an archive/ prefix.hourly_schedule trigger (io.kestra.plugin.core.trigger.Schedule, @hourly, disabled by default) drives the cadence.Athena, Glue, and S3 have no shared scheduler that can chain a conditional file check, a Python transform, SQL merges, and a CLI archive step into one observable run. Kestra adds event and schedule triggers, retries, full execution lineage, and declarative YAML so the entire flow is versioned and reproducible. The If task gives you native conditional branching that AWS analytics services cannot express on their own.
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGIONbucket, prefix, and database variables to match your environment.hourly_schedule trigger for continuous ingestion.Schedule trigger with an S3 event trigger for near-real-time ingestion