Home / n8n Workflow Templates / Telegram Weather Notification Workflow Using OpenWeatherMap

Telegram Weather Notification Workflow Using OpenWeatherMap

Telegram Weather Workflow

This workflow sends current weather information from OpenWeatherMap to a Telegram chat when triggered by a message. It retrieves weather data for Berlin and responds with conditions, temperature, and feels-like temperature.

Webhook3 nodesProductivityTelegramWeatherAPI

About this workflow

Telegram Weather Workflow Analysis

This N8n workflow template, titled "Telegram Weather Workflow", is a practical automation designed to deliver real-time weather updates via Telegram in response to user messages. It leverages the integration capabilities of n8n to connect Telegram messaging with live weather data from OpenWeatherMap, enabling users to receive instant, personalized weather reports without leaving their chat interface.

What the Workflow Does

The workflow listens for incoming messages on a Telegram bot and, upon receiving one, automatically retrieves current weather information for a predefined city (in this case, Berlin, Germany) from the OpenWeatherMap API. It then formats this data into a natural-language message and sends it back to the user who triggered the conversation—making it an interactive, responsive weather assistant.

Key Features and Capabilities

  • Event-driven Trigger: Activated by any incoming Telegram message, ensuring responsiveness.
  • Real-time Weather Data: Pulls up-to-the-minute weather conditions and temperature readings.
  • Dynamic Message Personalization: Uses data expressions to customize responses with actual weather values.
  • Seamless Chat Integration: Automatically replies to the original sender using their chat ID.
  • Low Maintenance & Fully Automated: Once deployed, it runs continuously without manual input.

Main Nodes and Their Purposes

  1. Telegram Trigger

    • Type: n8n-nodes-base.telegramTrigger
    • Purpose: Acts as the entry point of the workflow. It listens for incoming Telegram updates and triggers the workflow when a new message is received.
    • Configuration: Set to capture "message" updates only, meaning any text sent to the bot will activate the flow.
    • Credentials: Connected to a pre-configured Telegram bot API credential named "Telegram".
  2. OpenWeatherMap

    • Type: n8n-nodes-base.openWeatherMap
    • Purpose: Fetches current weather data for a specified location.
    • Configuration: Hardcoded to retrieve weather for "berlin,de" (Berlin, Germany), including details like temperature, feels-like temperature, and weather description.
    • Credentials: Uses an authenticated OpenWeatherMap API key stored under "OpenWeatherMap".
  3. Telegram (Send)

    • Type: n8n-nodes-base.telegram
    • Purpose: Sends a formatted message back to the user who initiated the conversation.
    • Configuration:
      • The text parameter uses n8n’s expression syntax to dynamically insert weather data into a friendly message.
      • The chatId is dynamically set to match the ID of the person who sent the original message, ensuring correct reply routing.
      • Includes emojis for enhanced readability and user engagement.

Use Cases and Benefits

  • Personal Assistant Bots: Ideal for creating simple chatbots that provide useful daily information like weather forecasts.
  • Customer Support Tools: Can be extended to support travel or event planning services where weather context matters.
  • Educational Projects: Great for teaching API integrations, event-based workflows, and dynamic data handling.
  • Home Automation Integration: Could be part of a larger smart home system where users query environmental conditions via chat.

Benefits include:

  • Fast response time using real APIs.
  • High reusability—can be adapted for other cities or additional weather metrics.
  • User-friendly output improves interaction quality.
  • Minimal setup required thanks to clear node separation and intuitive logic.

Step-by-Step Workflow Logic

  1. Trigger Phase:

    • A user sends any message (e.g., “Hi” or “Get weather”) to the connected Telegram bot.
    • The Telegram Trigger node detects this message and activates the workflow, passing along the full message object, including the sender's chat ID.
  2. Data Retrieval Phase:

    • The workflow proceeds to the OpenWeatherMap node.
    • This node makes an HTTPS request to the OpenWeatherMap API, requesting current weather data for Berlin, Germany.
    • Upon receiving the response, it outputs structured JSON containing fields such as temperature (main.temp), feels-like temperature (main.feels_like), and weather condition (weather[0].description).
  3. Response Generation & Delivery Phase:

    • The Telegram (Send) node executes next, using the data from both previous nodes:
      • It constructs a human-readable message using expressions:
        • Inserts the weather description (e.g., "light rain").
        • Adds the actual temperature and perceived ("feels like") temperature in Celsius.
        • Includes a friendly emoji to enhance tone.
      • Dynamically sets the recipient using ={{$node["Telegram Trigger"].json["message"]["chat"]["id"]}}, ensuring the reply goes back to the correct user.
    • The message is sent through the same Telegram bot, completing the interaction loop.

In summary, this workflow exemplifies how n8n enables powerful, conversational automations by linking external APIs with messaging platforms—turning a simple trigger into an intelligent, data-driven response system.

How to use: download the JSON, then in n8n choose “Import from File”.