8
n8n 中文网amn8n.com

每周Notion任务截止日期提醒

高级

这是一个Other领域的自动化工作流,包含 27 个节点。主要使用 If, Set, Html, Sort, Merge 等节点。 每周Notion任务截止日期提醒

前置要求
  • Notion API Key

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "46264913bc099c31e7222b2cfd112772e1c7867192afd7716e58254079b3333f"
  },
  "nodes": [
    {
      "id": "dac02623-ee83-444b-b039-fd310dee3260",
      "name": "当点击“测试工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        700,
        1000
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7268d9c0-44ae-4226-9e5f-f3b19e3fbfa1",
      "name": "Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1360,
        980
      ],
      "parameters": {
        "options": {},
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "b1e11f75-06df-42b4-8dd9-557ba937978d",
          "cachedResultUrl": "https://www.notion.so/b1e11f7506df42b48dd9557ba937978d",
          "cachedResultName": "Tasks"
        },
        "filterType": "manual"
      },
      "credentials": {
        "notionApi": {
          "id": "03mmrqQX1rffebZp",
          "name": "Notion David"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "607752ef-ac76-4a07-a3e7-39be7d5770e7",
      "name": "按最接近的截止日期排序",
      "type": "n8n-nodes-base.sort",
      "position": [
        1760,
        880
      ],
      "parameters": {
        "options": {},
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "property_deadline.start"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "81c6ded2-7766-4351-b597-27794b595283",
      "name": "筛选截止日期",
      "type": "n8n-nodes-base.filter",
      "position": [
        1600,
        880
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "179eecfc-7eea-46b9-a971-78824e5774dc",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.property_deadline.start }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "21ecbd8d-7a2f-4a0a-8d99-3365c88a187b",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        4100,
        900
      ],
      "parameters": {
        "html": "={{ $json.html }}",
        "options": {},
        "subject": "Weekly Update about Notion Tasks",
        "toEmail": "={{ $('Set Workflow vars').item.json.your_email }}",
        "fromEmail": "n8n@unitize.de"
      },
      "credentials": {
        "smtp": {
          "id": "cvpDbugXPc0TsdmZ",
          "name": "Unitize - SMTP Mailserver"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "8379f4e4-cab6-46cd-9ba0-e6bf78076de5",
      "name": "HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        3720,
        900
      ],
      "parameters": {
        "html": "<!DOCTYPE html>\n\n<html>\n<head>\n  <meta charset=\"UTF-8\" />\n  <title>Weekly Update about Notion Tasks</title>\n  <meta name=\"color-scheme\" content=\"only\">\n  <style>\n    body {font-family: 'Courier'; color: #15124a; background-color: #ffffff;padding:20px;}\n    .button {background-color: #126bf3; padding: 10px 15px; border-radius: 5px; text-decoration: none; color: white}\n    a {text-decoration: none; color: #126bf3}\n    h3 {margin-top: 0px}\n    .task {background-color: #f0f0f0; padding: 20px; border-radius: 5px;}\n    p:last-child {margin-bottom: 0px;}\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <img width=\"40\" src=\"{{ $('Set Workflow vars').item.json.logo_path }}\" />\n    <h1>Weekly Update about Notion Tasks</h1>\n    <p><a class=\"button\" href=\"{{ $('Set Workflow vars').item.json.notion_database_url }}\">To the Task Board in Notion</a></p>\n    <br>\n    {{ $json.html_groups.pluck('html') }}\n  </div>\n</body>\n</html>"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c86a8391-90ed-450a-b142-85ff62d84ab8",
      "name": "汇总待办任务",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2700,
        1040
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "due_to"
      },
      "typeVersion": 1
    },
    {
      "id": "07506629-4244-4270-aecc-87b0237c65e7",
      "name": "汇总逾期任务",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2700,
        760
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "overdue"
      },
      "typeVersion": 1
    },
    {
      "id": "93d4f3be-8081-41d9-bd59-5a7a0439c27b",
      "name": "Pushover",
      "type": "n8n-nodes-base.pushover",
      "position": [
        4100,
        1100
      ],
      "parameters": {
        "message": "You received a weekly update about your Notion Tasks. Check your mails!",
        "userKey": "={{ $('Set Workflow vars').item.json.pushover_user_key }}",
        "priority": 1,
        "additionalFields": {}
      },
      "credentials": {
        "pushoverApi": {
          "id": "Z002A4WQRAOy6XUT",
          "name": "Pushover - David"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "112aa538-1497-4a53-85ff-b04504896b81",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        700,
        780
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                1
              ],
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1ec9608a-9a06-4140-a6e0-2e38b4a8c201",
      "name": "如果截止日期已逾期",
      "type": "n8n-nodes-base.if",
      "position": [
        2460,
        900
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e65c0597-d067-423a-8496-35e91a8ddf1b",
              "operator": {
                "type": "dateTime",
                "operation": "beforeOrEquals"
              },
              "leftValue": "={{ $json.property_deadline.start.toDateTime() }}",
              "rightValue": "={{ $now }}"
            }
          ]
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2a25952d-7149-4b42-b520-497997d2838c",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        2220,
        900
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "a80b5658-b83d-45e7-ade3-6a828f26a356",
      "name": "任务 HTML 模板",
      "type": "n8n-nodes-base.html",
      "position": [
        2000,
        1060
      ],
      "parameters": {
        "html": "<div class=\"task\">\n  <a href=\"{{ $json.url }}\">\n    <h3>{{ $json.name }}\"</h3>\n  </a>\n  <p>\n    <strong>Deadline: </strong>{{ $json.property_deadline.start.toDateTime().format('dd.MM.yyyy') }}\n    <br>\n    <strong>Prio: </strong>{{ $json.property_prio }}\n    <br>\n    <strong>Status: </strong>{{ $json.property_status }}\n    <br>\n    <strong>Tags: </strong>{{ $json.property_tags }}\n  </p>\n</div>"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8589e878-249d-43a0-b523-994108b3471b",
      "name": "待办列表 HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        2920,
        1040
      ],
      "parameters": {
        "html": "<h2>Tasks with an <u>upcoming</u> deadline</h2>\n{{ $json.due_to.pluck('html') }}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "c3eccab0-56f8-4038-8526-f2f51a19fb59",
      "name": "逾期列表 HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        2920,
        760
      ],
      "parameters": {
        "html": "<h2>Tasks which are already <u>overdue</u></h2>\n{{ $if($json.overdue.length > 0, $json.overdue.pluck('html'), 'No overdue tasks. Great!') }}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "054aa055-6f71-4ecb-80fe-69e5b95f6390",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3440,
        900
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "html_groups"
      },
      "typeVersion": 1
    },
    {
      "id": "10a799fb-66f3-4fe3-b7b8-01d3a93047d2",
      "name": "合并分组",
      "type": "n8n-nodes-base.merge",
      "position": [
        3220,
        900
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "acde5a16-bdd1-4fb6-a986-14ae0b1b1240",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        640
      ],
      "parameters": {
        "color": 4,
        "width": 265.6985239367243,
        "height": 702.0052321200026,
        "content": "## 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "7766fa25-2486-4eb5-a3d6-23ec2472be94",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        640
      ],
      "parameters": {
        "width": 648.1928627806343,
        "height": 710.0046767294216,
        "content": "## 获取、筛选和排序 Notion 任务"
      },
      "typeVersion": 1
    },
    {
      "id": "5a44f536-5af9-40dd-a9ae-9d56e4540971",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        640
      ],
      "parameters": {
        "width": 442.45022302855995,
        "height": 707.700156943336,
        "content": "## 为每个任务生成 HTML 模板"
      },
      "typeVersion": 1
    },
    {
      "id": "765f25ad-3dfa-4a48-9c07-07c7fc0049b6",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        640
      ],
      "parameters": {
        "width": 1185.3702378922917,
        "height": 707.7001569433354,
        "content": "## 创建“逾期”和“待办”任务分组"
      },
      "typeVersion": 1
    },
    {
      "id": "5fb2c5d9-fba9-463c-9574-38146d14e272",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3620,
        640
      ],
      "parameters": {
        "width": 314.11124235866913,
        "height": 705.8925656662948,
        "content": "## 创建 HTML 电子邮件模板"
      },
      "typeVersion": 1
    },
    {
      "id": "891e126b-1a34-489b-8a3d-fa3a56308153",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3980,
        640
      ],
      "parameters": {
        "color": 4,
        "width": 355.68584173060526,
        "height": 704.0849743892543,
        "content": "## 发送电子邮件和推送通知"
      },
      "typeVersion": 1
    },
    {
      "id": "6cd611da-f3da-4da1-90ae-e5e04a91f915",
      "name": "便签 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        400
      ],
      "parameters": {
        "color": 6,
        "width": 539.3442720010472,
        "height": 199.46339277184228,
        "content": "## 依赖项"
      },
      "typeVersion": 1
    },
    {
      "id": "8da5e4b3-ee1a-4c62-aeec-40d85fb9754e",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        640
      ],
      "parameters": {
        "width": 284.11715106246396,
        "height": 706.9018085580076,
        "content": "## 设置工作流变量"
      },
      "typeVersion": 1
    },
    {
      "id": "4759edd5-edae-4d4c-8cc7-55c8cd8336ca",
      "name": "设置工作流变量",
      "type": "n8n-nodes-base.set",
      "position": [
        1000,
        880
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "976aac71-63c6-48a4-a965-8112ae3480bf",
              "name": "logo_path",
              "type": "string",
              "value": ""
            },
            {
              "id": "d9ec1fff-56ff-4c3e-befd-99520b78200e",
              "name": "pushover_user_key",
              "type": "string",
              "value": ""
            },
            {
              "id": "8271abe0-b9c7-4102-b1a2-37181dcb4ea6",
              "name": "notion_database_url",
              "type": "string",
              "value": ""
            },
            {
              "id": "ed7c4c03-f8e2-46fa-ac3b-ccabbeab24fa",
              "name": "your_email",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "25f16b5e-7500-4b51-ac8e-e7d8b3b205be",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1260,
        740
      ],
      "parameters": {
        "color": 3,
        "width": 296.4350404695249,
        "height": 463.2108881217612,
        "content": "## 需要调整"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "HTML": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Pushover",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If deadline is overdue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion": {
      "main": [
        [
          {
            "node": "Filter for deadline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge groups": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML for Task": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "HTML due to List": {
      "main": [
        [
          {
            "node": "Merge groups",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Workflow vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML overdue List": {
      "main": [
        [
          {
            "node": "Merge groups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Workflow vars": {
      "main": [
        [
          {
            "node": "Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter for deadline": {
      "main": [
        [
          {
            "node": "Sort by closest deadline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate due to tasks": {
      "main": [
        [
          {
            "node": "HTML due to List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If deadline is overdue": {
      "main": [
        [
          {
            "node": "Aggregate overdue tasks",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aggregate due to tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate overdue tasks": {
      "main": [
        [
          {
            "node": "HTML overdue List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort by closest deadline": {
      "main": [
        [
          {
            "node": "HTML for Task",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set Workflow vars",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 其他

需要付费吗?

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

工作流信息
难度等级
高级
节点数量27
分类1
节点类型13
难度说明

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

作者

You need help implementing a custom n8n workflow? Feel free to contact me via LinkedIn or my business website: unitize.de You want to start using n8n? Use this affiliate link: https://n8n.partnerlinks.io/edr9c63lw12z

外部链接
在 n8n.io 查看

分享此工作流