New to Kestra?
Use blueprints to kickstart your first workflows.
Pull sales CSVs into S3, run an in-process DuckDB SQL aggregation, convert the result to CSV, and email it automatically on the first of every month with Kestra.
Turn raw monthly order files into a finished sales report without standing up a warehouse. This flow extracts CSV data into Amazon S3 with Python, aggregates it directly over the S3 files using an in-process DuckDB engine, formats the result as CSV, and emails the report to stakeholders on the first day of every month. It is a lightweight, fully automated reporting pipeline that combines object storage, SQL analytics, and delivery in a single declarative workflow.
raw_data_to_s3 runs a Python io.kestra.plugin.scripts.python.Script task on a Docker task runner. It uses requests and boto3 to download twelve monthly order CSV files and upload each one to the target S3 bucket, emitting the S3 URIs as Kestra outputs.query runs io.kestra.plugin.jdbc.duckdb.Queries. It loads the DuckDB httpfs extension, sets the S3 region and credentials, then runs read_csv_auto('s3://kestraio/monthly_orders/*.csv') to sum totals by month. fetchType: STORE writes results to Kestra internal storage with a PT30S timeout.csv converts the stored Ion result into CSV via io.kestra.plugin.serdes.csv.IonToCsv.email sends the CSV as an attachment using io.kestra.plugin.email.MailSend over SMTP.monthly io.kestra.plugin.core.trigger.Schedule trigger fires on cron 0 9 1 * *, at 09:00 on the first of each month.DuckDB has no scheduler, no retry semantics, and no way to chain extraction, formatting, and email delivery. Kestra wraps the whole pipeline in declarative YAML: the Schedule trigger handles recurring runs, task-level retries and timeouts add resilience, outputs pass cleanly between Python, DuckDB, SerDes, and email tasks, and every run is logged with full lineage for auditing.
kestraio with your own) and an SMTP account.AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_DEFAULT_REGIONEMAIL_PASSWORDkestraio bucket name with your own bucket.from, to, and SMTP host/port values in the email task.monthly schedule take over.url at jdbc:duckdb:md: with a MOTHERDUCK_TOKEN secret.