notion-flows: 你的 Notion 页面就是你的自动化代码
发布: (2026年3月10日 GMT+8 15:50)
4 分钟阅读
原文: Dev.to
Source: Dev.to
让大脑稍微“炸裂”的想法
如果你的自动化逻辑居住在 Notion 中——不是图表、不是配置文件,而是一页纯英文的文档,你只需要…编辑它?
- 无需重新部署。
- 无需 YAML。
- 无需拖拽式节点编辑器。
工作原理
- 打开一个 Notion 页面。
- 用纯英文写下你的需求。
- 运行
notion-flows run。 - Claude 读取你的页面并在你的 Notion 数据库上执行。
这就是 notion‑flows。
它的功能
notion-flows 是一个 TypeScript CLI,把 Notion 页面当作可执行的业务逻辑。
- 你在 Notion 中创建一个 注册表页面。
- 该注册表下的每个子页面都是一个 flow——对自动化的纯英文描述。
- CLI 会发现这些页面,将它们发送给 Claude(使用 Notion MCP 工具),Claude 按步骤执行指令。
三个开箱即用的示例 Flow
🔥 跟进冷线索
This flow finds leads who haven't been contacted in 7 or more days
and drafts personalized follow‑up messages.
(在此处添加其余示例 flow,每个附带简要描述和必要的代码块。)
条件
- 在 Contacts DB 中检查
Status = "Lead"或Status = "Prospect"。 - 过滤
Last Contacted为 7 天前或更早 的记录。 - 如果
Deal Value> $2,000,标记为 hot。
动作
- 为每个联系人草拟温暖、专业的跟进信息。
- 将草稿写入 Next Action 字段。
- 将 Last Contacted 更新为今天。
📝 内容创意生成器
Prompt
Generate 5 high‑value content ideas for a TypeScript consulting business
targeting early‑stage startups, add them to the Content Pipeline database,
and write a full first draft for the highest ROI idea.
📊 每周 CEO 简报
Prompt
Generate a weekly executive brief by reading all databases,
then append it to this page.
代理循环
notion‑flows 的核心是使用 Notion MCP 工具的 Claude 代理循环。
while (toolCallCount) {
// ...agent logic...
}
// Prints DB IDs → paste them into .env
npx tsx src/cli.ts run
setup 命令会为你搭建完整的工作空间:
- 创建 ⚡ notion‑flows 注册表页面。
- 创建 Contacts、Content Pipeline、Revenue 三个数据库,并带完整属性模式。
- 为这三个示例 flow 页面填充种子数据。
为什么重要
大多数自动化工具要求你学习全新的界面(画布、DSL、配置语法)。notion‑flows 颠覆这一点:界面 就是 Notion 页面,你已经熟悉。
- 与非技术同事共享 flow。
- 直接在 Notion 中编辑逻辑;重新运行 CLI。
- 无需 PR、无需部署。
Notion 页面 即代码。
接下来
- 计划触发器 –
trigger: schedule: 0 9 * * 1语法已解析,只需配合 cron 运行器。 - 多工作区支持 – 在组织之间共享 flow。
- Flow 版本控制 – Notion 的页面历史本身就是 git 日志。
此项目为 Notion dev.to 挑战 所构建。源码在 GitHub。
