iT邦幫忙

2025 iThome 鐵人賽

DAY 20
0
AI & Data

Notion遇上LLM:30天打造我的AI知識管理系統系列 第 20

【Day 20】實作 n8n :自動化 Gmail 電子報 → AI 摘要 → 寫入 Notion

  • 分享至 

  • xImage
  •  

Day 19,我們聊了 n8n × Notion 的概念,今天我們就來動手做一個最常見的自動化場景:
把 Gmail 收到的電子報 → 自動摘要 → 寫進 Notion Database。

這樣做的好處是:

  • 不怕電子報被淹沒在信箱。
  • 每週 Review 筆記時,能快速掌握要點。
  • 透過 AI,省去自己一篇篇整理的時間。

1. 前置作業:需要哪些 API?

在這個流程裡,我們會用到三個 API:

1.1 Gmail API

  • 目的:讀取指定標籤的郵件(例如:label:newsletter)。
  • 取得內容:標題、寄件者、時間、郵件內文(HTML / 純文字)。
  • 設定方式很簡單,直接在 n8n 授權 gmail
    https://ithelp.ithome.com.tw/upload/images/20251005/20178104nU5L89kpza.png
    https://ithelp.ithome.com.tw/upload/images/20251005/20178104MMCPkyEjEZ.png

1.2 OpenAI API

1.3 Notion API

2. Notion Database 設計

  • 在 Notion 裡,我們需要一個專門存電子報的 Database(在這裡命名為 Newsletter DB)。
  • 固定欄位(Property):
Property 名稱 類型 說明
Title Title 電子報標題
Date Date 發佈日期
Sender Select 發送單位(數創電子報)
Category Multi-select AI / Tech / Finance / Event
Created Time 自動生成 (Notion 內建) 這筆 Page 在 Notion 建立的時間,無需人工 mapping。
Last edited Time 自動生成 (Notion 內建) 最後一次更新時間,無需人工 mapping。
Created by 自動生成 (Notion 內建) 系統資訊,紀錄是誰建立,無需人工 mapping。
Last edited vy 自動生成 (Notion 內建)) 系統資訊,紀錄是誰編輯,無需人工 mapping。
  • Page模板(Template):
# 📰 Newsletter

## 📌 Summary
AI 生成的摘要會放在這裡  
例如:本期電子報的核心訊息、關鍵洞察

3. 建立 n8n Workflow

今天我們用來實作的電子報是由「數創實驗室」發布的「數創電子報」
https://ithelp.ithome.com.tw/upload/images/20251004/2017810461xou465N4.png

3.1 Trigger:Gmail

3.2 AI 摘要(OpenAI)

  • 節點:OpenAI Node(或 HTTP Request 呼叫 API)
  • 模型:gpt-4o-mini 或 gpt-4.1-mini
  • Prompt 範例:
    根據{{ $json.text }},摘要內容:
    1. Summary:整體摘要
    2. 核心問題
    3. 關鍵洞察
    4. 行動方案
    5. 金句啟發
    
    Notion 筆記格式,避免出現 '\n' 或 JSON 字元
    

https://ithelp.ithome.com.tw/upload/images/20251005/20178104AkxnS4UPjD.png

3.3 寫入 Notion

  • 節點:Notion → Create Page
  • 設定:
    https://ithelp.ithome.com.tw/upload/images/20251005/201781043sLzc3Lf5a.png
    https://ithelp.ithome.com.tw/upload/images/20251005/20178104dZyJeVVFiP.png

3.4 n8n Workflow 架構圖

https://ithelp.ithome.com.tw/upload/images/20251004/201781049r66CsmW9n.png

📧 Gmail Trigger ─▶ 🤖 OpenAI_Summary ─▶ 🗂 Notion DB (Create Page)
  • 左到右的流程清楚對應「資料來源 → AI 處理 → 寫入知識庫」。
  • 每一個節點都會輸出 item,傳遞到下一個節點。
  • 這樣就能確保電子報從信箱進來,不用人工轉存,直接進入 Notion DB 成為有結構的知識。

3.5 執行結果 - 在 Notion 查看資料

https://ithelp.ithome.com.tw/upload/images/20251004/20178104pAVe0rx6ab.png

4. 小結與下篇預告

透過這個 Demo,我們完成了「自動化電子報 → AI 摘要 → Notion 筆記」的流程。
它的價值不只在於節省時間,而是幫助我把 **資訊收集 → 知識整理 → 筆記應用 **串接起來,讓電子報不再只是「看過就忘」的資訊,而是能沉澱進知識系統的養分。

對我來說,這種自動化最棒的地方在於:

  • 我能把心力放在「理解」與「應用」,而不是「搬運」與「抄寫」。
  • Notion 筆記因為有結構化的 Summary 與 Action Items,Review 的效率也大幅提升。
  • 長期下來,這些電子報的累積,會變成一個可檢索的知識寶庫。

在 Day 21,我會延伸 n8n 實作,嘗試加入更多外部來源,讓 Notion 不只是電子報收件夾,而是成為真正的多源資訊中樞。


上一篇
【Day 19】n8n × Notion:讓筆記成為「動態知識中樞」
下一篇
【Day 21】用 n8n 實作多來源電子報整合:Gmail × OpenAI × Notion:打造多線並行的 AI 知識中樞
系列文
Notion遇上LLM:30天打造我的AI知識管理系統21
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言