iT邦幫忙

2025 iThome 鐵人賽

DAY 16
0
生成式 AI

生成式AI 與 Notion 的碰撞 ?! 你還在 ctrl+c ctrl+v ?系列 第 16

Day 16 | 實作筆記 - 使用n8n 將 AI 自動將每日待辦寫入 Notion - 讀取 Notion 節點設定

  • 分享至 

  • xImage
  •  

昨天我們完成了 Google Calendar 的節點串接。
我們今天要來串接第二個節點了,就是獲取 Notion 資料庫的每日待辦,這次我們一樣會使用我們之前用 Claude Desktop 創建的行程總覽資料庫。

獲取 Notion API

雖然說我們Claude desktop 跟這次的n8n想要的資料庫是一樣的但要養成好習慣將不同的整合創建不同的整合,之後才不會錯亂。

以下的內容雖有講過,但還是稍微帶個流程。

  1. 前往 Notion 官方整合管理頁:https://www.notion.so/my-integrations

  2. 建立新整合

    https://ithelp.ithome.com.tw/upload/images/20250930/20178023YLBGf6DMqg.png

  3. 設定這個整合的名稱與要關聯的工作區。

    https://ithelp.ithome.com.tw/upload/images/20250930/201780238XzBxD53U2.png

  4. 照 Day 5 教過的,先在配置中設定功能 → 在存取權限設定要給予權限的頁面。

  5. 獲取 Notion API Key ( 內部整合密鑰 )。

n8n Notion 節點設定

  1. 查詢 Notion →選取 Get many datanase pages。

    https://ithelp.ithome.com.tw/upload/images/20250930/201780234bmDB5M8ZM.png

  2. 點開 credential to connent with → 下拉選單選擇 + create new credential。

    https://ithelp.ithome.com.tw/upload/images/20250930/20178023cX9Elqv9uG.png

  3. 將我們的Notio API 複製並貼上 → 按下 Save 。

    https://ithelp.ithome.com.tw/upload/images/20250930/20178023pwHZ8n0bQ6.png

  4. 基本設定

    Resource:Database page
    Operation:Get many
    Database:選擇自己想要這個工作流會回傳的資料庫

    https://ithelp.ithome.com.tw/upload/images/20250930/20178023d66O3wT0ik.png

  5. 將 Filter 選擇 JOSN

  6. 修改Filters ( JOSN ) → 點選 Expression → 將以下程式碼貼入格子,就會自動幫我們找到今天的待辦

    {
      "and": [
        {
          "property": "目標完成時間",
          "date": {
            "equals": "{{ $now.toISODate() }}"
          }
        },
        {
          "property": "狀態",
          "select": {
            "does_not_equal": "完成"
          }
        }
      ]
    }
    

    https://ithelp.ithome.com.tw/upload/images/20250930/20178023fw4NrVv2WW.png

    當看到下面跑出綠色的通知就是這個節點執行成功了。

做到這邊我們的n8n流成就大該如下圖了。

https://ithelp.ithome.com.tw/upload/images/20250930/20178023D8qT0g5EwQ.png


今日總結:

今天的流程有時候還是會遇到一些小問題,像是 Notion 不能接在Google calendar後方,用簡單的比喻就是:
後面的步驟 (Notion),必須要等前面的步驟 (Google Calendar) 把「接力棒」(也就是資料) 交給它,才會開始跑。
如果你的 Google Calendar 那天剛好沒有任何行程,它就兩手空空,沒有任何東西可以交棒,所以 Notion 節點就根本沒有機會啟動
所以我們的做法改成用建立兩個獨立的流程,來去解決問題。
今天我們將兩個需要獲取資料的節點都設定好跟串接好了,接下來我們會將資料丟給AI。所以…
下一篇 ! Set 節點整合 Notion 、Google 日歷資料輸出節點!敬請期待 ! !


上一篇
Day 15 | 實作筆記 - 使用n8n 將 AI 自動將每日待辦寫入 Notion - n8n 串接 Google Calendar:憑證 (Credential) 設定教學
下一篇
Day 17 | 實作筆記 - 使用n8n 將 AI 自動將每日待辦寫入 Notion - n8n Set 節點整合 Notion 、Google 日歷資料輸出節點篇
系列文
生成式AI 與 Notion 的碰撞 ?! 你還在 ctrl+c ctrl+v ?20
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言