每日天气机器人
中级
这是一个Personal Productivity领域的自动化工作流,包含 9 个节点。主要使用 Set, Telegram, FormTrigger, HttpRequest, ScheduleTrigger 等节点。 通过OpenWeatherMap向Telegram发送每日和按需天气报告
前置要求
- •Telegram Bot Token
- •可能需要目标 API 的认证凭证
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "EtMbMlSmiCmshLlm",
"meta": {
"instanceId": "00137a678c70b895ffbf480dac6a13dc8f053e854d987464a615f9ea30d97eee",
"templateCredsSetupCompleted": true
},
"name": "每日天气机器人",
"tags": [],
"nodes": [
{
"id": "d5d3309c-a736-4244-8973-ee8bb4df9e5e",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-20,
-100
],
"parameters": {
"width": 460,
"height": 140,
"content": "## 定时触发器(每日上午 08:00)"
},
"typeVersion": 1
},
{
"id": "75c18662-b969-4f48-8a05-1429c2f81567",
"name": "获取天气数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
20,
340
],
"parameters": {
"url": "=https://api.openweathermap.org/data/2.5/weather?q={{ $json['City Name'] }},{{ $json['Country Name'] }}&APPID=key&units=metric",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "3b84cd51-bf28-4a3d-af86-f2acbe1bf097",
"name": "格式化天气消息",
"type": "n8n-nodes-base.set",
"position": [
240,
340
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "bb388fef-4f43-468e-bdb2-1a65c40f5194",
"name": "message",
"type": "string",
"value": "={{ \n (() => {\n const desc = $json.weather[0].description;\n const temp = $json.main.temp;\n const hum = $json.main.humidity;\n const pres = $json.main.pressure;\n const wind = $json.wind.speed;\n const city = $json.name;\n const country = $json.sys.country;\n\n // Convert UNIX timestamps to IST (Asia/Kolkata)\n const sunrise = new Date($json.sys.sunrise * 1000).toLocaleTimeString('en-IN', { timeZone: 'Asia/Kolkata' });\n const sunset = new Date($json.sys.sunset * 1000).toLocaleTimeString('en-IN', { timeZone: 'Asia/Kolkata' });\n\n // Format current date in IST\n const now = new Date();\n const dateStr = now.toLocaleDateString('en-IN', {\n weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',\n timeZone: 'Asia/Kolkata'\n });\n\n return `📅 ${dateStr}\n🌤 Weather in ${city}, ${country}:\nCondition: ${desc}\nTemperature: ${temp}°C\n💧 Humidity: ${hum}%\n🌬 Wind Speed: ${wind} m/s\n🔼 Pressure: ${pres} hPa\n🌅 Sunrise: ${sunrise}\n🌇 Sunset: ${sunset}`;\n })()\n}}\n"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c601e86a-28d1-4cc1-b643-ca95e14573b2",
"name": "发送 Telegram 消息",
"type": "n8n-nodes-base.telegram",
"position": [
460,
340
],
"webhookId": "7285e616-e38d-4b2a-bb06-3cbbe1a65fb6",
"parameters": {
"text": "={{ $json.message }}",
"chatId": "telegramChatId",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "NuFto4S6tg5Lkuvu",
"name": "abhi today"
}
},
"typeVersion": 1.2
},
{
"id": "ebf95ad7-5156-4032-87a4-11e85eb0c582",
"name": "表单提交时",
"type": "n8n-nodes-base.formTrigger",
"position": [
-220,
220
],
"webhookId": "9f30d988-032d-41cc-993c-600414c5f5b3",
"parameters": {
"options": {},
"formTitle": "Daily Weather Bot",
"formFields": {
"values": [
{
"fieldLabel": "City Name"
},
{
"fieldLabel": "Country Name"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "2d425b50-6bfc-433d-8baf-172384bd3181",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
720
],
"parameters": {
"height": 120,
"content": "## Telegram 输出"
},
"typeVersion": 1
},
{
"id": "3108b92c-6f97-4fee-b4bb-7140b2419f5d",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
20,
720
],
"parameters": {
"width": 150,
"height": 260,
"content": "## API 调用"
},
"typeVersion": 1
},
{
"id": "a7031c56-09ac-4d05-95fa-9ff7d82a6314",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-380,
720
],
"parameters": {
"width": 200,
"height": 260,
"content": "## 每日计划"
},
"typeVersion": 1
},
{
"id": "a757108c-961a-4cd2-8fa4-e583c26120ea",
"name": "定时触发器",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-220,
460
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "bb82186d-3706-43b7-b69c-1a526777461d",
"connections": {
"Get Weather Data": {
"main": [
[
{
"node": "Format Weather Message",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get Weather Data",
"type": "main",
"index": 0
}
]
]
},
"On form submission": {
"main": [
[
{
"node": "Get Weather Data",
"type": "main",
"index": 0
}
]
]
},
"Format Weather Message": {
"main": [
[
{
"node": "Send Telegram Message",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 个人效率
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
我的工作流11
使用Telegram机器人、Google Sheets和GPT-4o mini管理任务并发送定时提醒
If
Webhook
Telegram
+8
21 节点Abhishek Patoliya
个人效率
LinkedIn职位搜索
LinkedIn职位搜索:自动匹配简历(GPT/Gemini)+求职信生成器+Telegram提醒
If
Set
Code
+13
33 节点Hojjat Jashnniloofar
个人效率
个性化天气助手(集成 Google Calendar、WeatherAPI、AI 和 Telegram)
集成 Google Calendar、WeatherAPI、Gemini 和 Telegram 的个性化天气助手
If
Set
Telegram
+6
15 节点Budi SJ
个人效率
使用OpenWeather、表格和Telegram的植物护理提醒
使用OpenWeather、表格和Telegram的植物护理提醒
If
Set
Code
+8
27 节点Adrian
个人效率
基于Google Gemini的智能LinkedIn职位筛选,含简历匹配和Google地图
基于Google Gemini的智能LinkedIn职位筛选,含简历匹配和Google地图
If
Set
Supabase
+10
26 节点Atta
个人效率
为您的电子邮件生成可视化摘要和知识图谱洞察
为您的电子邮件生成可视化摘要和知识图谱洞察
If
Set
Code
+13
38 节点InfraNodus
其他
工作流信息
难度等级
中级
节点数量9
分类1
节点类型6
作者
Abhishek Patoliya
@abhishekpatoliyaExperienced n8n developer specializing in business process automation and system integrations. I've helped dozens of companies automate their workflows, from CRM synchronization to marketing automation pipelines. Whether you need a simple trigger-based workflow or a complex multi-branch automation, I can bring your ideas to life.
外部链接
在 n8n.io 查看 →
分享此工作流