Envío de informe meteorológico diario usando OpenWeatherMap y un bot de Telegram

Intermedio

Este es unPersonal Productivity, Miscellaneous, Multimodal AIflujo de automatización del dominio deautomatización que contiene 10 nodos.Utiliza principalmente nodos como Cron, Function, Telegram, OpenWeatherMap. Informe meteorológico diario: OpenWeatherMap y bot de Telegram

Requisitos previos
  • Bot Token de Telegram
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "zVk8lAovJaOKMXFR",
  "meta": {
    "instanceId": "ade915387b18f7a3b9a14fd8fb677fdbace0ade794de7914e8790d907cd285d0"
  },
  "name": "Daily Weather Reports with OpenWeatherMap and Telegram Bot",
  "tags": [],
  "nodes": [
    {
      "id": "b707258f-7424-4199-887b-20cd21728102",
      "name": "Descripción general del flujo de trabajo",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -832,
        -352
      ],
      "parameters": {
        "width": 300,
        "height": 392,
        "content": "## 🤖 Automated Weather Bot\n\n**This workflow:**\n1. Triggers on schedule (daily)\n2. Fetches weather from OpenWeatherMap\n3. Formats data with emojis\n4. Sends to Telegram chat\n\n**Setup needed:**\n- OpenWeatherMap API key\n- Telegram bot token\n- Your chat ID"
      },
      "typeVersion": 1
    },
    {
      "id": "f55bdbef-30ef-4759-815c-8168bbb0d6b8",
      "name": "Disparador programado",
      "type": "n8n-nodes-base.cron",
      "position": [
        -624,
        64
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1de1ccc6-b87a-4af6-bc11-0903dc740edd",
      "name": "Configuración de programación",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        224
      ],
      "parameters": {
        "width": 280,
        "height": 296,
        "content": "⏰ **SCHEDULE TRIGGER**\n\nSet when to send weather reports:\n- Default: 8:00 AM daily\n- Change cron: 0 8 * * *\n- Every 6h: 0 */6 * * *\n- Twice daily: 0 8,18 * * *"
      },
      "typeVersion": 1
    },
    {
      "id": "954baa8c-530b-4bcc-bff9-00e841bdf7dd",
      "name": "Obtener clima",
      "type": "n8n-nodes-base.openWeatherMap",
      "position": [
        -400,
        64
      ],
      "parameters": {
        "cityName": "Kielce,PL",
        "language": "en"
      },
      "typeVersion": 1
    },
    {
      "id": "8aed3c70-bc04-4a27-8d1b-46ae41a38bbf",
      "name": "Clima API",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        224
      ],
      "parameters": {
        "width": 248,
        "height": 296,
        "content": "🌤️ **WEATHER DATA**\n\n**Required:**\n- OpenWeatherMap credentials\n- Change city: \"YourCity,CountryCode\"\n- Language: en, es, fr, de, pl\n\n**Gets:** temp, humidity, wind, etc."
      },
      "typeVersion": 1
    },
    {
      "id": "124a7ab9-52a1-4e4c-8735-787bb27083b5",
      "name": "Formatear clima",
      "type": "n8n-nodes-base.function",
      "position": [
        -176,
        64
      ],
      "parameters": {
        "functionCode": "const weather = items[0].json;\n\nfunction formatTime(timestamp, timezoneOffset) {\n  const date = new Date((timestamp + timezoneOffset) * 1000);\n  return date.toISOString().substr(11, 5);\n}\n\nconst city = weather.name;\nconst temp = weather.main.temp.toFixed(1);\nconst tempMin = weather.main.temp_min.toFixed(1);\nconst tempMax = weather.main.temp_max.toFixed(1);\nconst feelsLike = weather.main.feels_like.toFixed(1);\nconst description = weather.weather[0].description;\nconst rain = weather.rain ? weather.rain[\"1h\"] : 0;\nconst windSpeed = weather.wind.speed.toFixed(1);\nconst windDeg = weather.wind.deg;\nconst clouds = weather.clouds.all;\nconst sunrise = formatTime(weather.sys.sunrise, weather.timezone);\nconst sunset = formatTime(weather.sys.sunset, weather.timezone);\n\nconst message = `Weather in ${city}:\n🌡 Temperature: ${temp}°C (feels like: ${feelsLike}°C)\n📉 Min: ${tempMin}°C, 📈 Max: ${tempMax}°C\n🌧 Precipitation: ${description}, ${rain} mm in the last hour\n💨 Wind: ${windSpeed} m/s, direction ${windDeg}°\n☁️ Cloudiness: ${clouds}%\n🌅 Sunrise: ${sunrise}\n🌇 Sunset: ${sunset}`;\n\nreturn [{ json: { message } }];"
      },
      "typeVersion": 1
    },
    {
      "id": "86c09047-c113-40ca-a606-0225b8ad19f2",
      "name": "Formateo de mensaje",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        232
      ],
      "parameters": {
        "width": 200,
        "height": 288,
        "content": "📝 **FORMAT MESSAGE**\n\n**Converts raw data to:**\n- Human-readable text\n- Emojis for visual appeal\n- Organized layout\n- Local time zones\n\n**Customize:** Edit the message template in function code"
      },
      "typeVersion": 1
    },
    {
      "id": "494899d5-16e9-44a4-acf9-190087e14bee",
      "name": "Enviar mensaje de texto",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        64
      ],
      "webhookId": "a1a10685-f8eb-4b97-897f-3c9031e8de55",
      "parameters": {
        "text": "={{ $json.message }}",
        "chatId": "XXXXXXX",
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "3c32825f-b4c7-4b52-938f-8a158be368aa",
      "name": "Entrega Telegram",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        224
      ],
      "parameters": {
        "width": 200,
        "height": 296,
        "content": "📱 **SEND TO TELEGRAM**\n\n**Required setup:**\n1. Create bot via @BotFather\n2. Get bot token\n3. Get your chat ID\n4. Replace XXXXXXX with your chat ID\n\n**Result:** Weather report in your chat!"
      },
      "typeVersion": 1
    },
    {
      "id": "98652765-0a26-42ea-8773-32431f9e7fbb",
      "name": "Guía de inicio rápido",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -336
      ],
      "parameters": {
        "width": 350,
        "height": 340,
        "content": "🚀 **QUICK START:**\n\n1. **Get OpenWeatherMap API key** (free at openweathermap.org)\n2. **Create Telegram bot** (message @BotFather)\n3. **Find your chat ID** (send message to bot, visit api URL)\n4. **Configure nodes** (add credentials, update chat ID)\n5. **Test workflow** (click test button)\n6. **Activate** (toggle switch ON)\n\n✅ Done! You'll get daily weather reports!"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "58aba6a0-c288-45c6-80c0-e1a9f66b21b7",
  "connections": {
    "954baa8c-530b-4bcc-bff9-00e841bdf7dd": {
      "main": [
        [
          {
            "node": "124a7ab9-52a1-4e4c-8735-787bb27083b5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "124a7ab9-52a1-4e4c-8735-787bb27083b5": {
      "main": [
        [
          {
            "node": "494899d5-16e9-44a4-acf9-190087e14bee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f55bdbef-30ef-4759-815c-8168bbb0d6b8": {
      "main": [
        [
          {
            "node": "954baa8c-530b-4bcc-bff9-00e841bdf7dd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Productividad personal, Varios, IA Multimodal

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Flujos de trabajo relacionados recomendados

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos10
Categoría3
Tipos de nodos5
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34