Switch Automate

Switch Automate streamlines user interactions on Telegram by providing instant weather updates for major European capitals. Users can easily request weather information with a simple command, receiving visually appealing data in image format. This automated workflow enhances communication efficiency and delivers timely insights, making it a valuable tool for users seeking quick access to weather data.

7/8/2025
21 nodes
Complex
manualcomplextelegramtelegramtriggerspreadsheetfilewritebinaryfilereadbinaryfileexecutecommandadvancedlogicroutingcommunicationbotcodecustomapiintegrationfilesstorageconditional
Categories:
Communication & MessagingComplex WorkflowManual Triggered
Integrations:
TelegramTelegramTriggerSpreadsheetFileWriteBinaryFileReadBinaryFileExecuteCommand

Target Audience

This workflow is ideal for:
- Developers looking to integrate weather data into their Telegram bots.
- Data Analysts who want to automate weather data collection and visualization.
- Business Owners seeking to provide weather updates to customers in a user-friendly manner via Telegram.
- Students learning about automation and data processing using n8n and R.

Problem Solved

This workflow addresses the challenge of providing real-time weather updates through a Telegram bot. It allows users to request weather data for various European capitals by simply sending commands. This automation saves time and effort in manually checking weather conditions and enhances user engagement by providing visual data in the form of graphs.

Workflow Steps

  • Trigger: The workflow starts when a user sends a message to the Telegram bot.
    2. Command Handling: The workflow checks the message for specific commands using a switch node. Commands include /start for greeting and /getweather for retrieving weather data.
    3. Greeting Message: If the /start command is detected, the bot sends a friendly greeting message to the user.
    4. Weather Request: Upon receiving the /getweather command, the bot informs the user to wait while processing their request.
    5. City List: The workflow retrieves a list of cities for which weather data can be fetched.
    6. API Request: For each city, an HTTP request is made to the OpenWeatherMap API to get the current weather data.
    7. Error Handling: If there is an error during the API request, the bot sends a message to the user indicating the issue.
    8. Data Processing: The successful API response is processed to extract relevant weather information and stored in a CSV file.
    9. R Script Execution: An R script is executed to generate a visual representation of the weather data (a graph).
    10. Image Handling: The generated image is read and sent back to the user in Telegram.
    11. Final Messages: Depending on the success of the R script, the bot either sends the weather image or an error message if the image generation fails.
  • Customization Guide

    Users can customize this workflow by:
    - Modifying Commands: Change the bot commands (e.g., adding new commands) in the switch node to enhance functionality.
    - Updating City List: Add or remove cities in the City List function to tailor the weather data according to user needs.
    - API Key: Replace the OpenWeatherMap API key in the HTTP request node with your own for personalized data access.
    - R Script: Customize the R script to change the type of graph generated or the data visualized.
    - Message Customization: Edit the text messages sent by the bot to reflect your brand's tone or to provide additional information.