# Workflow Automations

> Two bots built to learn workflow automation, running on my own n8n Cloud account

A bilingual Telegram grocery-list bot backed by Postgres, and a flight price monitor that watches a Google Sheet wishlist and alerts when fares move. Both were built to learn the tooling and run for my own use - no other users.

- Year: 2025
- Tags: n8n, Telegram, Supabase, Amadeus API
- Page: https://www.rondahan.com/projects/automations
- Grocery Bot repo: https://github.com/rondahan04/Grocery-Bot
- Flight Monitor repo: https://github.com/rondahan04/n8n_Flight_Agent

## What it is

Two workflow bots built on n8n Cloud as a way to learn the tooling. They run on my own account, for my own use, with no users besides me. One is a Telegram bot for a shared grocery list that takes commands in English and Hebrew and keeps state in Postgres. The other watches a Google Sheet of flight routes and alerts when Amadeus fares move.

## How it works

1. **Grocery Bot - Parse the command** - A Telegram trigger feeds a switch on add and remove, in English and Hebrew. Text is normalised for case and stray whitespace so the same item does not end up stored twice.
2. **Grocery Bot - Persist to Postgres** - Supabase holds the list with an identity primary key, UTC timestamps and a status column, so removed items are marked rather than deleted and the history stays intact.
3. **Flight Monitor - Read the wishlist** - Routes and target dates come from a Google Sheet, which makes the whole thing editable by someone who will never open n8n.
4. **Flight Monitor - Fan out around each date** - Each row expands into up to seven Amadeus searches covering plus or minus three days, since flying a day either side is often much cheaper. Past dates are dropped and the original date is flagged.
5. **Flight Monitor - Diff against the last run** - A parallel branch pulls the previous results, renames fields to avoid collisions, merges the two sets, then routes through conditionals to either fire an alert or quietly upsert the row.

## Flow

The flight monitor, which is the one with real shape. The branch that reads the previous run is what turns a scheduled search into an alert, instead of the same fare every morning.

- Schedule trigger
- read wishlist → Google Sheet (routes and dates)
- one row becomes seven → Amadeus search (plus or minus three days)
- compare → This run + Previous run (read from the sheet)
- route on the difference → Alert (price moved) + Upsert quietly (nothing changed)

## Technical notes

1. **The diff is the whole point** - Without comparing against the previous run, a price monitor is just a thing that emails you the same fare every morning.
2. **A spreadsheet as the interface** - Using Sheets for input means the config is editable by anyone, with no deploy and no UI to build.
3. **Soft deletes** - The status column keeps removed items queryable, which costs nothing and makes the data worth keeping.

## Stack

- **Platform:** n8n Cloud, JavaScript code nodes
- **Grocery Bot:** Telegram Bot API, Supabase, PostgreSQL
- **Flight Monitor:** Amadeus API, Google Sheets

## Repo layout

- `workflow.json` - The exported graph: Telegram trigger to Postgres
- `schema.sql` - Groceries table: item, status, timestamps
- `TakeResult.js` - Expands one sheet row into seven date searches
- `Parser.js` - Unwraps the Amadeus response, adds airline names

## Honestly

These are learning projects, not products. They were built to understand workflow tooling, they run on my own n8n account for my own use, and they have never had a user other than me - so nothing here should be read as production traffic. They are also low-code: most of the logic lives in the n8n graph rather than in code I wrote, and the hand-written JavaScript is under a hundred lines across both. I include them for the shape of the problem, particularly the diff against the previous run that turns a scheduled search into an alert, not as a demonstration of engineering depth.

---

Machine-readable: [llms.txt](https://www.rondahan.com/llms.txt) · [sitemap.xml](https://www.rondahan.com/sitemap.xml) · Markdown variants at [/md](https://www.rondahan.com/md) or via `Accept: text/markdown`.
