8
n8n 中文网amn8n.com

每日从Meteosource发送天气预报到邮箱(使用Gmail)

初级

这是一个自动化工作流,包含 5 个节点。主要使用 Set, Gmail, HttpRequest, ScheduleTrigger 等节点。 每日从Meteosource发送天气预报到邮箱(使用Gmail)

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "c8c9ba5d3eb26ae47a06d24ff164a01c0d73ed4753a74903c2bb609d434a0f6b",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "bf1d8bf4-e17e-4e1e-9552-2b39a8ab5350",
      "name": "工作流描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -506,
        -250
      ],
      "parameters": {
        "color": 5,
        "width": 272,
        "height": 912,
        "content": "## 工作流概览"
      },
      "typeVersion": 1
    },
    {
      "id": "b08b2404-aa56-4298-a405-680774f839d8",
      "name": "配置 - place_id和收件人",
      "type": "n8n-nodes-base.set",
      "position": [
        -32,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d8171a8a-a78e-486e-aed5-02bf72137c3e",
              "name": "place_id",
              "type": "string",
              "value": "london"
            },
            {
              "id": "ffdd0b58-8f4c-43b7-9f9e-efbbfbd537c3",
              "name": "send_to_email",
              "type": "string",
              "value": "example@example.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c7ae6874-f8e9-4e59-a5ce-7c9fa13f9e74",
      "name": "计划 - 每日07:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -256,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "937b34e5-bc4b-4a10-9dd6-33da196da565",
      "name": "邮件 - 发送天气摘要",
      "type": "n8n-nodes-base.gmail",
      "position": [
        416,
        0
      ],
      "webhookId": "f8f87fd7-7f32-43a2-b7f2-3c55864d0bae",
      "parameters": {
        "sendTo": "={{ $('Config - place_id and recipient').item.json.send_to_email }}",
        "message": "=Tomorrow:  {{ $json.daily.data[1].summary }}\n\nPowered by Meteosource",
        "options": {
          "appendAttribution": false
        },
        "subject": "=Weather today:  {{ $json.daily.data[0].summary }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "E3alb5H7xlfxfBur",
          "name": "Jim Halpert"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9514f606-f579-49d1-9d38-a1a5c111c4a8",
      "name": "天气API - Meteosource",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        192,
        0
      ],
      "parameters": {
        "url": "https://www.meteosource.com/api/v1/free/point?&sections=all&timezone=UTC&language=en&units=metric",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "place_id",
              "value": "={{ $json.place_id }}"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "S4axvOS2mm5SkOaW",
          "name": "Meteosource credentials"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "Weather API - Meteosource": {
      "main": [
        [
          {
            "node": "Email - send weather summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule - every day 07:00": {
      "main": [
        [
          {
            "node": "Config - place_id and recipient",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config - place_id and recipient": {
      "main": [
        [
          {
            "node": "Weather API - Meteosource",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

初级

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
初级
节点数量5
分类-
节点类型5
难度说明

适合 n8n 新手,包含 1-5 个节点的简单工作流

作者
Milan Vasarhelyi - SmoothWork

Milan Vasarhelyi - SmoothWork

@vasarmilan

We help you eliminate the busywork by building compact business tools tailored to your processes. 📞: https://smoothwork.ai/book-a-call ▶️: https://www.youtube.com/@vasarmilan

外部链接
在 n8n.io 查看

分享此工作流