New to Kestra?
Use blueprints to kickstart your first workflows.
Extract JSON data from a REST API and load it into DuckDB with dlt, orchestrated by Kestra in a containerized Python task with retries and scheduling.
Load JSON data from a REST API straight into a DuckDB database using dlt (data load tool), orchestrated by Kestra in a containerized Python task. This blueprint solves a common ELT problem: you have a JSON API and you want analytics-ready tables without hand-writing schema definitions, CREATE TABLE statements, or type-mapping code. dlt infers the schema, normalizes nested JSON, and creates the tables for you, while Kestra handles scheduling, retries, container isolation, and output capture.
A single task, dlt_pipeline (io.kestra.plugin.scripts.python.Script), runs an inline Python script inside a Docker container. The task uses the io.kestra.plugin.scripts.runner.docker.Docker runner with the python:3.11-slim image and installs dlt[duckdb] and requests via the dependencies property at runtime.
The script:
https://dummyjson.com/products with requests and calls raise_for_status() so HTTP errors fail the task.products array from the JSON payload.dummyjson_products_pipeline) with destination='duckdb' and dataset_name='products'.pipeline.run(data, table_name='product'), letting dlt infer the schema, normalize the JSON, and write the product table.The outputFiles property captures dummy_products.duckdb as a Kestra output, so the resulting database file is downloadable from the execution.
dlt is an excellent loading library, but it has no scheduler, no retry engine, and no execution history of its own. Kestra adds declarative YAML pipelines, event and schedule triggers, automatic retries on transient API failures, full execution lineage and logs, and container-based isolation so dependencies never collide. You get the dlt loading experience with production-grade orchestration around it, something the library alone cannot provide.
This blueprint targets a public API and writes to a local DuckDB file, so no secrets are required. To pull from an authenticated API, add a secret such as API_TOKEN and reference it with {{ secret('API_TOKEN') }}.
python:3.11-slim.dummy_products.duckdb from the execution outputs and query the product table.table_name.Schedule trigger to run ingestion on a cron, or a webhook trigger for event-driven loads.