Google日历下周安排
高级
这是一个Other, AI领域的自动化工作流,包含 21 个节点。主要使用 Set, Code, Markdown, Aggregate, EmailSend 等节点,结合人工智能技术实现智能自动化。 通过邮件自动发送每周Google日历摘要(AI驱动)✨🗓️📧
前置要求
- •Google Gemini API Key
使用的节点 (21)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "81UkThrSnnFw6IJo",
"meta": {
"instanceId": "3612a0c89f35a354ddd1216385240db51b4635fde7cae2a0d5004be915b832f3",
"templateCredsSetupCompleted": true
},
"name": "Google Calendar 下周安排",
"tags": [],
"nodes": [
{
"id": "b4c54286-a4c5-4a1b-87ca-a37fa1fcb2aa",
"name": "每周计划",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-180,
-40
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtHour": 12
}
]
}
},
"typeVersion": 1.2
},
{
"id": "57a88176-a291-4d65-bfd2-868d4e50befb",
"name": "获取下周活动",
"type": "n8n-nodes-base.googleCalendar",
"position": [
1300,
-40
],
"parameters": {
"options": {},
"timeMax": "={{ $json['users-current-day-1-minute-before-midnight-plus-7-days-iso'] }}",
"timeMin": "={{ $json['users-current-day-1-minute-before-midnight-iso'] }}",
"calendar": {
"__rl": true,
"mode": "list",
"value": "c_4d9c2d4e139327143ee4a5bc4db531ffe074e98d21d1c28662b4a4d4da898866@group.calendar.google.com",
"cachedResultName": "n8n-personal-assistant-demo"
},
"operation": "getAll",
"returnAll": true
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "a1DI60kDgcdbIlXb",
"name": "Google Calendar account"
}
},
"typeVersion": 1.3
},
{
"id": "ed2eacbb-453f-4e5b-be3a-0c45e3506e1b",
"name": "Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
2840,
580
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-flash-preview-05-20"
},
"credentials": {
"googlePalmApi": {
"id": "lBQrszvhtstelPlO",
"name": "Google Gemini(PaLM) Api account 4"
}
},
"typeVersion": 1
},
{
"id": "20670d58-0c0a-4f17-9a89-131bb2cd2caa",
"name": "活动摘要代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2740,
-40
],
"parameters": {
"text": "={{ $json.eventdata }}",
"options": {
"systemMessage": "=You have been given a JSON array of Google Calendar events for the upcoming week (Monday to Sunday). Today is Sunday, {{ $('locale').item.json['users-current-date'] ? $('locale').item.json['users-current-date'] : $now.setZone($('locale').item.json['users-timezone'] ?? 'Australia/Sydney').setLocale($('locale').item.json['users-locale'] ?? 'en-AU').toLocaleString({ weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' }) }}.\nEach event object in the array has 'summary', 'start.dateTime', 'end.dateTime', and 'description'. Your designated timezone is '{{ $('locale').item.json['users-timezone'] }}' and locale '{{ $('locale').item.json['users-locale'] }}'.\n\nThe users name is: {{ $('locale').item.json['users-name'] }}\nThe user is located in: {{ $('locale').item.json['users-home-city'] }}\n\nYour task is to create a well-formatted weekly schedule summary for an email.\n\n1. **Greeting**: Start with a friendly greeting, for example: \"Here's your schedule for the upcoming week:\"\n\n2. **Daily Schedule**:\n * Group events by day (e.g., Monday, June 9, 2025; Tuesday, June 10, 2025). Determine the correct dates for the upcoming week (Monday to Sunday) based on today's date.\n * For each day of the upcoming week, list its events chronologically.\n * Format each event as: `HH:MM AM/PM - HH:MM AM/PM: Event Summary`. For example: `09:30 AM - 10:30 AM: Team Meeting`.\n * Parse the `start.dateTime` and `end.dateTime` (which are ISO strings with timezone offsets like `+10:00`) and display them correctly for the '{{ $('locale').item.json['users-timezone'] }}' timezone.\n * If a day has no events, state \"No events scheduled for this day.\"\n\n3. **Priority Events**:\n * Review the 'summary' and 'description' fields for keywords such as \"important\", \"urgent\", \"deadline\", \"meeting\", \"critical\", \"prepare\", or similar terms that indicate significance.\n * Mark these priority events by prefixing the event line with \"IMPORTANT: \". For example: `IMPORTANT: 02:00 PM - 03:00 PM: Project Deadline Review`.\n * If the 'description' provides actionable context for a priority event (e.g., \"Preparation needed: review X document\"), you can briefly mention this context after the event summary.\n\n4. **Weekly Insight**:\n * Conclude with 1-2 sentences offering a helpful insight, observation, or piece of advice related to the week's schedule. Examples:\n * \"Thursday looks like your busiest day, so you might want to plan accordingly.\"\n * \"Remember to allocate some time to prepare for the client presentation on Wednesday.\"\n * \"This week seems to have a good balance of meetings and free time.\"\n\n5. **Input Data Structure Reminder**: The calendar events are provided as a JSON array. You need to process this entire array.\n\nPlease generate only the text content suitable for the body of an email. Do not include any preamble (like \"Okay, here is the summary...\") or sign-off beyond the requested content."
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "99885550-0c81-4513-86f0-8e82b0d5e0fb",
"name": "发送邮件",
"type": "n8n-nodes-base.emailSend",
"position": [
3800,
-40
],
"webhookId": "7748b0f5-1a6a-42bf-b1c0-63051d6a62a2",
"parameters": {
"html": "={{ $json['email-html'] }}",
"options": {
"appendAttribution": false
},
"subject": "=Next Week Calendar Summary : {{ $now.plus({ days: 1 }).day }}-{{ $now.plus({ days: 7 }).toLocaleString(DateTime.DATE_MED) }}"
},
"credentials": {
"smtp": {
"id": "AoLopFA5yBSkhbrF",
"name": "SMTP account"
}
},
"typeVersion": 2.1
},
{
"id": "9199043b-2255-4a29-9c76-e6edbda41cc5",
"name": "区域设置",
"type": "n8n-nodes-base.set",
"position": [
300,
-40
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "2fa6da62-0c1b-4abe-b1d1-45dab7c22ab0",
"name": "users-locale",
"type": "string",
"value": "en-AU"
},
{
"id": "e997127b-a7b1-4684-82b3-3e5d66be07fa",
"name": "users-timezone",
"type": "string",
"value": "Australia/Sydney"
},
{
"id": "082e8d8f-5b20-4fc0-a59e-6deb48cb1406",
"name": "users-name",
"type": "string",
"value": "Bob"
},
{
"id": "4a867353-6d0c-4bad-90f9-e739ff1da010",
"name": "users-home-city",
"type": "string",
"value": "Sydney"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "b92e0c62-d83f-417d-9ed1-839b3f680edd",
"name": "简化事件JSON",
"type": "n8n-nodes-base.code",
"position": [
1800,
-40
],
"parameters": {
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n delete item.json.htmlLink\n delete item.json.etag\n delete item.json.iCalUID\n delete item.json.start.timeZone\n delete item.json.end.timeZone\n delete item.json.kind\n delete item.json.reminders\n delete item.json.organizer\n delete item.json.creator\n delete item.json.created\n delete item.json.updated\n delete item.json.status\n delete item.json.eventType\n delete item.json.id\n}\n\nreturn $input.all();"
},
"typeVersion": 2
},
{
"id": "c3639753-7b59-40ea-b59b-32dc00769146",
"name": "聚合活动",
"type": "n8n-nodes-base.aggregate",
"position": [
2320,
-40
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "eventdata"
},
"typeVersion": 1
},
{
"id": "bb2804c2-130e-4d53-9eac-cb4f978056d1",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-360,
-1100
],
"parameters": {
"color": 3,
"width": 960,
"height": 520,
"content": "### 工作流概览:Google Calendar 下周安排 🗓️➡️📧"
},
"typeVersion": 1
},
{
"id": "4e8a4adb-fde7-403d-968e-7d15c2fbe770",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
140,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "⚙️ **locale (设置)**"
},
"typeVersion": 1
},
{
"id": "a409ad6d-56be-4b3c-a1e3-b2b3e2c00b63",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-360,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "🗓️ **weekly_schedule (触发器)**"
},
"typeVersion": 1
},
{
"id": "714b924c-4cbc-4864-b833-e80b3dcecde8",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "⏰ **date_time (设置)**"
},
"typeVersion": 1
},
{
"id": "a31c71e7-98c8-4185-891e-9543ceac217d",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1140,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "📅 **get_next_weeks_events (Google Calendar)**"
},
"typeVersion": 1
},
{
"id": "5e5830c6-9e43-43c7-852e-b9982f6deb6b",
"name": "date_time",
"type": "n8n-nodes-base.set",
"position": [
820,
-40
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "954044f7-3c08-48c2-af9c-59a72690ad76",
"name": "users-current-date",
"type": "string",
"value": "={{\n $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toLocaleString(DateTime.DATE_FULL)\n}}"
},
{
"id": "2c3a0a1a-cc05-4b5d-b175-20732706aefb",
"name": "users-current-time",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toLocaleString(DateTime.TIME_SIMPLE) }}"
},
{
"id": "764b3b1a-6a6e-4b92-8f41-ae49405bc72a",
"name": "users-date-time",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone']) }}"
},
{
"id": "4c2851ef-175e-4f81-95af-5671171fdf16",
"name": "users-date-time-full",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toLocaleString(DateTime.DATETIME_FULL) }}"
},
{
"id": "4ae2c38b-f93a-4b56-9078-d9675a12ec8b",
"name": "users-date-time-huge",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toFormat('cccc, MMMM d, yyyy, h:mm a') }}"
},
{
"id": "1011c2bf-d311-424d-8537-1788597065d4",
"name": "users-current-date-plus-1",
"type": "string",
"value": "={{ $now.plus({ days: 1 }).setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toLocaleString(DateTime.DATE_FULL) }}"
},
{
"id": "343ec7d5-fcb5-454d-b947-4b0f2e94f930",
"name": "users-current-date-plus-7",
"type": "string",
"value": "={{ $now.plus({ days: 7 }).setZone($('locale').item.json['users-timezone'] ?? 'UTC').setLocale($('locale').item.json['users-locale'] ?? 'en-US').toLocaleString(DateTime.DATE_FULL) }}"
},
{
"id": "ce0de19d-9cb1-4918-ade5-47f22f35f8e8",
"name": "users-current-day-1-minute-before-midnight",
"type": "string",
"value": "={{\n $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC')\n .endOf('day')\n .setLocale($('locale').item.json['users-locale'] ?? 'en-US')\n .toLocaleString(DateTime.DATETIME_FULL)\n}}"
},
{
"id": "800dff91-469d-4a2b-acb0-a0b79d0b9341",
"name": "users-current-day-1-minute-before-midnight-plus-7-days",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC') .plus({ days: 7 }) .endOf('day') .setLocale($('locale').item.json['users-locale'] ?? 'en-US') .toLocaleString(DateTime.DATETIME_FULL) }}"
},
{
"id": "d04c43fe-1f6d-4e7e-b82f-70cebb7484a6",
"name": "users-current-day-1-minute-before-midnight-iso",
"type": "string",
"value": "={{\n $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC')\n .endOf('day')\n .toISO()\n}}"
},
{
"id": "5aee9416-0ad6-43b9-936f-edce6a292cce",
"name": "users-current-day-1-minute-before-midnight-plus-7-days-iso",
"type": "string",
"value": "={{ $now.setZone($('locale').item.json['users-timezone'] ?? 'UTC') .plus({ days: 7 }) .endOf('day') .toISO() }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f20a83fd-2484-4dc7-92a1-a438c2cf8e02",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1640,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "✨ **simplify_evens_json (代码)**"
},
"typeVersion": 1
},
{
"id": "c5e40e35-8dfa-491c-ba67-21b83f71334b",
"name": "便签7",
"type": "n8n-nodes-base.stickyNote",
"position": [
2140,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "➕ **aggregate_events (聚合)**"
},
"typeVersion": 1
},
{
"id": "db11c407-a238-48ef-9398-1842c1046340",
"name": "便签8",
"type": "n8n-nodes-base.stickyNote",
"position": [
2640,
220
],
"parameters": {
"color": 6,
"width": 440,
"height": 400,
"content": "🧠 **Google Gemini (语言模型)**"
},
"typeVersion": 1
},
{
"id": "692413bc-58f9-4d09-a7f7-796d50894e3b",
"name": "便签9",
"type": "n8n-nodes-base.stickyNote",
"position": [
3140,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "📄➡️🌐 **markdown_to_html (转换器)**"
},
"typeVersion": 1
},
{
"id": "d2803020-1f12-4207-a9c3-678fbb472daf",
"name": "便签10",
"type": "n8n-nodes-base.stickyNote",
"position": [
3640,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "📧 **send_email (邮件)**"
},
"typeVersion": 1
},
{
"id": "73c88ce5-9fa6-418f-b4cc-0b646f5708e7",
"name": "便利贴11",
"type": "n8n-nodes-base.stickyNote",
"position": [
2640,
-400
],
"parameters": {
"color": 4,
"width": 440,
"height": 400,
"content": "🤖 **event_summary_agent (AI 代理)**"
},
"typeVersion": 1
},
{
"id": "6febb866-888c-4e72-a6b8-296a826b7e66",
"name": "markdown_to_html",
"type": "n8n-nodes-base.markdown",
"position": [
3320,
-40
],
"parameters": {
"mode": "markdownToHtml",
"options": {
"emoji": true,
"simpleLineBreaks": true
},
"markdown": "={{ $json.output }}",
"destinationKey": "email-html"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "db6385a3-bd01-4cc0-be20-cb1388b31cdc",
"connections": {
"locale": {
"main": [
[
{
"node": "date_time",
"type": "main",
"index": 0
}
]
]
},
"date_time": {
"main": [
[
{
"node": "get_next_weeks_events",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini": {
"ai_languageModel": [
[
{
"node": "event_summary_agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"weekly_schedule": {
"main": [
[
{
"node": "locale",
"type": "main",
"index": 0
}
]
]
},
"aggregate_events": {
"main": [
[
{
"node": "event_summary_agent",
"type": "main",
"index": 0
}
]
]
},
"markdown_to_html": {
"main": [
[
{
"node": "send_email",
"type": "main",
"index": 0
}
]
]
},
"event_summary_agent": {
"main": [
[
{
"node": "markdown_to_html",
"type": "main",
"index": 0
}
]
]
},
"simplify_evens_json": {
"main": [
[
{
"node": "aggregate_events",
"type": "main",
"index": 0
}
]
]
},
"get_next_weeks_events": {
"main": [
[
{
"node": "simplify_evens_json",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 其他, 人工智能
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
自动化LinkedIn职位猎手_就绪版
自动化LinkedIn职位猎手:通过邮件获取最佳每日职位匹配
Set
Gmail
Aggregate
+9
26 节点Tianyi
其他
我的工作流 3
基于Llama Parser、Gemini LLM和Pinecone DB的文档分析与聊天机器人创建
If
Code
Gmail
+17
36 节点pavith
其他
为您的电子邮件生成可视化摘要和知识图谱洞察
为您的电子邮件生成可视化摘要和知识图谱洞察
If
Set
Code
+13
38 节点InfraNodus
其他
使用AI汇总MS Teams频道活动生成周报
使用AI汇总MS Teams频道活动生成周报
Set
Code
Markdown
+7
17 节点Jimleuk
其他
使用AI汇总Slack频道活动生成周报
使用AI汇总Slack频道活动生成周报
If
Set
Code
+13
47 节点Jimleuk
其他
工作流信息
难度等级
高级
节点数量21
分类2
节点类型10
作者
Jez
@jezI'm passionate about combining traditional web development with AI and automation to create impactful online solutions. As Founder & CEO of Jezweb, an award-winning Newcastle, Australia agency, I lead a 30+ person team delivering high-quality web design, development, and hosting services to over 3000 clients.
外部链接
在 n8n.io 查看 →
分享此工作流