About this blueprint
Getting Started Local files Postgres
This flow is a simple example of a business automation use case. It queries a PostgreSQL database, writes the data to a CSV file, and converts the CSV file to an Excel file, making the data ready for further analysis by business users.
The flow has three tasks:
- The first task queries a PostgreSQL database.
- The second task writes the data to a CSV file.
- The third task converts the CSV file to an Excel file.
yaml
id: business_automation
namespace: tutorial
tasks:
- id: query
type: io.kestra.plugin.jdbc.postgresql.Query
url: jdbc:postgresql://hh-pgsql-public.ebi.ac.uk:5432/pfmegrnargs
username: reader
password: NWDMCE5xdipIjRrp
store: true
sql: |
SELECT
id,
timestamp,
upi, -- RNAcentral URS identifier
taxid, -- NCBI taxid
ac -- external accession
FROM xref
LIMIT 20;
- id: to_csv
type: io.kestra.plugin.serdes.csv.CsvWriter
from: "{{ outputs.query.uri }}"
- id: to_excel
type: io.kestra.plugin.serdes.excel.IonToExcel
from: "{{ outputs.query.uri }}"