Request icon
Query icon
If icon
Log icon
Schedule icon

Daily USD/INR exchange rate watcher with DuckDB and a threshold check

Fetch the daily USD/INR rate from a free API, extract it with DuckDB, and branch on a threshold using an If task and a daily schedule in Kestra.

Categories
Data

Track a currency pair without standing up a database. This blueprint calls a free exchange-rate API every day, reads the USD to INR rate out of the JSON response with DuckDB, and uses an If task to log whether the rate is above or at-or-below a threshold you choose.

How it works

  1. The daily_check trigger (io.kestra.plugin.core.trigger.Schedule) runs the flow every day at 09:00 Asia/Kolkata.
  2. fetch_rate uses io.kestra.plugin.core.http.Request to get the latest USD to INR rate from the Frankfurter API.
  3. extract_rate uses io.kestra.plugin.jdbc.duckdb.Query to mount the response as rates.json via inputFiles, then reads rates.INR and the date with read_json_auto. fetchType: FETCH_ONE returns a single row.
  4. check_rate uses io.kestra.plugin.core.flow.If to compare outputs.extract_rate.row.usd_inr with the threshold input, then runs above_threshold or below_threshold.

What you get

  • A daily exchange-rate check with a configurable threshold.
  • A pattern for reading a JSON API response with SQL in DuckDB.
  • A starting point for rate alerts: replace the log tasks with a notification.

Who it's for

  • Anyone who wants a simple, scheduled rate watcher.
  • Teams learning how HTTP, DuckDB, and flow-control tasks fit together in Kestra.

Prerequisites

  • A running Kestra instance with the DuckDB JDBC plugin available.
  • Outbound network access to the Frankfurter API.

Secrets

This flow uses no secrets. The Frankfurter API needs no key.

Inputs

  • threshold (FLOAT, default 80): the rate to compare against.

Quick start

  1. Add this flow to a Kestra namespace.
  2. Execute it, optionally changing threshold.
  3. Open the logs and look for the message from above_threshold or below_threshold.

Expected outputs

  • outputs.extract_rate.row.usd_inr: the current USD to INR rate.
  • outputs.extract_rate.row.rate_date: the date of the rate.

How to extend

  • Change symbols=INR and the SQL to watch another currency.
  • Replace the log tasks with a Slack or email notification.
  • Store each day's rate in a database to chart it over time.

Links

Orchestrate with Kestra
Orchestrate DuckDB with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.