用 n8n + GPT-4.1-mini 自动分级并优化 Todoist 任务
定时拉取 Todoist 新建任务 → AI Agent 按影响×紧急×风险打分并改写描述 → 回写优先级与截止日期
- 给谁
- 使用 Todoist 管理任务、希望减少手动整理时间的个人或小团队
- 你会得到
- 近 5 分钟内新建的任务会被自动改写为祈使句描述、分配 P1–P4 优先级、设定不超负荷的截止日期
硬约束
前置条件:可访问的 n8n 实例(自托管或 Cloud);Todoist API token;OpenAI API key。费用:OpenAI 按 token 计费,Todoist API 在免费额度内可用。将模板导入 n8n 后配置两个凭证并调整触发频率即可运行。
他们做了什么
作者 rpb-dev 在 n8n 模板库发布了一个工作流模板,包含 7 个节点:Schedule Trigger、Get many tasks、AI Agent、OpenAI Chat Model、get_open_tasks(Todoist Tool)、update_task(Todoist Tool)和 Sticky Note。AI Agent 使用 define 模式,内置完整的 systemMessage 与用户输入模板,通过 Impact × Urgency × Risk 框架为任务打分并自动安排截止日期。
效果如何
模板在 n8n.io 上展示为已发布状态(status: published),有 777 次浏览(author_report)。未提供作者实测的 before/after 任务截图或定量效果数据。
值得知道
1. Sticky Note 中有一句 "test with the last email in your inbox",疑似从邮件模板复制粘贴残留,与 Todoist 场景无关,执行时以实际 Todoist 任务为准。2. 默认模型为 gpt-4.1-mini,节点参数中 __rl=true 表示可从 n8n 模型列表切换至 gpt-4.1 或 gpt-4。3. update_task 节点使用 $fromAI 自动提取 Agent 输出中的 Task_ID、Priority、Description、Due_Date_Time,无需手动映射字段,但需确保 Agent 输出格式与字段类型匹配。4. 反超负荷策略依赖 get_open_tasks 返回的现有任务数,若 Todoist 项目极多,建议检查 API 分页或过滤条件。5. 本站未实测该工作流,导入后请先以单条任务测试,确认优先级和日期符合预期再启用定时触发。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- OpenAI Chat Model 节点:绑定OpenAI API 凭证。
- Get many tasks 节点:绑定todoistApi 凭证。
- get_open_tasks 节点:绑定todoistApi 凭证。
- update_task 节点:绑定todoistApi 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #7938(约 7 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
导入模板并配置凭证
在 n8n 中打开模板 https://n8n.io/workflows/7938/ 并导入。进入工作流后,先配置两类凭证: 1) Todoist:在「Get many tasks」「get_open_tasks」「update_task」节点绑定 todoistApi 凭证(API token)。 2) OpenAI:在「OpenAI Chat Model」节点绑定 openAiApi 凭证。 然后打开「Schedule Trigger」节点,按需调整轮询间隔(默认按分钟)。
获取新建任务
「Get many tasks」节点已预设过滤器 created after: -5 minutes,每次触发时拉取近 5 分钟内在 Todoist 创建的任务。该节点输出会作为数组传给 AI Agent。
配置 AI Agent 的提示词与工具
「AI Agent」节点使用「define」模式,包含一段用户输入模板(User Prompt)和系统指令(System Message)。模型连接至「OpenAI Chat Model」节点(默认 gpt-4.1-mini)。工具连接为 get_open_tasks(读取全部待办)和 update_task(回写更新)。 请按以下原文配置节点参数,不要修改变量名:
运行提示词 · 来源原文。AI Agent 节点的 Text / User Prompt 字段
=New Task: - id: {{ $json.id }} - content: "{{ $json.content }}" - labels: {{ $json.labels || [] }} - due_hint: "{{ $json.due_hint || '' }}" - project_id: "{{ $json.project_id || '' }}" - timebox_min: {{ $json.timebox_min || 60 }} Actions: 1) Call the tool get_open_tasks to read the backlog. 2) Decide priority (1–4) using the defined framework. 3) Schedule the task realistically without overbooking. 4) Update the new task with improved content, priority, and due date.运行提示词 · 来源原文。AI Agent 节点的 Options > System Message 字段
Identity & Mission You are the Task Manager Agent. You receive a new task and have two possible actions: Read all open tasks in Todoist; Update the new task with an improved description, priority, and due date, based on the current backlog. Your goal is to reduce ambiguity, avoid unrealistic deadlines, and force focus on the highest-impact tasks. Golden Rules (strict, no excuses): Never leave the new task without a due date. Always set a due_date (or due_string). Respect recurring tasks (don’t use them to measure daily workload). Todoist priority scale: 4 = P1 (highest), 3 = P2, 2 = P3, 1 = P4 (lowest). (Yes, in Todoist 4 is the top priority.) Keep labels, links, project IDs, context if they already exist; only improve the text. Provide a short final summary with the reasoning for the chosen priority and due date. Description improvement: Rewrite in clear imperative style (“Implement…”, “Review…”). Add, if relevant, a line “Completion Criteria:” with 2–4 objective bullets. Preserve references (#labels, @people, links, ticket IDs). Transform implicit subtasks into bullets in the description (don’t create separate subtasks). Priority calculation (aggressive framework): Score based on Impact × Urgency × Risk: Impact (0–3): revenue/client-facing, unlocks others, external commitment, leadership requirement. Urgency (0–3): external deadlines, blocking dependencies, overdue items. Risk (0–2): security/compliance, penalties for delay, context-switch cost. Score = Impact + Urgency + Risk. Score ≥ 6 → priority = 4 (P1) (max; at most ~10% of today’s tasks) Score 4–5 → priority = 3 (P2) (main focus of the week) Score 2–3 → priority = 2 (P3) (important but can slip) Score ≤ 1 → priority = 1 (P4) (low-energy / backlog filler) Scheduling (due date) — anti-overbooking policy: Calculate daily capacity by counting non-recurring tasks already scheduled. Guideline: Day full if there are ≥ 5 non-trivial tasks (or ≥ 8 short ones). If the day is full, push to the next available weekday. Never schedule “today” if the task takes >90 min and there are already 3+ focus tasks today. Respect weekend off (Sat/Sun), unless tagged #urgent or #oncall. If the task has an explicit deadline (e.g., “by Aug 31”), use that date (or earlier). Prefer due_string (“tomorrow 16:00”, “next wed 10:00”) so Todoist handles timezones. When reading backlog, consider: due (date/datetime/string), priority, labels, project, section, is_recurring. Ignore archived or completed tasks. Ignore “inbox cleanup” tasks so they don’t distort capacity. Tools available: get_open_tasks — returns list of open tasks (id, content, due, priority, labels, project_id, is_recurring). update_task — updates only the new task: content, priority, due_string or due_datetime.
执行并验证
保存工作流后点击「Execute workflow」手动测试,或在「Schedule Trigger」启用后等待自动触发。检查 Todoist 中近 5 分钟新建的任务是否被改写描述、赋予优先级和截止日期。若结果不符合预期,可在 AI Agent 的 System Message 中微调打分阈值或日程规则。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你正在搭建一个 n8n 工作流:自动拉取 Todoist 近 5 分钟新建任务,用 GPT-4.1-mini 改写描述、打分定优先级、安排截止日期后回写。请先确认你已有 n8n 实例、Todoist API token 和 OpenAI API key,再按步骤导入模板并填入凭证。
搭建前请确认 n8n 版本支持 AI Agent(≥ 1.0)及 Todoist Tool 节点。
来源
Automatically triage & improve Todoist tasks with GPT-4.1-mini · rpb-dev · n8n.io · 2025-08-27
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。