8
n8n 中文网amn8n.com

每周日志摘要

高级

这是一个Personal Productivity, AI Summarization领域的自动化工作流,包含 16 个节点。主要使用 Code, Notion, Discord, Aggregate, ManualTrigger 等节点。 每周Notion日志与任务摘要,使用GPT-4.1发送至Discord

前置要求
  • Notion API Key
  • Discord Bot Token 或 Webhook
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "MeGFzR7Shfx70wMV",
  "meta": {
    "instanceId": "2a92e1aed4e75113f119ba031c55ebfbb7ec184402fa742db5b7b5ac94a2d195",
    "templateCredsSetupCompleted": true
  },
  "name": "每周日志摘要",
  "tags": [
    {
      "id": "KOVOG8f4IK9bMwas",
      "name": "🤖 AI Powered",
      "createdAt": "2025-07-26T12:59:39.942Z",
      "updatedAt": "2025-07-26T13:02:41.754Z"
    }
  ],
  "nodes": [
    {
      "id": "c2b1647f-4bcb-42cb-b0e4-b5d885adafbb",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -512,
        -208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1fb28c6c-1828-4c31-ac0b-386afcf3a5da",
      "name": "获取多个子块",
      "type": "n8n-nodes-base.notion",
      "position": [
        0,
        -160
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "resource": "block",
        "operation": "getAll"
      },
      "credentials": {
        "notionApi": {
          "id": "nC8XWBtNRIPtVuXV",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8fa2862f-6be3-4c34-bc4c-bb3ac7d36cb5",
      "name": "由 Github 模型提供支持",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -512,
        80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 7,
              "triggerAtHour": 16
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fea6281a-8dbd-45e0-9b7b-903c94383c88",
      "name": "获取每日日志",
      "type": "n8n-nodes-base.notion",
      "position": [
        -224,
        -160
      ],
      "parameters": {
        "limit": 5,
        "filters": {
          "conditions": [
            {
              "key": "Type|select",
              "condition": "equals",
              "selectValue": "Journal"
            },
            {
              "key": "Last edited time|last_edited_time",
              "condition": "past_week"
            }
          ]
        },
        "options": {},
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "22c1b7ff-072a-80c4-8175-cab05d54bb2b"
        },
        "filterType": "manual"
      },
      "credentials": {
        "notionApi": {
          "id": "nC8XWBtNRIPtVuXV",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4ea7bb6f-83d9-46ff-a618-2b74b79ea5e1",
      "name": "待办事项总计",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        32
      ],
      "parameters": {
        "jsCode": "let totalTasks = $input.all().length;\nlet emoji = \"\";\nif (totalTasks > 40) {\n  emoji = \"✨🤩✨\";\n} else if (totalTasks > 30) {\n  emoji = \"🥳\"\n} else if (totalTasks > 20) {\n  emoji = \"🤠\";\n} else if (totalTasks < 10) {\n  emoji = \"🤨\";\n}\n\nreturn [\n  {\n    json: {\n      message: \"\\n\\n**Tasks Summary:**\\nYou completed a total of **\" + totalTasks + \"** tasks this week! \" + emoji\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "4d19c32a-cf6c-4723-abc9-378d64913dc4",
      "name": "待办事项摘要",
      "type": "n8n-nodes-base.discord",
      "position": [
        208,
        32
      ],
      "webhookId": "b871b2be-5307-4973-abb0-56b1bcaad9bf",
      "parameters": {
        "content": "={{ $json.message }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "xWovgtJFdEGU9fv3",
          "name": "Discord Webhook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "dc0d9a36-9e76-4b20-a16a-f50b22d338e8",
      "name": "LLM 综合摘要",
      "type": "n8n-nodes-base.code",
      "position": [
        432,
        -160
      ],
      "parameters": {
        "jsCode": "let combinedSummary = \"\";\nfor (const item of $input.all()) {\n  if (item.json.content.length > 0) {\n    combinedSummary += \" \" + item.json.content;  \n  }  \n}\n\nreturn [\n  {\n    json: {\n      message: combinedSummary\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "49819461-b703-4000-8aff-da38042d8844",
      "name": "保存回 Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1056,
        -64
      ],
      "parameters": {
        "title": "={{ $now.format('MMM d, yy') }} Weekly Summary [automated]",
        "blockUi": {
          "blockValues": [
            {
              "text": {
                "text": [
                  {
                    "text": "={{ $json.choices[0].message.content }}",
                    "annotationUi": {}
                  }
                ]
              },
              "richText": true
            }
          ]
        },
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "22c1b7ff-072a-80c4-8175-cab05d54bb2b"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Type|select",
              "selectValue": "Weekly"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "id": "nC8XWBtNRIPtVuXV",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f48bcf16-337c-4fdd-9aa8-57c7d01889b6",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1104,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 608,
        "content": "## Notion 每周日志 AI 摘要"
      },
      "typeVersion": 1
    },
    {
      "id": "c8f7b1d5-7938-4ca6-9aef-bd798d00c888",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        208,
        -160
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "content"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "47c1b7de-9438-44b6-a339-d57b34bca3aa",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -304
      ],
      "parameters": {
        "width": 304,
        "height": 256,
        "content": "预配置的提示相当通用,但您可以随意编辑以添加幽默感或任何其他希望 ChatGPT 在生成摘要时使用的特定指令。"
      },
      "typeVersion": 1
    },
    {
      "id": "f258bd25-a104-4be5-8810-b02d97a04293",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -384
      ],
      "parameters": {
        "width": 224,
        "height": 576,
        "content": "请确保在此处配置您的 Notion 连接以及检索每日日志时要使用的页面数据库和类型(筛选器)。"
      },
      "typeVersion": 1
    },
    {
      "id": "943f4c06-c8be-426d-bb19-c37db7bb8f9b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        16
      ],
      "parameters": {
        "width": 160,
        "height": 272,
        "content": "自定义发送到 Discord 的每周任务总摘要消息。"
      },
      "typeVersion": 1
    },
    {
      "id": "23550382-cf64-4ff3-aee8-d1ade7e94fbb",
      "name": "生成摘要",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        656,
        -160
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Given this blob of text which is the aggregation of the past week of Journal entries I've made, can you give me a concise summary for the week?\n\n {{ $json.message }}"
            }
          ]
        },
        "simplify": false
      },
      "credentials": {
        "openAiApi": {
          "id": "NPgH1qw6QE8eTcZq",
          "name": "OpenAi account 3"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e769232f-bd6f-4437-93a4-8f7acddc704e",
      "name": "发送摘要",
      "type": "n8n-nodes-base.discord",
      "position": [
        1056,
        -256
      ],
      "webhookId": "2a550af3-61f6-4ddc-954f-0a3af0284347",
      "parameters": {
        "content": "={{ $json.choices[0].message.content }}",
        "options": {},
        "authentication": "webhook"
      },
      "credentials": {
        "discordWebhookApi": {
          "id": "xWovgtJFdEGU9fv3",
          "name": "Discord Webhook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6bf259b0-0771-42c3-a438-1fe4df1267fb",
      "name": "获取任务",
      "type": "n8n-nodes-base.notion",
      "position": [
        -224,
        32
      ],
      "parameters": {
        "limit": 100,
        "filters": {
          "conditions": [
            {
              "key": "Completed Date|date",
              "condition": "past_week"
            }
          ]
        },
        "options": {},
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "22c1b7ff-072a-807a-b0c7-cb5733cb7997"
        },
        "filterType": "manual"
      },
      "credentials": {
        "notionApi": {
          "id": "nC8XWBtNRIPtVuXV",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "America/New_York",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "d4a87d14-7876-4022-8374-09f3a08364da",
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Combined Summary for LLM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Tasks": {
      "main": [
        [
          {
            "node": "To Dos Totals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "To Dos Totals": {
      "main": [
        [
          {
            "node": "To Do Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Summary": {
      "main": [
        [
          {
            "node": "Send Summary",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Back to Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Daily Journals",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Daily Journals": {
      "main": [
        [
          {
            "node": "Get many child blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many child blocks": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combined Summary for LLM": {
      "main": [
        [
          {
            "node": "Generate Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Daily Journals",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 个人效率, AI 摘要总结

需要付费吗?

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

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

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

作者
Jason Krol

Jason Krol

@shorttompkins

Senior Engineering Manager with over 20 years of professional experience. While I'm not getting paid to code during the day, I still find time at night to mess around and have fun. Lately I've been really enjoying my time spent learning new automation and AI tools!

外部链接
在 n8n.io 查看

分享此工作流