Blueprints

Getting started with Kestra — a Business Automation workflow example

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:

  1. The first task queries a PostgreSQL database.
  2. The second task writes the data to a CSV file.
  3. The third task converts the CSV file to an Excel file.
yaml
id: business_automation
namespace: tutorial
description: Business Automation

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.IonToCsv
    from: "{{ outputs.query.uri }}"

  - id: to_excel
    type: io.kestra.plugin.serdes.excel.IonToExcel
    from: "{{ outputs.query.uri }}"
    disabled: true

Query

Ion To Csv

Ion To Excel

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra