n8n

How to Automate Telegram Weather Updates?

Give your Telegram audience fresh weather visuals on demand. A user sends a simple command and receives one image with current conditions across selected European cities. Great for marketing and community teams that share timely content and want a quick, clean graphic.

The bot listens for messages, routes commands, and replies with either a greeting, a help note, or the weather image. When weather is requested, it sends a please wait message, builds a city list, pulls live data from OpenWeather for each city, reshapes the data, and writes a CSV. An R script then turns that CSV into a PNG chart. Error checks isolate API failures and rendering issues, so users see clear messages when something goes wrong. Files are named with user id and timestamp to avoid overwrites and to keep results traceable. The final image is read from disk and posted back to the chat with a short caption.

You need a Telegram bot token, an OpenWeather API key, and an R runtime with required packages. Point file paths to a writeable folder. Teams can cut report prep from 30 minutes to under a minute and keep channels active with consistent visuals. Use it for daily posts, group chats, or internal briefings.

What are the key features?

  • Telegram Trigger listens for chat messages and starts the flow on user commands.
  • Switch node routes between start, weather request, and unrecognized commands.
  • Please wait message informs users while the image is being prepared.
  • Function node builds a fixed list of city ids and names for consistent coverage.
  • HTTP Request pulls live conditions from OpenWeather for each city id.
  • Function converts API responses into tidy rows for export.
  • Spreadsheet File creates a CSV and Write Binary saves it with a clear file name.
  • Execute Command runs an R script that renders a single PNG chart from the CSV.
  • If nodes detect API errors or a non zero exit code and send friendly error messages.
  • Read Binary loads the PNG and Telegram sendPhoto returns the image with a caption.

What are the benefits?

  • Reduce manual weather reporting from 30 minutes to under 1 minute
  • Automate 100 percent of city data collection and formatting
  • Improve accuracy by removing copy and paste errors
  • Serve many chat requests at once without extra effort
  • Connect Telegram and OpenWeather in one simple flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram and OpenWeather. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot: In Telegram, message BotFather, create a new bot, and copy the bot token.
  4. In the n8n credentials manager, create Telegram credentials: double click any Telegram node, choose the credential dropdown, click Create new credential, then paste the bot token and save.
  5. Open the Telegram Trigger node and select your Telegram credentials. Keep updates set to message. Activate the workflow, then send /start to your bot to confirm the trigger works.
  6. Get your OpenWeather API key from your OpenWeather account settings. Open the Get weather data HTTP Request node and replace the appid value with your API key.
  7. Prepare the R environment on the n8n host. Install R and required packages. Make sure the R command and your script are available in the system PATH.
  8. Open the Run R script node and confirm the command points to your R script file. Update any script arguments and working directory to match your server paths.
  9. Check the Filename, Spreadsheet File, Write csv, and Read Binary File nodes. Set folder paths to a writeable directory, for example the n8n data folder. Ensure the same folder is used by the R script for reading and writing.
  10. Send /getweather to the bot. You should see a please wait message, then the final PNG image. If you get an API error message, verify the OpenWeather key. If you get a render error, check the R exit code and script path.
  11. Adjust the City List function to add or remove cities. Keep using city ids for reliable lookups.
  12. Optional hardening: add rate limits for API calls, and rotate file names with the existing timestamp logic to avoid overwrites.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

OpenWeather

Sign up

Free for everyone: $0, 60 API calls/min, 1,000,000 calls / mo (Current weather, 3-hour/5-day forecast, Air Pollution, Geocoding)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Credits:
ed-parsadanyan

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.