8
n8n 中文网amn8n.com

每日简报 - 任务与事件

高级

这是一个Personal Productivity, Multimodal AI领域的自动化工作流,包含 18 个节点。主要使用 Code, Gmail, Merge, Todoist, GoogleCalendar 等节点。 通过 Gmail 使用 Todoist、Google 日历和 GPT-4o 的自动化每日简报

前置要求
  • Google 账号和 Gmail API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "oRUhVLfKvrxvUSky",
  "meta": {
    "instanceId": "dfeafc9dc27dee2289436a8382e76ed3cdd65cbd44e54ea55fd1393614bf0382",
    "templateCredsSetupCompleted": true
  },
  "name": "每日简报- 任务与事件",
  "tags": [],
  "nodes": [
    {
      "id": "9f7abaa2-1d99-488d-a2f6-ce63af3dd509",
      "name": "向模型发送消息",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        400,
        -20
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Here's my plan for today:\n\n🗂️ **Tasks**\n{{ $json.formattedTasks }}\n\n📅 **Calendar**\n{{ $json.formattedEvents }}\n\n---\n\n✅ Structure the reply in this exact markdown format:\n\n**Daily Summary**  \n[one-sentence summary of the day]\n\n\\n\\n\n\n🎯 **Top Priorities**  \n1. ✅ [Task 1] – ⏰ [Time]  \n2. ✅ [Task 2] – ⏰ [Time]  \n...\n\n\\n\\n\n\n💡 **Focus Mantra**  \n\"[motivational quote]\"\n\n\\n\\n\n\nAdd **line breaks** between each section and each task, so it's email-friendly and easy to scan.\nAvoid long paragraphs. Keep it clean and structured."
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "QpyyqFY2rAs6Umuv",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "3bccfb3e-2e86-4c0b-8bce-891b6ad3b969",
      "name": "发送消息",
      "type": "n8n-nodes-base.gmail",
      "position": [
        980,
        -20
      ],
      "webhookId": "af5f600b-c704-4a52-98a1-a3323a39048a",
      "parameters": {
        "sendTo": "emailPlaceholder",
        "message": "={{ $json.htmlBody }}",
        "options": {},
        "subject": "Morning Briefings"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "d9YtSxVNiAg2C7FK",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "e21eed99-cc0b-4224-b7f0-e85f62dd6c78",
      "name": "获取多个任务",
      "type": "n8n-nodes-base.todoist",
      "position": [
        -320,
        80
      ],
      "parameters": {
        "filters": {
          "projectId": "2357038842"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "todoistApi": {
          "id": "bhVIRYwTcnPoVk7L",
          "name": "Todoist account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "009b1143-306d-4bad-bea7-47df8771b499",
      "name": "获取多个事件",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -320,
        -120
      ],
      "parameters": {
        "options": {},
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "emailPlaceholder",
          "cachedResultName": "emailPlaceholder"
        },
        "operation": "getAll"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "bEUn0PilK7gDh4tG",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3,
      "alwaysOutputData": true
    },
    {
      "id": "27d34f96-ca61-44bf-8989-bbca2bee0069",
      "name": "代码",
      "type": "n8n-nodes-base.code",
      "position": [
        200,
        -20
      ],
      "parameters": {
        "jsCode": "const calendarEvents = [];\nconst todoistTasks = [];\n\nfor (const item of items) {\n  if (item.json?.start?.dateTime) {\n    calendarEvents.push(item.json);\n  } else if (item.json?.content) {\n    todoistTasks.push(item.json);\n  }\n}\n\nconst formattedEvents = calendarEvents.map((event, i) => {\n  const time = new Date(event.start.dateTime).toLocaleTimeString('en-IN', { hour: '2-digit', minute: '2-digit' });\n  return `${i + 1}. ${event.summary} at ${time}`;\n}).join('\\n');\n\nconst formattedTasks = todoistTasks.map((task, i) => {\n  const time = task.due?.datetime\n    ? new Date(task.due.datetime).toLocaleTimeString('en-IN', { hour: '2-digit', minute: '2-digit' })\n    : 'No time set';\n  return `${i + 1}. ${task.content} (Due at ${time})`;\n}).join('\\n');\n\nreturn [\n  {\n    json: {\n      formattedEvents: formattedEvents || 'No calendar events today.',\n      formattedTasks: formattedTasks || 'No tasks today.'\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "987c7654-7edc-4aea-b2be-f0ce846cf6fd",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -20,
        -20
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "2b69ae00-18c0-4778-9702-23a18e300573",
      "name": "将OpenAI文本转换为HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        760,
        -20
      ],
      "parameters": {
        "jsCode": "const raw = $json.message?.content || 'No message';\n\n// Convert markdown-style bold to <strong>\nlet html = raw\n  .replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>')\n\n// Convert newlines and spacing\n  .replace(/\\n{2,}/g, '<br><br>')     // double newlines → double <br>\n  .replace(/\\n/g, '<br>')             // single newline fallback\n\n// Optional: emoji replacement (can leave as-is if you like)\n  .replace(/✅/g, '✅')\n  .replace(/🎯/g, '🎯')\n  .replace(/💡/g, '💡')\n  .replace(/📅/g, '📅')\n  .replace(/🗂️/g, '🗂️');\n\nreturn [\n  {\n    json: {\n      htmlBody: `<div style=\"font-family: Arial, sans-serif; font-size: 14px; line-height: 1.6;\">${html}</div>`\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "2651477d-bad3-4fc7-9666-4a11a87bc4f8",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -640,
        -20
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d032cb5e-11bb-445c-ab31-b357ba8c3044",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1100,
        -180
      ],
      "parameters": {
        "color": 5,
        "width": 380,
        "height": 440,
        "content": "## 📌 **每日简报自动化**"
      },
      "typeVersion": 1
    },
    {
      "id": "20aa46f5-e9e9-4259-8658-a369938e7d04",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        -180
      ],
      "parameters": {
        "color": 2,
        "width": 180,
        "height": 440,
        "content": "⏰ 每天6:00 AM触发工作流。"
      },
      "typeVersion": 1
    },
    {
      "id": "00f26917-3006-40a8-b798-63d4d741f360",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -260
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 180,
        "content": "📅 获取当天所有Google Calendar事件。"
      },
      "typeVersion": 1
    },
    {
      "id": "f1b0537b-06f8-4840-9a18-b748da7d2076",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        160
      ],
      "parameters": {
        "color": 6,
        "width": 180,
        "height": 220,
        "content": "📝 获取指定项目下的所有Todoist任务。"
      },
      "typeVersion": 1
    },
    {
      "id": "5e0e9272-1834-4108-ad04-be81be4d32c6",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        200
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 140,
        "content": "🔀 合并日历事件和任务。"
      },
      "typeVersion": 1
    },
    {
      "id": "e6c7821c-1c24-4dc3-aef9-387efc2f9ec5",
      "name": "便利贴5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        200
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 140,
        "content": "🧠 分离和格式化日历事件和任务。"
      },
      "typeVersion": 1
    },
    {
      "id": "c2de93aa-9e1c-4dd4-984f-72de1f4323bd",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        200
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 140,
        "content": "🤖 将任务和日历摘要发送到GPT-4o。"
      },
      "typeVersion": 1
    },
    {
      "id": "e0b8b41b-75bd-4455-b94e-919fb3be5d9a",
      "name": "便签 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        200
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 140,
        "content": "🧱 将Markdown风格的GPT输出转换为干净的HTML。"
      },
      "typeVersion": 1
    },
    {
      "id": "4b6ae3f4-8490-4097-87d7-5b1bfbcf90ad",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        200
      ],
      "parameters": {
        "color": 7,
        "width": 180,
        "height": 140,
        "content": "📧 将最终HTML邮件发送到您的收件箱。"
      },
      "typeVersion": 1
    },
    {
      "id": "8eb46a16-e528-488e-be02-fdd00d1220c0",
      "name": "便签 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 1280,
        "height": 440,
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8eb56c93-5df7-4748-b658-c69a8ba1123e",
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many tasks": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get many events": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Message a model": {
      "main": [
        [
          {
            "node": "Convert OpenAI Text to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get many events",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get many tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert OpenAI Text to HTML": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 个人效率, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量18
分类2
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
AK Pasnoor

AK Pasnoor

@ak-pasnoor

🚀 Automate. Scale. Win. Are you still manually following up with leads or relying on staff to answer every call? I help agencies and business owners deploy AI voice agents and chatbots that book appointments 24/7, qualify leads instantly, and eliminate 90% of repetitive tasks—without writing a single line of code.

外部链接
在 n8n.io 查看

分享此工作流