使用OpenWeatherMap和Gmail发送每日天气报告到邮箱
中级
这是一个Personal Productivity领域的自动化工作流,包含 6 个节点。主要使用 Code, Cron, Gmail, HttpRequest 等节点。 使用OpenWeatherMap和Gmail发送每日天气报告到邮箱
前置要求
- •Google 账号和 Gmail API 凭证
- •可能需要目标 API 的认证凭证
使用的节点 (6)
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "ee5c851f-b27a-4e3b-8072-983ba221f2b1",
"name": "每日计划(上午 8 点)",
"type": "n8n-nodes-base.cron",
"position": [
32,
368
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5a4f19c1-37cb-4802-ab9c-437791774ffd",
"name": "获取天气数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
288,
368
],
"parameters": {
"url": "https://api.openweathermap.org/data/2.5/weather?q={{ encodeURIComponent('London') }}&units=metric&appid=YOUR_OPENWEATHERMAP_API_KEY",
"options": {}
},
"typeVersion": 3
},
{
"id": "8d9c1007-5c33-4217-bf9d-bb62a17a6959",
"name": "格式化天气报告",
"type": "n8n-nodes-base.code",
"position": [
544,
368
],
"parameters": {
"jsCode": "const weatherData = $input.first().json;\n\nconst city = weatherData.name;\nconst description = weatherData.weather[0].description;\nconst temp = weatherData.main.temp;\nconst feelsLike = weatherData.main.feels_like;\nconst humidity = weatherData.main.humidity;\nconst windSpeed = weatherData.wind.speed;\n\nconst report = `\nGood morning!\n\nHere's your daily weather report for ${city}:\n\nConditions: ${description.charAt(0).toUpperCase() + description.slice(1)}\nTemperature: ${temp}°C (Feels like: ${feelsLike}°C)\nHumidity: ${humidity}%\nWind Speed: ${windSpeed} m/s\n\nHave a great day!\n`;\n\nreturn [{ json: { report: report, city: city } }];"
},
"typeVersion": 2
},
{
"id": "76c9bf47-e0af-4d92-ad91-3fa8bb368dc3",
"name": "发送邮件报告",
"type": "n8n-nodes-base.gmail",
"position": [
784,
368
],
"webhookId": "205790d9-c8d1-4f7c-b576-f9d47cdbdd47",
"parameters": {
"sendTo": "your_email@example.com",
"message": "={{ $json.report }}",
"options": {},
"subject": "Daily Weather Report for {{ $json.city }}",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "LVRUgE95PAvkE1Mc",
"name": "Gmail account 2"
}
},
"typeVersion": 2.1
},
{
"id": "f610daff-486e-4ef6-a20d-6f86451873ee",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
32
],
"parameters": {
"width": 416,
"height": 240,
"content": "## 每日天气报告发送至邮件"
},
"typeVersion": 1
},
{
"id": "83443a67-aa2c-44e1-b8cf-89ddb35f2c67",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
32
],
"parameters": {
"width": 528,
"height": 464,
"content": "## 设置步骤"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Fetch Weather Data": {
"main": [
[
{
"node": "Format Weather Report",
"type": "main",
"index": 0
}
]
]
},
"Daily Schedule (8 AM)": {
"main": [
[
{
"node": "Fetch Weather Data",
"type": "main",
"index": 0
}
]
]
},
"Format Weather Report": {
"main": [
[
{
"node": "Send Email Report",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 个人效率
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
每日禅语励志名言推送至Slack频道
每日从ZenQuotes获取励志名言并推送到Slack频道
Code
Cron
Slack
+2
5 节点David Olusola
个人效率
基于SMS的天气警报(OpenWeather + Twilio)
基于SMS的天气警报(OpenWeather + Twilio)
If
Code
Cron
+3
9 节点David Olusola
个人效率
工作日日志记录
AI工时表生成器 - 集成Gmail、日历和GitHub到Google表格
If
Set
Code
+11
31 节点Luka Zivkovic
个人效率
医疗账单自动化模板
使用Google Sheets和Gmail自动化医疗账单处理
If
Set
Code
+5
11 节点David Olusola
财务
YouTube新视频→自动发布链接到Slack
将YouTube视频通知自动化发送到Slack
Code
Cron
Slack
+2
6 节点David Olusola
社交媒体
AI每周汇总Google Docs更新 → 发送邮件
使用GPT-4从Google Docs生成每周文档摘要并通过邮件发送
Code
Cron
Gmail
+4
10 节点David Olusola
AI 摘要总结
工作流信息
难度等级
中级
节点数量6
分类1
节点类型5
作者
David Olusola
@dae221I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - david@daexai.com
外部链接
在 n8n.io 查看 →
分享此工作流