AI Automation System

Daily Currency Intelligence Report

A scheduled n8n automation that fetches exchange rates from PrivatBank API and sends a styled HTML email daily.
n8n Cron REST API JavaScript Gmail HTML Email

Context & Problem

Business case

Businesses and individuals often need daily currency monitoring for operational decisions, budgeting, or financial awareness. Manually checking exchange rates each morning creates friction and wastes time.

Manual process: open banking website → check USD/EUR → copy numbers → format message → send email. This causes delays, human errors, and inconsistent reporting.

Goal: Build a fully automated daily financial reporting system that delivers currency updates directly via email at 09:00.

Implementation

Architecture & nodes

The workflow runs on a schedule (Cron), calls PrivatBank Public API, extracts USD/EUR values, formats a structured HTML report in a Code node, and sends it via Gmail automatically.

  • Trigger: Cron daily at 09:00
  • API: HTTP GET to PrivatBank public endpoint
  • Processing: JS formatting + HTML template
  • Delivery: Gmail node with dynamic subject + HTML body
Cron → HTTP Request → Code → Gmail
Fig 1. Scheduled automation architecture in n8n
API Endpoint
GET https://api.privatbank.ua/p24api/pubinfo?json&exchange&coursid=5
Data extraction and HTML report generation logic
Fig 2. Data extraction and HTML report generation logic
JavaScript / Code Node (example)
// Example: Extract USD/EUR and create HTML email
const rates = $json; // HTTP response JSON array
const usd = rates.find(x => x.ccy === 'USD');
const eur = rates.find(x => x.ccy === 'EUR');

const today = new Date();
const dateStr = today.toISOString().slice(0,10);

const html = `
  

Daily Currency Report — ${dateStr}

Currency Buy Sell
USD${usd?.buy}${usd?.sale}
EUR${eur?.buy}${eur?.sale}
`; return { json: { date: dateStr, usd, eur, html } };
Automated HTML currency report email
Fig 3. Automated HTML currency report email

Results & Impact

Measured outcomes
Quantitative
  • 100% automated daily execution
  • Execution time < 2 seconds
  • Zero manual effort required
Qualitative
  • Reliable scheduled delivery
  • Clean financial formatting
  • API-based real-time data
  • Production-ready automation
Business Effect
  • Eliminates repetitive financial monitoring
  • Improves financial awareness consistency
  • Demonstrates scalable scheduled automation
  • Extendable: Telegram, Sheets logging, dashboards

Export Workflow

Download the n8n workflow JSON export and import it directly into your n8n instance.