Download icon
CsvToIon icon
IonToExcel icon

Load multiple CSV files from an HTTP API into Excel Sheets

Download multiple CSV files from any HTTP API, convert each to Ion, and write them into separate sheets of a single Excel workbook with Kestra.

Categories
Data
id: load-multiple-csv-files-into-excel
namespace: company.team

tasks:
  - id: dataset1
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/products.csv

  - id: dataset2
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/fruit.csv

  - id: convert1
    type: io.kestra.plugin.serdes.csv.CsvToIon
    from: "{{ outputs.dataset1.uri }}"

  - id: convert2
    type: io.kestra.plugin.serdes.csv.CsvToIon
    from: "{{ outputs.dataset2.uri }}"

  - id: write_to_excel
    type: io.kestra.plugin.serdes.excel.IonToExcel
    from:
      Sheet_1: "{{ outputs.convert1.uri }}"
      Sheet_2: "{{ outputs.convert2.uri }}"

Turn scattered CSV files into one clean, multi-sheet Excel workbook. This flow downloads several CSV files from an HTTP API, normalizes each one through Kestra's internal Ion format, and writes them into separate, named sheets of a single .xlsx file. It solves the everyday reporting headache of stitching together files that arrive from different endpoints and handing stakeholders a single spreadsheet instead of a folder of loose CSVs.

How it works

  1. The dataset1 and dataset2 tasks use io.kestra.plugin.core.http.Download to fetch two CSV files from an HTTP API (here, sample products.csv and fruit.csv datasets).
  2. The convert1 and convert2 tasks use io.kestra.plugin.serdes.csv.CsvToIon to parse each downloaded CSV into Kestra's Amazon Ion format, a typed intermediate representation that makes downstream serialization reliable.
  3. The write_to_excel task uses io.kestra.plugin.serdes.excel.IonToExcel, mapping each Ion file to a named sheet via the from property (Sheet_1 and Sheet_2) to produce one Excel workbook.

What you get

  • A single .xlsx workbook with one sheet per source CSV
  • Consistent typing thanks to the Ion conversion step
  • A reusable pattern that scales to any number of CSV inputs and sheets
  • A downloadable output you can share, email, or push to storage

Who it's for

  • Data and analytics engineers consolidating exports into report-ready spreadsheets
  • Operations and finance teams who live in Excel
  • Anyone automating recurring CSV-to-Excel deliverables

Why orchestrate this with Kestra

A spreadsheet tool or a one-off script has no scheduler, no retry logic, and no record of what ran when. With Kestra you define the whole pipeline as declarative YAML, add an event or schedule trigger so the workbook regenerates whenever fresh data lands, set retries on the HTTP downloads so a flaky endpoint does not break your report, and get full execution lineage and logs for every run. The serdes plugins handle format conversion that Excel itself cannot orchestrate end to end.

Prerequisites

  • A running Kestra instance
  • HTTP access to the CSV source URLs

Secrets

This flow uses public sample datasets and references no secrets. If you point it at an authenticated API, add credentials with {{ secret('NAME') }} and inject them into the Download task headers.

Quick start

  1. Copy this flow into a Kestra namespace.
  2. Replace the two uri values in dataset1 and dataset2 with your own CSV endpoints.
  3. Execute the flow and download the generated .xlsx from the write_to_excel outputs.

How to extend

  • Add more Download and CsvToIon task pairs and extra keys in the IonToExcel from map to support additional sheets.
  • Add a Schedule or webhook trigger to regenerate the workbook automatically.
  • Send the resulting file to object storage, email, or a Slack channel as a final task.
  • Swap Download for a database query task to build Excel reports straight from your warehouse.

Links

Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.