See llms.txt for all machine-readable content.

Back to Templates

Answer Telegram data questions with GPT-4o-mini, Open-Meteo, Frankfurter, CoinGecko, and StudioAPI

Last update

Last update 10 hours ago

Categories

Share


Quick overview

This workflow turns a Telegram bot into an AI data assistant. Users ask questions in plain language and the agent answers with live data: weather (Open-Meteo), foreign exchange rates (Frankfurter), crypto prices (CoinGecko), gold price, Indonesian earthquakes, Bank Indonesia rates, Indonesian holidays, and Jakarta power supply (StudioAPI). Every query is logged to Google Sheets, and a weekly market briefing is sent to the owner every Monday.

How it works

  1. Triggers when a new message arrives at your Telegram bot.
  2. Normalizes the incoming message (text, chat ID, user name, and timestamp).
  3. A GPT-4o-mini agent keeps a short conversation memory and picks the right data tool for the question.
  4. Weather tool: current conditions from Open-Meteo (temperature, humidity, wind, and weather code) by latitude and longitude.
  5. FX Rates tool: reference exchange rates from Frankfurter. Gold Price tool: the current international gold price in USD per troy ounce.
  6. Crypto Prices tool: USD prices and 24-hour change for ten major coins from CoinGecko.
  7. Indonesian data from StudioAPI: latest earthquakes (BMKG), Bank Indonesia reference rates, national holidays, and Jakarta power supply status.
  8. /help and /start return a short menu of supported topics without calling a tool.
  9. The question and answer are logged to Google Sheets and the answer is sent back to the user in Telegram as a short, mobile-friendly reply.
  10. Every Monday at 07:00 a scheduled branch fetches crypto prices and writes a short market briefing (crypto highlights, gold price, and FX note) for the owner.
  11. If a node fails, the Error Trigger path replies in Telegram that the data service is temporarily unavailable, so failed lookups are not silently dropped.

Setup

  1. Create a Telegram bot with BotFather and add your Telegram credentials in n8n for the trigger and reply nodes.
  2. Connect your OpenAI credentials on the model nodes (gpt-4o-mini by default).
  3. Create a StudioAPI key and add an HTTP Header Auth credential (x-api-key). The earthquakes, BI rates, holidays, and power tools require it.
  4. Connect your Google Sheets credentials and set the spreadsheet and sheet used to log queries.
  5. Send a message to your bot to test, then adjust the system prompt if you want to change what the assistant can answer.