8
n8n 中文网amn8n.com

Outlook和Notion知识库

高级

这是一个自动化工作流,包含 32 个节点。主要使用 If, Merge, Notion, SplitOut, NotionTrigger 等节点。 使用Pinecone和GPT-4从Outlook和Notion构建AI就绪知识库

前置要求
  • Notion API Key
  • OpenAI API Key
  • Pinecone API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "xA9J9DImm49HURF3",
  "meta": {
    "instanceId": "6f81894254c2852bfe28b07fc1f6652b03481706dd714d6609cc88e8521956d2",
    "templateCredsSetupCompleted": true
  },
  "name": "Outlook 和 Notion 知识库",
  "tags": [],
  "nodes": [
    {
      "id": "72f3f684-2c5f-4660-8adb-19174e82ef32",
      "name": "Microsoft Outlook 触发器",
      "type": "n8n-nodes-base.microsoftOutlookTrigger",
      "position": [
        544,
        208
      ],
      "parameters": {
        "output": "raw",
        "filters": {
          "foldersToInclude": [
            "AQMkADAwATMwMAItMmYwYS01YjkyLTAwAi0wMAoALgAAAxOU_onpis9NmFJuGkXBI8UBAGQVofbxt59GpSnWTziHe9kABPqpFlEAAAA="
          ]
        },
        "options": {
          "downloadAttachments": true
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "id": "Xszt4lrcCVADugZs",
          "name": "Microsoft Outlook account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "82792010-19d2-491d-927e-610ab1cccb28",
      "name": "获取多条消息",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        752,
        208
      ],
      "webhookId": "62988410-1616-4217-8ef2-0107e7677407",
      "parameters": {
        "output": "raw",
        "options": {},
        "filtersUI": {
          "values": {
            "filters": {
              "custom": "=conversationId eq '{{ $json.conversationId }}'"
            }
          }
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "id": "Xszt4lrcCVADugZs",
          "name": "Microsoft Outlook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "256a55fc-6625-4388-9389-94184848c544",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1216,
        208
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "emails"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n",
          "cachedResultName": "n8n"
        },
        "embeddingBatchSize": 50
      },
      "credentials": {
        "pineconeApi": {
          "id": "4rb1dBTjp60vz23a",
          "name": "PineconeApi account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "3c1cfd55-b6e1-4adf-8ee1-c25b5202018b",
      "name": "Embeddings Cohere",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        1168,
        384
      ],
      "parameters": {
        "modelName": "embed-multilingual-v3.0"
      },
      "credentials": {
        "cohereApi": {
          "id": "Mfs4k8hXGehRHvHh",
          "name": "CohereApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d8a46692-2af5-477c-acb1-1b6390c0c359",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        1312,
        400
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $json.body.content }}",
        "jsonMode": "expressionData",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "bda4ca91-117f-4527-b25d-c85908e50892",
      "name": "递归字符文本分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1392,
        544
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 100
      },
      "typeVersion": 1
    },
    {
      "id": "ba74aea5-ec1c-4f63-92d8-98d6bb65805b",
      "name": "Notion 触发器",
      "type": "n8n-nodes-base.notionTrigger",
      "position": [
        160,
        -16
      ],
      "parameters": {
        "simple": false,
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "6ec8b622-d5bf-4c6a-80d9-7d668494f82b",
          "cachedResultUrl": "https://www.notion.so/6ec8b622d5bf4c6a80d97d668494f82b",
          "cachedResultName": "test database"
        }
      },
      "credentials": {
        "notionApi": {
          "id": "6dqyQ9MMtK9ou9ab",
          "name": "Notion account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7dcc8513-8db2-4f86-828f-35d02df20276",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        160,
        192
      ],
      "parameters": {
        "mode": "insert",
        "options": {
          "pineconeNamespace": "knkowledgebase"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n",
          "cachedResultName": "n8n"
        },
        "embeddingBatchSize": 50
      },
      "credentials": {
        "pineconeApi": {
          "id": "4rb1dBTjp60vz23a",
          "name": "PineconeApi account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "fb314465-be01-4153-ae6b-21c20b24bff2",
      "name": "Cohere 嵌入1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        112,
        368
      ],
      "parameters": {
        "modelName": "embed-multilingual-v3.0"
      },
      "credentials": {
        "cohereApi": {
          "id": "Mfs4k8hXGehRHvHh",
          "name": "CohereApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8eb8639d-ef28-46e9-ab53-a1f80439e7d0",
      "name": "默认数据加载器1",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        256,
        384
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $json.plain_text }}",
        "jsonMode": "expressionData",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "11de6d57-20fc-4992-91e5-86bdb33ce145",
      "name": "递归字符文本分割器1",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        352,
        544
      ],
      "parameters": {
        "options": {},
        "chunkOverlap": 100
      },
      "typeVersion": 1
    },
    {
      "id": "8ac03efa-6af8-4139-837d-05adc99f1c79",
      "name": "移除重复项",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        960,
        208
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "body.content"
      },
      "typeVersion": 2
    },
    {
      "id": "8a1a6569-f578-4037-8464-728a52ea0d3e",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1312,
        -16
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "paragraph.text"
      },
      "typeVersion": 1
    },
    {
      "id": "36e5c0f6-7c24-442c-95c2-f88d23c1c83f",
      "name": "获取多个子块",
      "type": "n8n-nodes-base.notion",
      "position": [
        368,
        -16
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "resource": "block",
        "operation": "getAll",
        "returnAll": true,
        "simplifyOutput": false,
        "fetchNestedBlocks": true
      },
      "credentials": {
        "notionApi": {
          "id": "6dqyQ9MMtK9ou9ab",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8015c6e9-7cd8-4e09-86ee-206cae5e2ab6",
      "name": "如果",
      "type": "n8n-nodes-base.if",
      "position": [
        576,
        -16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "79a2b3f0-09f8-42b5-911d-85a27d04f121",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.type }}",
              "rightValue": "synced_block"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d4780200-8ee0-4fe4-bbaf-defac32f558f",
      "name": "获取多个子块1",
      "type": "n8n-nodes-base.notion",
      "position": [
        848,
        -144
      ],
      "parameters": {
        "blockId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.synced_block.synced_from.block_id }}"
        },
        "resource": "block",
        "operation": "getAll",
        "returnAll": true,
        "simplifyOutput": false,
        "fetchNestedBlocks": true
      },
      "credentials": {
        "notionApi": {
          "id": "6dqyQ9MMtK9ou9ab",
          "name": "Notion account"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d81a6b16-36dd-4b3a-b1f8-937bf0a6f67a",
      "name": "移除重复项1",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        1520,
        -16
      ],
      "parameters": {
        "compare": "selectedFields",
        "options": {},
        "fieldsToCompare": "plain_text"
      },
      "typeVersion": 2
    },
    {
      "id": "c66e5310-f1b7-4591-9f62-a3c10b12d494",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1104,
        -16
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "437d367e-b497-4a47-974a-ca2e992723b7",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        192
      ],
      "parameters": {
        "width": 1056,
        "height": 496,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "284ec18f-19dc-4168-b209-19b9f4869ad6",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        448
      ],
      "parameters": {
        "color": 5,
        "width": 496,
        "height": 208,
        "content": "## Outlook 知识库"
      },
      "typeVersion": 1
    },
    {
      "id": "8e739795-7835-4739-ba22-b55aa7cdb646",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1744,
        432
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful assistant. Your role is to answer the customer questions based on the knowledge base you have access to through the tools you have. If you don't find the answer in the knowledge base or previous emails don't come up with answer just tell the customer that you don't have this information."
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6d9a6b4c-6ba1-4c2f-9dbd-a7ee2c7ae881",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1696,
        208
      ],
      "webhookId": "97cff992-376f-49c6-8b57-34236a096e5d",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "85c8d7d3-e978-49f1-b4c5-ed0fcd9922af",
      "name": "Pinecone Vector Store2",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        2000,
        640
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {
          "pineconeNamespace": "knowledgebase"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n",
          "cachedResultName": "n8n"
        },
        "toolDescription": "use this tool to look at your knowledge base."
      },
      "credentials": {
        "pineconeApi": {
          "id": "4rb1dBTjp60vz23a",
          "name": "PineconeApi account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2e1dad6b-adc1-43df-ab9a-af763fdb6021",
      "name": "Embeddings Cohere2",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        1936,
        784
      ],
      "parameters": {
        "modelName": "embed-multilingual-v3.0"
      },
      "credentials": {
        "cohereApi": {
          "id": "Mfs4k8hXGehRHvHh",
          "name": "CohereApi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ce453bb0-fdb7-4170-9a15-2a3a154e12cb",
      "name": "Pinecone Vector Store3",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1744,
        640
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {
          "pineconeNamespace": "emails"
        },
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "n8n",
          "cachedResultName": "n8n"
        },
        "toolDescription": "use this tool to look at similar emails."
      },
      "credentials": {
        "pineconeApi": {
          "id": "4rb1dBTjp60vz23a",
          "name": "PineconeApi account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "7329af25-ba0d-445d-9318-fb63991a19e9",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1632,
        640
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "6ljetIXS9Oig1w9v",
          "name": "OpenAi cred"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e0aee61b-469e-40cb-b609-8e4f641cecc8",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        192
      ],
      "parameters": {
        "color": 4,
        "width": 688,
        "height": 736,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "39399055-a8e4-4dd7-8ac2-e46868d9aa6a",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1936,
        208
      ],
      "parameters": {
        "color": 5,
        "width": 272,
        "height": 208,
        "content": "## 客户支持代理"
      },
      "typeVersion": 1
    },
    {
      "id": "17553913-1e31-4bbd-8acb-3d8586761814",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 496,
        "height": 192,
        "content": "## Notion 知识库"
      },
      "typeVersion": 1
    },
    {
      "id": "31ff5834-459d-4081-a20f-3c3965469c4d",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -256
      ],
      "parameters": {
        "color": 3,
        "width": 816,
        "height": 960,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "044d57f3-cb61-4f1c-a584-fc1b2aed3c59",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        -256
      ],
      "parameters": {
        "color": 3,
        "width": 800,
        "height": 432,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a7a7243c-19b4-4006-a8a0-3c28e542e66f",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1712,
        784
      ],
      "parameters": {},
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "0f6bfeb3-c551-41ef-9cce-351a0ce86f09",
  "connections": {
    "8015c6e9-7cd8-4e09-86ee-206cae5e2ab6": {
      "main": [
        [
          {
            "node": "d4780200-8ee0-4fe4-bbaf-defac32f558f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "c66e5310-f1b7-4591-9f62-a3c10b12d494",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "c66e5310-f1b7-4591-9f62-a3c10b12d494": {
      "main": [
        [
          {
            "node": "8a1a6569-f578-4037-8464-728a52ea0d3e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8a1a6569-f578-4037-8464-728a52ea0d3e": {
      "main": [
        [
          {
            "node": "d81a6b16-36dd-4b3a-b1f8-937bf0a6f67a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a7a7243c-19b4-4006-a8a0-3c28e542e66f": {
      "ai_memory": [
        [
          {
            "node": "8e739795-7835-4739-ba22-b55aa7cdb646",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "ba74aea5-ec1c-4f63-92d8-98d6bb65805b": {
      "main": [
        [
          {
            "node": "36e5c0f6-7c24-442c-95c2-f88d23c1c83f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3c1cfd55-b6e1-4adf-8ee1-c25b5202018b": {
      "ai_embedding": [
        [
          {
            "node": "256a55fc-6625-4388-9389-94184848c544",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "82792010-19d2-491d-927e-610ab1cccb28": {
      "main": [
        [
          {
            "node": "8ac03efa-6af8-4139-837d-05adc99f1c79",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "7329af25-ba0d-445d-9318-fb63991a19e9": {
      "ai_languageModel": [
        [
          {
            "node": "8e739795-7835-4739-ba22-b55aa7cdb646",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "8ac03efa-6af8-4139-837d-05adc99f1c79": {
      "main": [
        [
          {
            "node": "256a55fc-6625-4388-9389-94184848c544",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fb314465-be01-4153-ae6b-21c20b24bff2": {
      "ai_embedding": [
        [
          {
            "node": "7dcc8513-8db2-4f86-828f-35d02df20276",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "2e1dad6b-adc1-43df-ab9a-af763fdb6021": {
      "ai_embedding": [
        [
          {
            "node": "85c8d7d3-e978-49f1-b4c5-ed0fcd9922af",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "ce453bb0-fdb7-4170-9a15-2a3a154e12cb",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "d81a6b16-36dd-4b3a-b1f8-937bf0a6f67a": {
      "main": [
        [
          {
            "node": "7dcc8513-8db2-4f86-828f-35d02df20276",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d8a46692-2af5-477c-acb1-1b6390c0c359": {
      "ai_document": [
        [
          {
            "node": "256a55fc-6625-4388-9389-94184848c544",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "8eb8639d-ef28-46e9-ab53-a1f80439e7d0": {
      "ai_document": [
        [
          {
            "node": "7dcc8513-8db2-4f86-828f-35d02df20276",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "36e5c0f6-7c24-442c-95c2-f88d23c1c83f": {
      "main": [
        [
          {
            "node": "8015c6e9-7cd8-4e09-86ee-206cae5e2ab6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d4780200-8ee0-4fe4-bbaf-defac32f558f": {
      "main": [
        [
          {
            "node": "c66e5310-f1b7-4591-9f62-a3c10b12d494",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "85c8d7d3-e978-49f1-b4c5-ed0fcd9922af": {
      "ai_tool": [
        [
          {
            "node": "8e739795-7835-4739-ba22-b55aa7cdb646",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "ce453bb0-fdb7-4170-9a15-2a3a154e12cb": {
      "ai_tool": [
        [
          {
            "node": "8e739795-7835-4739-ba22-b55aa7cdb646",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "72f3f684-2c5f-4660-8adb-19174e82ef32": {
      "main": [
        [
          {
            "node": "82792010-19d2-491d-927e-610ab1cccb28",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6d9a6b4c-6ba1-4c2f-9dbd-a7ee2c7ae881": {
      "main": [
        [
          {
            "node": "8e739795-7835-4739-ba22-b55aa7cdb646",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bda4ca91-117f-4527-b25d-c85908e50892": {
      "ai_textSplitter": [
        [
          {
            "node": "d8a46692-2af5-477c-acb1-1b6390c0c359",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "11de6d57-20fc-4992-91e5-86bdb33ce145": {
      "ai_textSplitter": [
        [
          {
            "node": "8eb8639d-ef28-46e9-ab53-a1f80439e7d0",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量32
分类-
节点类型17
难度说明

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

作者
Yasser Sami

Yasser Sami

@yassersami

AI Automation Architect building smart workflows with n8n. I help businesses save time by automating processes, connecting apps, and integrating AI. My focus is on creating efficient, reliable systems that streamline operations and reduce manual work.

外部链接
在 n8n.io 查看

分享此工作流

分类

分类: 34