Revert "change to json formatted text and reformat all .txt to .json & fix error json format"

This commit is contained in:
Enes Cingöz
2025-07-05 22:28:12 +01:00
committed by GitHub
parent 8a54e700d3
commit bdad1cd2e9
585 changed files with 196640 additions and 189747 deletions

View File

@@ -1,179 +0,0 @@
{
"nodes": [
{
"name": "Typeform Trigger",
"type": "n8n-nodes-base.typeformTrigger",
"position": [
0,
400
],
"webhookId": "ad8a87ef-d293-4e48-8d36-838d69ebce0f",
"parameters": {
"formId": "fBYjtY5e"
},
"credentials": {
"typeformApi": ""
},
"typeVersion": 1
},
{
"name": "Google Cloud Natural Language",
"type": "n8n-nodes-base.googleCloudNaturalLanguage",
"position": [
200,
400
],
"parameters": {
"content": "={{$json[\"Any suggestions for us? \"]}}",
"options": {}
},
"credentials": {
"googleCloudNaturalLanguageOAuth2Api": ""
},
"typeVersion": 1
},
{
"name": "IF",
"type": "n8n-nodes-base.if",
"position": [
400,
400
],
"parameters": {
"conditions": {
"number": [
{
"value1": "={{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}",
"operation": "larger"
}
]
}
},
"typeVersion": 1
},
{
"name": "Notion",
"type": "n8n-nodes-base.notion",
"position": [
600,
300
],
"parameters": {
"resource": "databasePage",
"databaseId": "b7d1130a-3756-4bb3-aa56-0c77bf416437",
"propertiesUi": {
"propertyValues": [
{
"key": "Name|title",
"title": "={{$node[\"Typeform Trigger\"].json[\"Name\"]}}"
},
{
"key": "Feedback|rich_text",
"textContent": "={{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}"
}
]
}
},
"credentials": {
"notionApi": ""
},
"typeVersion": 1
},
{
"name": "Slack",
"type": "n8n-nodes-base.slack",
"position": [
800,
300
],
"parameters": {
"channel": "general",
"blocksUi": {
"blocksValues": []
},
"attachments": [
{
"text": "={{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}",
"title": "={{$node[\"Typeform Trigger\"].json[\"Name\"]}} {{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}"
}
],
"otherOptions": {}
},
"credentials": {
"slackApi": ""
},
"typeVersion": 1
},
{
"name": "Trello",
"type": "n8n-nodes-base.trello",
"position": [
600,
500
],
"parameters": {
"name": "=Score: {{$json[\"documentSentiment\"][\"score\"]}}",
"listId": "5fbb9e2eb1d5cc0a8a7ab8ac",
"description": "=Score: {{$json[\"documentSentiment\"][\"score\"]}}\nFeedback: {{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}\nUser: {{$node[\"Typeform Trigger\"].json[\"Name\"]}}",
"additionalFields": {}
},
"credentials": {
"trelloApi": ""
},
"typeVersion": 1
}
],
"connections": {
"IF": {
"main": [
[
{
"node": "Notion",
"type": "main",
"index": 0
}
],
[
{
"node": "Trello",
"type": "main",
"index": 0
}
]
]
},
"Notion": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Typeform Trigger": {
"main": [
[
{
"node": "Google Cloud Natural Language",
"type": "main",
"index": 0
}
]
]
},
"Google Cloud Natural Language": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,179 @@
{
"nodes": [
{
"name": "Typeform Trigger",
"type": "n8n-nodes-base.typeformTrigger",
"position": [
0,
400
],
"webhookId": "ad8a87ef-d293-4e48-8d36-838d69ebce0f",
"parameters": {
"formId": "fBYjtY5e"
},
"credentials": {
"typeformApi": ""
},
"typeVersion": 1
},
{
"name": "Google Cloud Natural Language",
"type": "n8n-nodes-base.googleCloudNaturalLanguage",
"position": [
200,
400
],
"parameters": {
"content": "={{$json[\"Any suggestions for us? \"]}}",
"options": {}
},
"credentials": {
"googleCloudNaturalLanguageOAuth2Api": ""
},
"typeVersion": 1
},
{
"name": "IF",
"type": "n8n-nodes-base.if",
"position": [
400,
400
],
"parameters": {
"conditions": {
"number": [
{
"value1": "={{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}",
"operation": "larger"
}
]
}
},
"typeVersion": 1
},
{
"name": "Notion",
"type": "n8n-nodes-base.notion",
"position": [
600,
300
],
"parameters": {
"resource": "databasePage",
"databaseId": "b7d1130a-3756-4bb3-aa56-0c77bf416437",
"propertiesUi": {
"propertyValues": [
{
"key": "Name|title",
"title": "={{$node[\"Typeform Trigger\"].json[\"Name\"]}}"
},
{
"key": "Feedback|rich_text",
"textContent": "={{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}"
}
]
}
},
"credentials": {
"notionApi": ""
},
"typeVersion": 1
},
{
"name": "Slack",
"type": "n8n-nodes-base.slack",
"position": [
800,
300
],
"parameters": {
"channel": "general",
"blocksUi": {
"blocksValues": []
},
"attachments": [
{
"text": "={{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}",
"title": "={{$node[\"Typeform Trigger\"].json[\"Name\"]}} {{$node[\"Google Cloud Natural Language\"].json[\"documentSentiment\"][\"score\"]}}"
}
],
"otherOptions": {}
},
"credentials": {
"slackApi": ""
},
"typeVersion": 1
},
{
"name": "Trello",
"type": "n8n-nodes-base.trello",
"position": [
600,
500
],
"parameters": {
"name": "=Score: {{$json[\"documentSentiment\"][\"score\"]}}",
"listId": "5fbb9e2eb1d5cc0a8a7ab8ac",
"description": "=Score: {{$json[\"documentSentiment\"][\"score\"]}}\nFeedback: {{$node[\"Typeform Trigger\"].json[\"Any suggestions for us? \"]}}\nUser: {{$node[\"Typeform Trigger\"].json[\"Name\"]}}",
"additionalFields": {}
},
"credentials": {
"trelloApi": ""
},
"typeVersion": 1
}
],
"connections": {
"IF": {
"main": [
[
{
"node": "Notion",
"type": "main",
"index": 0
}
],
[
{
"node": "Trello",
"type": "main",
"index": 0
}
]
]
},
"Notion": {
"main": [
[
{
"node": "Slack",
"type": "main",
"index": 0
}
]
]
},
"Typeform Trigger": {
"main": [
[
{
"node": "Google Cloud Natural Language",
"type": "main",
"index": 0
}
]
]
},
"Google Cloud Natural Language": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -1,470 +0,0 @@
{
"id": "FU3MrLkaTHmfdG4n",
"meta": {
"instanceId": "3294023dd650d95df294922b9d55d174ef26f4a2e6cce97c8a4ab5f98f5b8c7b",
"templateCredsSetupCompleted": true
},
"name": "Hugging Face to Notion",
"tags": [],
"nodes": [
{
"id": "32d5bfee-97f1-4e92-b62e-d09bdd9c3821",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-2640,
-300
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1,
2,
3,
4,
5
],
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "b1f4078e-ac77-47ec-995c-f52fd98fafef",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-1360,
-280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7094d6db-1fa7-4b59-91cf-6bbd5b5f067e",
"operator": {
"type": "object",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "afac08e1-b629-4467-86ef-907e4a5e8841",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1760,
-300
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "807ba450-9c89-4f88-aa84-91f43e3adfc6",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
-1960,
-300
],
"parameters": {
"options": {},
"fieldToSplitOut": "url, url"
},
"typeVersion": 1
},
{
"id": "08dd3f15-2030-48f2-ab0f-f85f797268e1",
"name": "Request Hugging Face Paper",
"type": "n8n-nodes-base.httpRequest",
"position": [
-2440,
-300
],
"parameters": {
"url": "https://huggingface.co/papers",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "date",
"value": "={{ $now.minus(1,'days').format('yyyy-MM-dd') }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "f37ba769-d881-4aad-927d-ca1f4a68b9a1",
"name": "Extract Hugging Face Paper",
"type": "n8n-nodes-base.html",
"position": [
-2200,
-300
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "url",
"attribute": "href",
"cssSelector": ".line-clamp-3",
"returnArray": true,
"returnValue": "attribute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "94ba99bf-a33b-4311-a4e6-86490e1bb9ad",
"name": "Check Paper URL Existed",
"type": "n8n-nodes-base.notion",
"position": [
-1540,
-280
],
"parameters": {
"filters": {
"conditions": [
{
"key": "URL|url",
"urlValue": "={{ 'https://huggingface.co'+$json.url }}",
"condition": "equals"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b67aba-1fcc-80ae-baa1-d88ffda7ae83",
"cachedResultUrl": "https://www.notion.so/17b67aba1fcc80aebaa1d88ffda7ae83",
"cachedResultName": "huggingface-abstract"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "I5KdUzwhWnphQ862",
"name": "notion"
}
},
"typeVersion": 2.2,
"alwaysOutputData": true
},
{
"id": "ece8dee2-e444-4557-aad9-5bdcb5ecd756",
"name": "Request Hugging Face Paper Detail",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1080,
-300
],
"parameters": {
"url": "={{ 'https://huggingface.co'+$('Split Out').item.json.url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "53b266fe-e7c4-4820-92eb-78a6ba7a6430",
"name": "OpenAI Analysis Abstract",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-640,
-300
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-2024-11-20",
"cachedResultName": "GPT-4O-2024-11-20"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "Extract the following key details from the paper abstract:\n\nCore Introduction: Summarize the main contributions and objectives of the paper, highlighting its innovations and significance.\nKeyword Extraction: List 2-5 keywords that best represent the research direction and techniques of the paper.\nKey Data and Results: Extract important performance metrics, comparison results, and the paper's advantages over other studies.\nTechnical Details: Provide a brief overview of the methods, optimization techniques, and datasets mentioned in the paper.\nClassification: Assign an appropriate academic classification based on the content of the paper.\n\n\nOutput as json\n{\n \"Core_Introduction\": \"PaSa is an advanced Paper Search agent powered by large language models that can autonomously perform a series of decisions (including invoking search tools, reading papers, and selecting relevant references) to provide comprehensive and accurate results for complex academic queries.\",\n \"Keywords\": [\n \"Paper Search Agent\",\n \"Large Language Models\",\n \"Reinforcement Learning\",\n \"Academic Queries\",\n \"Performance Benchmarking\"\n ],\n \"Data_and_Results\": \"PaSa outperforms existing baselines (such as Google, GPT-4, chatGPT) in tests using AutoScholarQuery (35k academic queries) and RealScholarQuery (real-world academic queries). For example, PaSa-7B exceeds Google with GPT-4o by 37.78% in recall@20 and 39.90% in recall@50.\",\n \"Technical_Details\": \"PaSa is optimized using reinforcement learning with the AutoScholarQuery synthetic dataset, demonstrating superior performance in multiple benchmarks.\",\n \"Classification\": [\n \"Artificial Intelligence (AI)\",\n \"Academic Search and Information Retrieval\",\n \"Natural Language Processing (NLP)\",\n \"Reinforcement Learning\"\n ]\n}\n```"
},
{
"content": "={{ $json.abstract }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"id": "LmLcxHwbzZNWxqY6",
"name": "Unnamed credential"
}
},
"typeVersion": 1.8
},
{
"id": "f491cd7f-598e-46fd-b80c-04cfa9766dfd",
"name": "Store Abstract Notion",
"type": "n8n-nodes-base.notion",
"position": [
-300,
-300
],
"parameters": {
"options": {},
"resource": "databasePage",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b67aba-1fcc-80ae-baa1-d88ffda7ae83",
"cachedResultUrl": "https://www.notion.so/17b67aba1fcc80aebaa1d88ffda7ae83",
"cachedResultName": "huggingface-abstract"
},
"propertiesUi": {
"propertyValues": [
{
"key": "URL|url",
"urlValue": "={{ 'https://huggingface.co'+$('Split Out').item.json.url }}"
},
{
"key": "title|title",
"title": "={{ $('Extract Hugging Face Paper Abstract').item.json.title }}"
},
{
"key": "abstract|rich_text",
"textContent": "={{ $('Extract Hugging Face Paper Abstract').item.json.abstract.substring(0,2000) }}"
},
{
"key": "scrap-date|date",
"date": "={{ $today.format('yyyy-MM-dd') }}",
"includeTime": false
},
{
"key": "Classification|rich_text",
"textContent": "={{ $json.message.content.Classification.join(',') }}"
},
{
"key": "Technical_Details|rich_text",
"textContent": "={{ $json.message.content.Technical_Details }}"
},
{
"key": "Data_and_Results|rich_text",
"textContent": "={{ $json.message.content.Data_and_Results }}"
},
{
"key": "keywords|rich_text",
"textContent": "={{ $json.message.content.Keywords.join(',') }}"
},
{
"key": "Core Introduction|rich_text",
"textContent": "={{ $json.message.content.Core_Introduction }}"
}
]
}
},
"credentials": {
"notionApi": {
"id": "I5KdUzwhWnphQ862",
"name": "notion"
}
},
"typeVersion": 2.2
},
{
"id": "d5816a1c-d1fa-4be2-8088-57fbf68e6b43",
"name": "Extract Hugging Face Paper Abstract",
"type": "n8n-nodes-base.html",
"position": [
-840,
-300
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "abstract",
"cssSelector": ".text-gray-700"
},
{
"key": "title",
"cssSelector": ".text-2xl"
}
]
}
},
"typeVersion": 1.2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4b0ec2a3-253d-46d5-a4d4-1d9ff21ba4a3",
"connections": {
"If": {
"main": [
[
{
"node": "Request Hugging Face Paper Detail",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Check Paper URL Existed",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Request Hugging Face Paper",
"type": "main",
"index": 0
}
]
]
},
"Store Abstract Notion": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Check Paper URL Existed": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Analysis Abstract": {
"main": [
[
{
"node": "Store Abstract Notion",
"type": "main",
"index": 0
}
]
]
},
"Extract Hugging Face Paper": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Request Hugging Face Paper": {
"main": [
[
{
"node": "Extract Hugging Face Paper",
"type": "main",
"index": 0
}
]
]
},
"Request Hugging Face Paper Detail": {
"main": [
[
{
"node": "Extract Hugging Face Paper Abstract",
"type": "main",
"index": 0
}
]
]
},
"Extract Hugging Face Paper Abstract": {
"main": [
[
{
"node": "OpenAI Analysis Abstract",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,470 @@
{
"id": "FU3MrLkaTHmfdG4n",
"meta": {
"instanceId": "3294023dd650d95df294922b9d55d174ef26f4a2e6cce97c8a4ab5f98f5b8c7b",
"templateCredsSetupCompleted": true
},
"name": "Hugging Face to Notion",
"tags": [],
"nodes": [
{
"id": "32d5bfee-97f1-4e92-b62e-d09bdd9c3821",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-2640,
-300
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1,
2,
3,
4,
5
],
"triggerAtHour": 8
}
]
}
},
"typeVersion": 1.2
},
{
"id": "b1f4078e-ac77-47ec-995c-f52fd98fafef",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
-1360,
-280
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7094d6db-1fa7-4b59-91cf-6bbd5b5f067e",
"operator": {
"type": "object",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "afac08e1-b629-4467-86ef-907e4a5e8841",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1760,
-300
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "807ba450-9c89-4f88-aa84-91f43e3adfc6",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
-1960,
-300
],
"parameters": {
"options": {},
"fieldToSplitOut": "url, url"
},
"typeVersion": 1
},
{
"id": "08dd3f15-2030-48f2-ab0f-f85f797268e1",
"name": "Request Hugging Face Paper",
"type": "n8n-nodes-base.httpRequest",
"position": [
-2440,
-300
],
"parameters": {
"url": "https://huggingface.co/papers",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "date",
"value": "={{ $now.minus(1,'days').format('yyyy-MM-dd') }}"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "f37ba769-d881-4aad-927d-ca1f4a68b9a1",
"name": "Extract Hugging Face Paper",
"type": "n8n-nodes-base.html",
"position": [
-2200,
-300
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "url",
"attribute": "href",
"cssSelector": ".line-clamp-3",
"returnArray": true,
"returnValue": "attribute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "94ba99bf-a33b-4311-a4e6-86490e1bb9ad",
"name": "Check Paper URL Existed",
"type": "n8n-nodes-base.notion",
"position": [
-1540,
-280
],
"parameters": {
"filters": {
"conditions": [
{
"key": "URL|url",
"urlValue": "={{ 'https://huggingface.co'+$json.url }}",
"condition": "equals"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b67aba-1fcc-80ae-baa1-d88ffda7ae83",
"cachedResultUrl": "https://www.notion.so/17b67aba1fcc80aebaa1d88ffda7ae83",
"cachedResultName": "huggingface-abstract"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "I5KdUzwhWnphQ862",
"name": "notion"
}
},
"typeVersion": 2.2,
"alwaysOutputData": true
},
{
"id": "ece8dee2-e444-4557-aad9-5bdcb5ecd756",
"name": "Request Hugging Face Paper Detail",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1080,
-300
],
"parameters": {
"url": "={{ 'https://huggingface.co'+$('Split Out').item.json.url }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "53b266fe-e7c4-4820-92eb-78a6ba7a6430",
"name": "OpenAI Analysis Abstract",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
-640,
-300
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-2024-11-20",
"cachedResultName": "GPT-4O-2024-11-20"
},
"options": {},
"messages": {
"values": [
{
"role": "system",
"content": "Extract the following key details from the paper abstract:\n\nCore Introduction: Summarize the main contributions and objectives of the paper, highlighting its innovations and significance.\nKeyword Extraction: List 2-5 keywords that best represent the research direction and techniques of the paper.\nKey Data and Results: Extract important performance metrics, comparison results, and the paper's advantages over other studies.\nTechnical Details: Provide a brief overview of the methods, optimization techniques, and datasets mentioned in the paper.\nClassification: Assign an appropriate academic classification based on the content of the paper.\n\n\nOutput as json\n{\n \"Core_Introduction\": \"PaSa is an advanced Paper Search agent powered by large language models that can autonomously perform a series of decisions (including invoking search tools, reading papers, and selecting relevant references) to provide comprehensive and accurate results for complex academic queries.\",\n \"Keywords\": [\n \"Paper Search Agent\",\n \"Large Language Models\",\n \"Reinforcement Learning\",\n \"Academic Queries\",\n \"Performance Benchmarking\"\n ],\n \"Data_and_Results\": \"PaSa outperforms existing baselines (such as Google, GPT-4, chatGPT) in tests using AutoScholarQuery (35k academic queries) and RealScholarQuery (real-world academic queries). For example, PaSa-7B exceeds Google with GPT-4o by 37.78% in recall@20 and 39.90% in recall@50.\",\n \"Technical_Details\": \"PaSa is optimized using reinforcement learning with the AutoScholarQuery synthetic dataset, demonstrating superior performance in multiple benchmarks.\",\n \"Classification\": [\n \"Artificial Intelligence (AI)\",\n \"Academic Search and Information Retrieval\",\n \"Natural Language Processing (NLP)\",\n \"Reinforcement Learning\"\n ]\n}\n```"
},
{
"content": "={{ $json.abstract }}"
}
]
},
"jsonOutput": true
},
"credentials": {
"openAiApi": {
"id": "LmLcxHwbzZNWxqY6",
"name": "Unnamed credential"
}
},
"typeVersion": 1.8
},
{
"id": "f491cd7f-598e-46fd-b80c-04cfa9766dfd",
"name": "Store Abstract Notion",
"type": "n8n-nodes-base.notion",
"position": [
-300,
-300
],
"parameters": {
"options": {},
"resource": "databasePage",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b67aba-1fcc-80ae-baa1-d88ffda7ae83",
"cachedResultUrl": "https://www.notion.so/17b67aba1fcc80aebaa1d88ffda7ae83",
"cachedResultName": "huggingface-abstract"
},
"propertiesUi": {
"propertyValues": [
{
"key": "URL|url",
"urlValue": "={{ 'https://huggingface.co'+$('Split Out').item.json.url }}"
},
{
"key": "title|title",
"title": "={{ $('Extract Hugging Face Paper Abstract').item.json.title }}"
},
{
"key": "abstract|rich_text",
"textContent": "={{ $('Extract Hugging Face Paper Abstract').item.json.abstract.substring(0,2000) }}"
},
{
"key": "scrap-date|date",
"date": "={{ $today.format('yyyy-MM-dd') }}",
"includeTime": false
},
{
"key": "Classification|rich_text",
"textContent": "={{ $json.message.content.Classification.join(',') }}"
},
{
"key": "Technical_Details|rich_text",
"textContent": "={{ $json.message.content.Technical_Details }}"
},
{
"key": "Data_and_Results|rich_text",
"textContent": "={{ $json.message.content.Data_and_Results }}"
},
{
"key": "keywords|rich_text",
"textContent": "={{ $json.message.content.Keywords.join(',') }}"
},
{
"key": "Core Introduction|rich_text",
"textContent": "={{ $json.message.content.Core_Introduction }}"
}
]
}
},
"credentials": {
"notionApi": {
"id": "I5KdUzwhWnphQ862",
"name": "notion"
}
},
"typeVersion": 2.2
},
{
"id": "d5816a1c-d1fa-4be2-8088-57fbf68e6b43",
"name": "Extract Hugging Face Paper Abstract",
"type": "n8n-nodes-base.html",
"position": [
-840,
-300
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "abstract",
"cssSelector": ".text-gray-700"
},
{
"key": "title",
"cssSelector": ".text-2xl"
}
]
}
},
"typeVersion": 1.2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4b0ec2a3-253d-46d5-a4d4-1d9ff21ba4a3",
"connections": {
"If": {
"main": [
[
{
"node": "Request Hugging Face Paper Detail",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Check Paper URL Existed",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Request Hugging Face Paper",
"type": "main",
"index": 0
}
]
]
},
"Store Abstract Notion": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Check Paper URL Existed": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Analysis Abstract": {
"main": [
[
{
"node": "Store Abstract Notion",
"type": "main",
"index": 0
}
]
]
},
"Extract Hugging Face Paper": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Request Hugging Face Paper": {
"main": [
[
{
"node": "Extract Hugging Face Paper",
"type": "main",
"index": 0
}
]
]
},
"Request Hugging Face Paper Detail": {
"main": [
[
{
"node": "Extract Hugging Face Paper Abstract",
"type": "main",
"index": 0
}
]
]
},
"Extract Hugging Face Paper Abstract": {
"main": [
[
{
"node": "OpenAI Analysis Abstract",
"type": "main",
"index": 0
}
]
]
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,362 +0,0 @@
{
"id": "mb2MU4xOaT3NrvqN",
"meta": {
"instanceId": "e7a28cc5c8c9de1976820e0f309940cf456344d9daf5360a4975186f3d8a107f",
"templateCredsSetupCompleted": true
},
"name": "Automate LinkedIn Posts with AI",
"tags": [],
"nodes": [
{
"id": "7e8ec5cc-0216-4897-8a40-c44f9bbe5a9b",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
580,
540
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 15
}
]
}
},
"typeVersion": 1.2
},
{
"id": "dbde804d-9c84-4023-9e05-7506cd38a460",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
225.26841303066982
],
"parameters": {
"color": 6,
"width": 652.1201853643956,
"height": 542.0867486896091,
"content": "## Fetch the day's post from my Notion database\nA Notion _\"database\"_ is just a table on a Notion Page.\nThis table will have various rows, for which a minimum of three columns are required:\n- Name\n- Status\n- Date\n\nThe Date column is the most important, which will dictate when that row from your Notion table containing the text should be posted.\n\nNOTE: each post is required to have a copy and pasted image!"
},
"typeVersion": 1
},
{
"id": "95205e81-e28d-48f9-b3fb-bcf361f7799e",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1520,
220
],
"parameters": {
"width": 860.9829802912225,
"height": 540.7357881640437,
"content": "## Format Post\nSend the post to OpenAI, where it will attempt to ask your assistant how to take the incoming blob of text, and soup it up into something more palpable for LinkedIn engagement."
},
"typeVersion": 1
},
{
"id": "4bc2a550-a8ad-4b25-ac53-01413277e068",
"name": "Set post status to \"Done\"",
"type": "n8n-nodes-base.notion",
"position": [
2760,
540
],
"parameters": {
"pageId": {
"__rl": true,
"mode": "url",
"value": "={{ $('query entries from Notion table for today').item.json.url }}"
},
"options": {},
"resource": "databasePage",
"operation": "update",
"propertiesUi": {
"propertyValues": [
{
"key": "Status|status",
"statusValue": "Done"
}
]
}
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
},
{
"id": "31116f06-72ca-4219-9575-8efaefbff24b",
"name": "Post on LinkedIn",
"type": "n8n-nodes-base.linkedIn",
"position": [
2500,
540
],
"parameters": {
"text": "={{ $json.output }}",
"person": "_RmSSZc0jB",
"additionalFields": {},
"shareMediaCategory": "IMAGE"
},
"credentials": {
"linkedInOAuth2Api": {
"id": "fozSa4dLS6Jgbn4e",
"name": "LinkedIn account 2"
}
},
"typeVersion": 1
},
{
"id": "1bf0540d-a180-457a-a7d7-fb74c8119a52",
"name": "Combine text+image",
"type": "n8n-nodes-base.merge",
"position": [
2100,
540
],
"parameters": {
"mode": "combine",
"options": {},
"combinationMode": "mergeByPosition"
},
"typeVersion": 2.1
},
{
"id": "f1fdf6f7-a75c-451b-8bce-ea581b4b6197",
"name": "Fetch image from post",
"type": "n8n-nodes-base.httpRequest",
"position": [
1640,
620
],
"parameters": {
"url": "={{ $json.url[0] }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "00e2bbcb-bac0-4a7e-9892-59f41a26ce9d",
"name": "Reformat Post Text",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1620,
440
],
"parameters": {
"text": "=Thank you kindly for your help, please refer to the following LinkedIn post, and output a reformatted version employing thoroughly thought-out paragraph breaks, and lists if present:\n```\n{{ $json.content.join(\" \") }}\n```",
"prompt": "define",
"options": {},
"resource": "assistant",
"assistantId": {
"__rl": true,
"mode": "list",
"value": "asst_J1KuOx5wTLrjEHuy5q94jEgh",
"cachedResultName": "LinkedIn Post Reviewer"
}
},
"credentials": {
"openAiApi": {
"id": "Gxn0kNMCREcTNGcB",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.3
},
{
"id": "119d7fc7-ed62-4a73-916e-8baf19ab1d86",
"name": "get all content from post page",
"type": "n8n-nodes-base.notion",
"position": [
1020,
540
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
},
{
"id": "461d4dd2-a91a-4219-bd20-6dd3398d4274",
"name": "Pull together all text blocks + image",
"type": "n8n-nodes-base.aggregate",
"position": [
1240,
540
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "content"
},
{
"fieldToAggregate": "image.file.url"
}
]
}
},
"typeVersion": 1
},
{
"id": "72052eec-c180-4da5-ba15-1a69a7ce6892",
"name": "query entries from Notion table for today",
"type": "n8n-nodes-base.notion",
"position": [
800,
540
],
"parameters": {
"filters": {
"conditions": [
{
"key": "Date|date",
"date": "={{ $today.format(\"yyyy/mM/dd\") }}",
"condition": "equals"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "9aba7f55-a7de-4329-9d5b-6d127937fa49",
"cachedResultUrl": "https://www.notion.so/9aba7f55a7de43299d5b6d127937fa49",
"cachedResultName": "LinkedIn Posts example"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "35f9b7b6-0e60-495f-826d-af7040e7de1f",
"connections": {
"Post on LinkedIn": {
"main": [
[
{
"node": "Set post status to \"Done\"",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "query entries from Notion table for today",
"type": "main",
"index": 0
}
]
]
},
"Combine text+image": {
"main": [
[
{
"node": "Post on LinkedIn",
"type": "main",
"index": 0
}
]
]
},
"Reformat Post Text": {
"main": [
[
{
"node": "Combine text+image",
"type": "main",
"index": 0
}
]
]
},
"Fetch image from post": {
"main": [
[
{
"node": "Combine text+image",
"type": "main",
"index": 1
}
]
]
},
"get all content from post page": {
"main": [
[
{
"node": "Pull together all text blocks + image",
"type": "main",
"index": 0
}
]
]
},
"Pull together all text blocks + image": {
"main": [
[
{
"node": "Fetch image from post",
"type": "main",
"index": 0
},
{
"node": "Reformat Post Text",
"type": "main",
"index": 0
}
]
]
},
"query entries from Notion table for today": {
"main": [
[
{
"node": "get all content from post page",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,362 @@
{
"id": "mb2MU4xOaT3NrvqN",
"meta": {
"instanceId": "e7a28cc5c8c9de1976820e0f309940cf456344d9daf5360a4975186f3d8a107f",
"templateCredsSetupCompleted": true
},
"name": "Automate LinkedIn Posts with AI",
"tags": [],
"nodes": [
{
"id": "7e8ec5cc-0216-4897-8a40-c44f9bbe5a9b",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
580,
540
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 15
}
]
}
},
"typeVersion": 1.2
},
{
"id": "dbde804d-9c84-4023-9e05-7506cd38a460",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
760,
225.26841303066982
],
"parameters": {
"color": 6,
"width": 652.1201853643956,
"height": 542.0867486896091,
"content": "## Fetch the day's post from my Notion database\nA Notion _\"database\"_ is just a table on a Notion Page.\nThis table will have various rows, for which a minimum of three columns are required:\n- Name\n- Status\n- Date\n\nThe Date column is the most important, which will dictate when that row from your Notion table containing the text should be posted.\n\nNOTE: each post is required to have a copy and pasted image!"
},
"typeVersion": 1
},
{
"id": "95205e81-e28d-48f9-b3fb-bcf361f7799e",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
1520,
220
],
"parameters": {
"width": 860.9829802912225,
"height": 540.7357881640437,
"content": "## Format Post\nSend the post to OpenAI, where it will attempt to ask your assistant how to take the incoming blob of text, and soup it up into something more palpable for LinkedIn engagement."
},
"typeVersion": 1
},
{
"id": "4bc2a550-a8ad-4b25-ac53-01413277e068",
"name": "Set post status to \"Done\"",
"type": "n8n-nodes-base.notion",
"position": [
2760,
540
],
"parameters": {
"pageId": {
"__rl": true,
"mode": "url",
"value": "={{ $('query entries from Notion table for today').item.json.url }}"
},
"options": {},
"resource": "databasePage",
"operation": "update",
"propertiesUi": {
"propertyValues": [
{
"key": "Status|status",
"statusValue": "Done"
}
]
}
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
},
{
"id": "31116f06-72ca-4219-9575-8efaefbff24b",
"name": "Post on LinkedIn",
"type": "n8n-nodes-base.linkedIn",
"position": [
2500,
540
],
"parameters": {
"text": "={{ $json.output }}",
"person": "_RmSSZc0jB",
"additionalFields": {},
"shareMediaCategory": "IMAGE"
},
"credentials": {
"linkedInOAuth2Api": {
"id": "fozSa4dLS6Jgbn4e",
"name": "LinkedIn account 2"
}
},
"typeVersion": 1
},
{
"id": "1bf0540d-a180-457a-a7d7-fb74c8119a52",
"name": "Combine text+image",
"type": "n8n-nodes-base.merge",
"position": [
2100,
540
],
"parameters": {
"mode": "combine",
"options": {},
"combinationMode": "mergeByPosition"
},
"typeVersion": 2.1
},
{
"id": "f1fdf6f7-a75c-451b-8bce-ea581b4b6197",
"name": "Fetch image from post",
"type": "n8n-nodes-base.httpRequest",
"position": [
1640,
620
],
"parameters": {
"url": "={{ $json.url[0] }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "00e2bbcb-bac0-4a7e-9892-59f41a26ce9d",
"name": "Reformat Post Text",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1620,
440
],
"parameters": {
"text": "=Thank you kindly for your help, please refer to the following LinkedIn post, and output a reformatted version employing thoroughly thought-out paragraph breaks, and lists if present:\n```\n{{ $json.content.join(\" \") }}\n```",
"prompt": "define",
"options": {},
"resource": "assistant",
"assistantId": {
"__rl": true,
"mode": "list",
"value": "asst_J1KuOx5wTLrjEHuy5q94jEgh",
"cachedResultName": "LinkedIn Post Reviewer"
}
},
"credentials": {
"openAiApi": {
"id": "Gxn0kNMCREcTNGcB",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.3
},
{
"id": "119d7fc7-ed62-4a73-916e-8baf19ab1d86",
"name": "get all content from post page",
"type": "n8n-nodes-base.notion",
"position": [
1020,
540
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
},
{
"id": "461d4dd2-a91a-4219-bd20-6dd3398d4274",
"name": "Pull together all text blocks + image",
"type": "n8n-nodes-base.aggregate",
"position": [
1240,
540
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "content"
},
{
"fieldToAggregate": "image.file.url"
}
]
}
},
"typeVersion": 1
},
{
"id": "72052eec-c180-4da5-ba15-1a69a7ce6892",
"name": "query entries from Notion table for today",
"type": "n8n-nodes-base.notion",
"position": [
800,
540
],
"parameters": {
"filters": {
"conditions": [
{
"key": "Date|date",
"date": "={{ $today.format(\"yyyy/mM/dd\") }}",
"condition": "equals"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "9aba7f55-a7de-4329-9d5b-6d127937fa49",
"cachedResultUrl": "https://www.notion.so/9aba7f55a7de43299d5b6d127937fa49",
"cachedResultName": "LinkedIn Posts example"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "nBu4zRArkldtNypO",
"name": "Notion account"
}
},
"typeVersion": 2.2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "35f9b7b6-0e60-495f-826d-af7040e7de1f",
"connections": {
"Post on LinkedIn": {
"main": [
[
{
"node": "Set post status to \"Done\"",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "query entries from Notion table for today",
"type": "main",
"index": 0
}
]
]
},
"Combine text+image": {
"main": [
[
{
"node": "Post on LinkedIn",
"type": "main",
"index": 0
}
]
]
},
"Reformat Post Text": {
"main": [
[
{
"node": "Combine text+image",
"type": "main",
"index": 0
}
]
]
},
"Fetch image from post": {
"main": [
[
{
"node": "Combine text+image",
"type": "main",
"index": 1
}
]
]
},
"get all content from post page": {
"main": [
[
{
"node": "Pull together all text blocks + image",
"type": "main",
"index": 0
}
]
]
},
"Pull together all text blocks + image": {
"main": [
[
{
"node": "Fetch image from post",
"type": "main",
"index": 0
},
{
"node": "Reformat Post Text",
"type": "main",
"index": 0
}
]
]
},
"query entries from Notion table for today": {
"main": [
[
{
"node": "get all content from post page",
"type": "main",
"index": 0
}
]
]
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,377 +0,0 @@
{
"meta": {
"instanceId": "205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa"
},
"nodes": [
{
"id": "d1d4291e-fa37-43d0-81e0-f0a594371426",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
680,
620
],
"parameters": {
"model": "gpt-4o",
"options": {
"timeout": 25000,
"temperature": 0.7
}
},
"credentials": {
"openAiApi": {
"id": "AzPPV759YPBxJj3o",
"name": "Max's DevRel OpenAI account"
}
},
"typeVersion": 1
},
{
"id": "68e6805b-9c19-4c9e-a300-8983f2b7c28a",
"name": "Search notion database",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
980,
620
],
"parameters": {
"url": "=https://api.notion.com/v1/databases/{{ $json.notionID }}/query",
"method": "POST",
"jsonBody": "{\n \"filter\": {\n \"or\": [\n {\n \"property\": \"question\",\n \"rich_text\": {\n \"contains\": \"{keyword}\"\n }\n },\n {\n \"property\": \"tags\",\n \"multi_select\": {\n \"contains\": \"{tag}\"\n }\n }\n ]\n },\n \"sorts\": [\n {\n \"property\": \"updated_at\",\n \"direction\": \"ascending\"\n }\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "=Use this tool to search the \"\" Notion app database.\n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n",
"nodeCredentialType": "notionApi",
"placeholderDefinitions": {
"values": [
{
"name": "keyword",
"description": "Searches question of the record. Use one keyword at a time."
},
{
"name": "tag",
"description": "=Options: {{ $json.tagsOptions }}"
}
]
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"typeVersion": 1.1
},
{
"id": "c3164d38-a9fb-4ee3-b6bd-fccb4aa5a1a4",
"name": "Get database details",
"type": "n8n-nodes-base.notion",
"position": [
420,
380
],
"parameters": {
"simple": false,
"resource": "database",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "7ea9697d-4875-441e-b262-1105337d232e",
"cachedResultUrl": "https://www.notion.so/7ea9697d4875441eb2621105337d232e",
"cachedResultName": "StarLens Company Knowledge Base"
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"typeVersion": 2.2
},
{
"id": "98300243-efcc-4427-88da-c1af8a91ddae",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
820,
620
],
"parameters": {
"contextWindowLength": 4
},
"typeVersion": 1.2
},
{
"id": "a8473f48-1343-4eb2-8e48-ec89377a2a00",
"name": "Search inside database record",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"notes": " ",
"position": [
1140,
620
],
"parameters": {
"url": "https://api.notion.com/v1/blocks/{page_id}/children",
"fields": "id, type, paragraph.text, heading_1.text, heading_2.text, heading_3.text, bulleted_list_item.text, numbered_list_item.text, to_do.text, children",
"dataField": "results",
"authentication": "predefinedCredentialType",
"fieldsToInclude": "selected",
"toolDescription": "=Use this tool to retrieve Notion page content using the page ID. \n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n",
"optimizeResponse": true,
"nodeCredentialType": "notionApi",
"placeholderDefinitions": {
"values": [
{
"name": "page_id",
"description": "Notion page id from 'Search notion database' tool results"
}
]
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "115c328e-84b0-43d2-8df7-8b3f74cbb2fb",
"name": "Format schema",
"type": "n8n-nodes-base.set",
"position": [
620,
380
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a8e58791-ba51-46a2-8645-386dd1a0ff6e",
"name": "sessionId",
"type": "string",
"value": "={{ $('When chat message received').item.json.sessionId }}"
},
{
"id": "434209de-39d5-43d8-a964-0fcb7396306c",
"name": "action",
"type": "string",
"value": "={{ $('When chat message received').item.json.action }}"
},
{
"id": "cad4c972-51a9-4e16-a627-b00eea77eb30",
"name": "chatInput",
"type": "string",
"value": "={{ $('When chat message received').item.json.chatInput }}"
},
{
"id": "8e88876c-2714-494d-bd5e-5e80c99f83e3",
"name": "notionID",
"type": "string",
"value": "={{ $('Get database details').item.json.id }}"
},
{
"id": "a88a15f6-317c-4d2e-9d64-26f5ccaf7a97",
"name": "databaseName",
"type": "string",
"value": "={{ $json.title[0].text.content }}"
},
{
"id": "7c3bf758-8ed3-469a-8695-6777f4af4fb9",
"name": "tagsOptions",
"type": "string",
"value": "={{ $json.properties.tags.multi_select.options.map(item => item.name).join(',') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "3b82f4fe-6c0c-4e6e-a387-27de31fec758",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
240
],
"parameters": {
"color": 6,
"width": 462.3561535890252,
"height": 95.12709218477178,
"content": "## Notion knowledge base assistant [v1]\nBuilt as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@maxtkacz](https://x.com/maxtkacz)\n"
},
"typeVersion": 1
},
{
"id": "31debc55-6608-4e64-be18-1bc0fc0fbf16",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
1060
],
"parameters": {
"color": 7,
"width": 462.3561535890252,
"height": 172.4760209818479,
"content": "### FAQ\n- In `Get database details` if you see a `The resource you are requesting could not be found` error, you need to add your connection to the database (in the Notion app).\n- The `Get database details` pulls most recent `Tags` and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step. "
},
"typeVersion": 1
},
{
"id": "9f48e548-f032-477c-960d-9c99d61443df",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
820,
380
],
"parameters": {
"text": "={{ $json.chatInput }}",
"options": {
"systemMessage": "=# Role:\nYou are a helpful agent. Query the \"{{ $json.databaseName }}\" Notion database to find relevant records or summarize insights based on multiple records.\n\n# Behavior:\n\nBe clear, very concise, efficient, and accurate in responses. Do not hallucinate.\nIf the request is ambiguous, ask for clarification. Do not embellish, only use facts from the Notion records. Do not offer general advice.\n\n# Error Handling:\n\nIf no matching records are found, try alternative search criteria. Example 1: Laptop, then Computer, then Equipment. Example 2: meetings, then meeting.\nClearly explain any issues with queries (e.g., missing fields or unsupported filters).\n\n# Output:\n\nReturn concise, user-friendly results or summaries.\nFor large sets, show top results by default and offer more if needed. Output URLs in markdown format. \n\nWhen a record has the answer to user question, always output the URL to that page. Do not output links twice."
},
"promptType": "define"
},
"typeVersion": 1.6
},
{
"id": "f1274a12-128c-4549-a19b-6bfc3beccd89",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
220,
380
],
"webhookId": "b76d02c0-b406-4d21-b6bf-8ad2c623def3",
"parameters": {
"public": true,
"options": {
"title": "Notion Knowledge Base",
"subtitle": ""
},
"initialMessages": "=Happy {{ $today.weekdayLong }}!\nKnowledge source assistant at your service. How can I help you?"
},
"typeVersion": 1.1
},
{
"id": "2e25e4bc-7970-4d00-a757-ba1e418873aa",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
360
],
"parameters": {
"color": 7,
"width": 463.90418399676537,
"height": 318.2958135288425,
"content": "### Template set up quickstart video 👇\n[![Video Thumbnail](https://uploads.n8n.io/maxt/notion-db-assistant-embedded-thumb.png#full-width)](https://www.youtube.com/watch?v=ynLZwS2Nhnc)\n"
},
"typeVersion": 1
},
{
"id": "ba6fe953-fd5c-497f-ac2a-7afa04b7e6cc",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
700
],
"parameters": {
"color": 7,
"width": 461.5634274842711,
"height": 332.14098134070576,
"content": "### Written set up steps\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\n2. [Duplicate Company knowledge base Notion template](https://www.notion.so/templates/knowledge-base-ai-assistant-with-n8n) to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1. \n3. Add Notion cred to `Get database details`:`Credential to connect with` parameter, then to `Search notion database`:`Notion API` parameter (same for `Search inside database record`)\n4. Add OpenAI credential to `Open AI Chat Model` node (tested and working with Anthropic Claude 3.5 too)\n5. In `Get database details`, select the db you created from Step 2 in `Database` dropdown.\n6. Click `Chat` button to test the workflow. Then Activate it and copy the `Chat URL` from `When chat message received`."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Format schema": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get database details": {
"main": [
[
{
"node": "Format schema",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Search notion database": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Get database details",
"type": "main",
"index": 0
}
]
]
},
"Search inside database record": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,377 @@
{
"meta": {
"instanceId": "205b3bc06c96f2dc835b4f00e1cbf9a937a74eeb3b47c99d0c30b0586dbf85aa"
},
"nodes": [
{
"id": "d1d4291e-fa37-43d0-81e0-f0a594371426",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
680,
620
],
"parameters": {
"model": "gpt-4o",
"options": {
"timeout": 25000,
"temperature": 0.7
}
},
"credentials": {
"openAiApi": {
"id": "AzPPV759YPBxJj3o",
"name": "Max's DevRel OpenAI account"
}
},
"typeVersion": 1
},
{
"id": "68e6805b-9c19-4c9e-a300-8983f2b7c28a",
"name": "Search notion database",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
980,
620
],
"parameters": {
"url": "=https://api.notion.com/v1/databases/{{ $json.notionID }}/query",
"method": "POST",
"jsonBody": "{\n \"filter\": {\n \"or\": [\n {\n \"property\": \"question\",\n \"rich_text\": {\n \"contains\": \"{keyword}\"\n }\n },\n {\n \"property\": \"tags\",\n \"multi_select\": {\n \"contains\": \"{tag}\"\n }\n }\n ]\n },\n \"sorts\": [\n {\n \"property\": \"updated_at\",\n \"direction\": \"ascending\"\n }\n ]\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"toolDescription": "=Use this tool to search the \"\" Notion app database.\n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n",
"nodeCredentialType": "notionApi",
"placeholderDefinitions": {
"values": [
{
"name": "keyword",
"description": "Searches question of the record. Use one keyword at a time."
},
{
"name": "tag",
"description": "=Options: {{ $json.tagsOptions }}"
}
]
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"typeVersion": 1.1
},
{
"id": "c3164d38-a9fb-4ee3-b6bd-fccb4aa5a1a4",
"name": "Get database details",
"type": "n8n-nodes-base.notion",
"position": [
420,
380
],
"parameters": {
"simple": false,
"resource": "database",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "7ea9697d-4875-441e-b262-1105337d232e",
"cachedResultUrl": "https://www.notion.so/7ea9697d4875441eb2621105337d232e",
"cachedResultName": "StarLens Company Knowledge Base"
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"typeVersion": 2.2
},
{
"id": "98300243-efcc-4427-88da-c1af8a91ddae",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
820,
620
],
"parameters": {
"contextWindowLength": 4
},
"typeVersion": 1.2
},
{
"id": "a8473f48-1343-4eb2-8e48-ec89377a2a00",
"name": "Search inside database record",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"notes": " ",
"position": [
1140,
620
],
"parameters": {
"url": "https://api.notion.com/v1/blocks/{page_id}/children",
"fields": "id, type, paragraph.text, heading_1.text, heading_2.text, heading_3.text, bulleted_list_item.text, numbered_list_item.text, to_do.text, children",
"dataField": "results",
"authentication": "predefinedCredentialType",
"fieldsToInclude": "selected",
"toolDescription": "=Use this tool to retrieve Notion page content using the page ID. \n\nIt is structured with question and answer format. \nYou can filter query result by:\n- By keyword\n- filter by tag.\n\nKeyword and Tag have an OR relationship not AND.\n\n",
"optimizeResponse": true,
"nodeCredentialType": "notionApi",
"placeholderDefinitions": {
"values": [
{
"name": "page_id",
"description": "Notion page id from 'Search notion database' tool results"
}
]
}
},
"credentials": {
"notionApi": {
"id": "gfNp6Jup8rsmFLRr",
"name": "max-bot"
}
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "115c328e-84b0-43d2-8df7-8b3f74cbb2fb",
"name": "Format schema",
"type": "n8n-nodes-base.set",
"position": [
620,
380
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a8e58791-ba51-46a2-8645-386dd1a0ff6e",
"name": "sessionId",
"type": "string",
"value": "={{ $('When chat message received').item.json.sessionId }}"
},
{
"id": "434209de-39d5-43d8-a964-0fcb7396306c",
"name": "action",
"type": "string",
"value": "={{ $('When chat message received').item.json.action }}"
},
{
"id": "cad4c972-51a9-4e16-a627-b00eea77eb30",
"name": "chatInput",
"type": "string",
"value": "={{ $('When chat message received').item.json.chatInput }}"
},
{
"id": "8e88876c-2714-494d-bd5e-5e80c99f83e3",
"name": "notionID",
"type": "string",
"value": "={{ $('Get database details').item.json.id }}"
},
{
"id": "a88a15f6-317c-4d2e-9d64-26f5ccaf7a97",
"name": "databaseName",
"type": "string",
"value": "={{ $json.title[0].text.content }}"
},
{
"id": "7c3bf758-8ed3-469a-8695-6777f4af4fb9",
"name": "tagsOptions",
"type": "string",
"value": "={{ $json.properties.tags.multi_select.options.map(item => item.name).join(',') }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "3b82f4fe-6c0c-4e6e-a387-27de31fec758",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
240
],
"parameters": {
"color": 6,
"width": 462.3561535890252,
"height": 95.12709218477178,
"content": "## Notion knowledge base assistant [v1]\nBuilt as part of the [30 Day AI Sprint](https://30dayaisprint.notion.site/) by [@maxtkacz](https://x.com/maxtkacz)\n"
},
"typeVersion": 1
},
{
"id": "31debc55-6608-4e64-be18-1bc0fc0fbf16",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
1060
],
"parameters": {
"color": 7,
"width": 462.3561535890252,
"height": 172.4760209818479,
"content": "### FAQ\n- In `Get database details` if you see a `The resource you are requesting could not be found` error, you need to add your connection to the database (in the Notion app).\n- The `Get database details` pulls most recent `Tags` and informs AI Agent of them. However this step adds ~250-800ms per run. Watch detailed video to see how to remove this step. "
},
"typeVersion": 1
},
{
"id": "9f48e548-f032-477c-960d-9c99d61443df",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
820,
380
],
"parameters": {
"text": "={{ $json.chatInput }}",
"options": {
"systemMessage": "=# Role:\nYou are a helpful agent. Query the \"{{ $json.databaseName }}\" Notion database to find relevant records or summarize insights based on multiple records.\n\n# Behavior:\n\nBe clear, very concise, efficient, and accurate in responses. Do not hallucinate.\nIf the request is ambiguous, ask for clarification. Do not embellish, only use facts from the Notion records. Do not offer general advice.\n\n# Error Handling:\n\nIf no matching records are found, try alternative search criteria. Example 1: Laptop, then Computer, then Equipment. Example 2: meetings, then meeting.\nClearly explain any issues with queries (e.g., missing fields or unsupported filters).\n\n# Output:\n\nReturn concise, user-friendly results or summaries.\nFor large sets, show top results by default and offer more if needed. Output URLs in markdown format. \n\nWhen a record has the answer to user question, always output the URL to that page. Do not output links twice."
},
"promptType": "define"
},
"typeVersion": 1.6
},
{
"id": "f1274a12-128c-4549-a19b-6bfc3beccd89",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
220,
380
],
"webhookId": "b76d02c0-b406-4d21-b6bf-8ad2c623def3",
"parameters": {
"public": true,
"options": {
"title": "Notion Knowledge Base",
"subtitle": ""
},
"initialMessages": "=Happy {{ $today.weekdayLong }}!\nKnowledge source assistant at your service. How can I help you?"
},
"typeVersion": 1.1
},
{
"id": "2e25e4bc-7970-4d00-a757-ba1e418873aa",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
360
],
"parameters": {
"color": 7,
"width": 463.90418399676537,
"height": 318.2958135288425,
"content": "### Template set up quickstart video 👇\n[![Video Thumbnail](https://uploads.n8n.io/maxt/notion-db-assistant-embedded-thumb.png#full-width)](https://www.youtube.com/watch?v=ynLZwS2Nhnc)\n"
},
"typeVersion": 1
},
{
"id": "ba6fe953-fd5c-497f-ac2a-7afa04b7e6cc",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
700
],
"parameters": {
"color": 7,
"width": 461.5634274842711,
"height": 332.14098134070576,
"content": "### Written set up steps\n1. Add a Notion credential to your n8n workspace (follow [this Notion guide](https://developers.notion.com/docs/create-a-notion-integration))\n2. [Duplicate Company knowledge base Notion template](https://www.notion.so/templates/knowledge-base-ai-assistant-with-n8n) to your Notion workspace, then make sure to share the new knowledge base with connection you created in Step 1. \n3. Add Notion cred to `Get database details`:`Credential to connect with` parameter, then to `Search notion database`:`Notion API` parameter (same for `Search inside database record`)\n4. Add OpenAI credential to `Open AI Chat Model` node (tested and working with Anthropic Claude 3.5 too)\n5. In `Get database details`, select the db you created from Step 2 in `Database` dropdown.\n6. Click `Chat` button to test the workflow. Then Activate it and copy the `Chat URL` from `When chat message received`."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Format schema": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get database details": {
"main": [
[
{
"node": "Format schema",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Search notion database": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Get database details",
"type": "main",
"index": 0
}
]
]
},
"Search inside database record": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}

View File

@@ -1,319 +0,0 @@
{
"id": "vOSQYz747gtzj1zF",
"meta": {
"instanceId": "d16fb7d4b3eb9b9d4ad2ee6a7fbae593d73e9715e51f583c2a0e9acd1781c08e",
"templateId": "2290"
},
"name": "Prod: Notion to Vector Store - Dimension 768",
"tags": [
{
"id": "Vs70y1mj5s2XzUap",
"name": "Production",
"createdAt": "2024-12-24T14:42:00.549Z",
"updatedAt": "2024-12-24T14:42:00.549Z"
}
],
"nodes": [
{
"id": "6d2579b8-376f-44c3-82e8-9dc608efd98b",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2200,
800
],
"parameters": {
"chunkSize": 256,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "79b3c147-08ca-4db4-9116-958a868cbfd9",
"name": "Notion - Page Added Trigger",
"type": "n8n-nodes-base.notionTrigger",
"position": [
1080,
360
],
"parameters": {
"simple": false,
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b11930-c10f-8000-a545-ece7cade03f9",
"cachedResultUrl": "https://www.notion.so/17b11930c10f8000a545ece7cade03f9",
"cachedResultName": "Embeddings"
}
},
"credentials": {
"notionApi": {
"id": "oktwaKqpFztx5hYX",
"name": "Auto: Notion"
}
},
"typeVersion": 1
},
{
"id": "e4a6f524-e3f5-4d02-949a-8523f2d21965",
"name": "Notion - Retrieve Page Content",
"type": "n8n-nodes-base.notion",
"position": [
1300,
360
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"notionApi": {
"id": "oktwaKqpFztx5hYX",
"name": "Auto: Notion"
}
},
"typeVersion": 2.2
},
{
"id": "bfebc173-8d4b-4f8f-a625-4622949dd545",
"name": "Filter Non-Text Content",
"type": "n8n-nodes-base.filter",
"position": [
1520,
360
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e5b605e5-6d05-4bca-8f19-a859e474620f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "image"
},
{
"id": "c7415859-5ffd-4c78-b497-91a3d6303b6f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "video"
}
]
}
},
"typeVersion": 2
},
{
"id": "b04939f9-355a-430b-a069-b11800066313",
"name": "Summarize - Concatenate Notion's blocks content",
"type": "n8n-nodes-base.summarize",
"position": [
1780,
360
],
"parameters": {
"options": {
"outputFormat": "separateItems"
},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
},
{
"id": "0e64dbb5-20c1-4b90-b818-a1726aaf5112",
"name": "Create metadata and load content",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2180,
600
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "pageId",
"value": "={{ $('Notion - Page Added Trigger').item.json.id }}"
},
{
"name": "createdTime",
"value": "={{ $('Notion - Page Added Trigger').item.json.created_time }}"
},
{
"name": "pageTitle",
"value": "={{ $('Notion - Page Added Trigger').item.json.properties.Name.title[0].text.content }}"
}
]
}
},
"jsonData": "={{ $json.concatenated_content }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "1f93c3e6-2d53-46b4-9ce9-1350e660ba82",
"name": "Embeddings Google Gemini",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
1940,
580
],
"parameters": {
"modelName": "models/text-embedding-004"
},
"credentials": {
"googlePalmApi": {
"id": "9idxGZRZ3BAKDoxq",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "b804b3fc-161c-40c1-ad9c-3022a09c4a0a",
"name": "Pinecone Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
2060,
360
],
"parameters": {
"mode": "insert",
"options": {},
"pineconeIndex": {
"__rl": true,
"mode": "list",
"value": "notion-pages",
"cachedResultName": "notion-pages"
}
},
"credentials": {
"pineconeApi": {
"id": "R3QGXSEIRTEAZttK",
"name": "Auto: PineconeApi"
}
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "245f016a-7538-4f45-94f0-d8b7e5c9c891",
"connections": {
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Create metadata and load content",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Filter Non-Text Content": {
"main": [
[
{
"node": "Summarize - Concatenate Notion's blocks content",
"type": "main",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Notion - Page Added Trigger": {
"main": [
[
{
"node": "Notion - Retrieve Page Content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Retrieve Page Content": {
"main": [
[
{
"node": "Filter Non-Text Content",
"type": "main",
"index": 0
}
]
]
},
"Create metadata and load content": {
"ai_document": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Summarize - Concatenate Notion's blocks content": {
"main": [
[
{
"node": "Pinecone Vector Store",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,319 @@
{
"id": "vOSQYz747gtzj1zF",
"meta": {
"instanceId": "d16fb7d4b3eb9b9d4ad2ee6a7fbae593d73e9715e51f583c2a0e9acd1781c08e",
"templateId": "2290"
},
"name": "Prod: Notion to Vector Store - Dimension 768",
"tags": [
{
"id": "Vs70y1mj5s2XzUap",
"name": "Production",
"createdAt": "2024-12-24T14:42:00.549Z",
"updatedAt": "2024-12-24T14:42:00.549Z"
}
],
"nodes": [
{
"id": "6d2579b8-376f-44c3-82e8-9dc608efd98b",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2200,
800
],
"parameters": {
"chunkSize": 256,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "79b3c147-08ca-4db4-9116-958a868cbfd9",
"name": "Notion - Page Added Trigger",
"type": "n8n-nodes-base.notionTrigger",
"position": [
1080,
360
],
"parameters": {
"simple": false,
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "17b11930-c10f-8000-a545-ece7cade03f9",
"cachedResultUrl": "https://www.notion.so/17b11930c10f8000a545ece7cade03f9",
"cachedResultName": "Embeddings"
}
},
"credentials": {
"notionApi": {
"id": "oktwaKqpFztx5hYX",
"name": "Auto: Notion"
}
},
"typeVersion": 1
},
{
"id": "e4a6f524-e3f5-4d02-949a-8523f2d21965",
"name": "Notion - Retrieve Page Content",
"type": "n8n-nodes-base.notion",
"position": [
1300,
360
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"notionApi": {
"id": "oktwaKqpFztx5hYX",
"name": "Auto: Notion"
}
},
"typeVersion": 2.2
},
{
"id": "bfebc173-8d4b-4f8f-a625-4622949dd545",
"name": "Filter Non-Text Content",
"type": "n8n-nodes-base.filter",
"position": [
1520,
360
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e5b605e5-6d05-4bca-8f19-a859e474620f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "image"
},
{
"id": "c7415859-5ffd-4c78-b497-91a3d6303b6f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "video"
}
]
}
},
"typeVersion": 2
},
{
"id": "b04939f9-355a-430b-a069-b11800066313",
"name": "Summarize - Concatenate Notion's blocks content",
"type": "n8n-nodes-base.summarize",
"position": [
1780,
360
],
"parameters": {
"options": {
"outputFormat": "separateItems"
},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
},
{
"id": "0e64dbb5-20c1-4b90-b818-a1726aaf5112",
"name": "Create metadata and load content",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2180,
600
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "pageId",
"value": "={{ $('Notion - Page Added Trigger').item.json.id }}"
},
{
"name": "createdTime",
"value": "={{ $('Notion - Page Added Trigger').item.json.created_time }}"
},
{
"name": "pageTitle",
"value": "={{ $('Notion - Page Added Trigger').item.json.properties.Name.title[0].text.content }}"
}
]
}
},
"jsonData": "={{ $json.concatenated_content }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "1f93c3e6-2d53-46b4-9ce9-1350e660ba82",
"name": "Embeddings Google Gemini",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
1940,
580
],
"parameters": {
"modelName": "models/text-embedding-004"
},
"credentials": {
"googlePalmApi": {
"id": "9idxGZRZ3BAKDoxq",
"name": "Google Gemini(PaLM) Api account"
}
},
"typeVersion": 1
},
{
"id": "b804b3fc-161c-40c1-ad9c-3022a09c4a0a",
"name": "Pinecone Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
2060,
360
],
"parameters": {
"mode": "insert",
"options": {},
"pineconeIndex": {
"__rl": true,
"mode": "list",
"value": "notion-pages",
"cachedResultName": "notion-pages"
}
},
"credentials": {
"pineconeApi": {
"id": "R3QGXSEIRTEAZttK",
"name": "Auto: PineconeApi"
}
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "245f016a-7538-4f45-94f0-d8b7e5c9c891",
"connections": {
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Create metadata and load content",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Filter Non-Text Content": {
"main": [
[
{
"node": "Summarize - Concatenate Notion's blocks content",
"type": "main",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Notion - Page Added Trigger": {
"main": [
[
{
"node": "Notion - Retrieve Page Content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Retrieve Page Content": {
"main": [
[
{
"node": "Filter Non-Text Content",
"type": "main",
"index": 0
}
]
]
},
"Create metadata and load content": {
"ai_document": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Summarize - Concatenate Notion's blocks content": {
"main": [
[
{
"node": "Pinecone Vector Store",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -1,302 +0,0 @@
{
"id": "DvP6IHWymTIVg8Up",
"meta": {
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5",
"templateCredsSetupCompleted": true
},
"name": "Store Notion's Pages as Vector Documents into Supabase with OpenAI",
"tags": [],
"nodes": [
{
"id": "495609cd-4ca0-426d-8413-69e771398188",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
400
],
"parameters": {
"width": 637.1327972412109,
"height": 1113.7434387207031,
"content": "## Store Notion's Pages as Vector Documents into Supabase\n\n**This workflow assumes you have a Supabase project with a table that has a vector column. If you don't have it, follow the instructions here:** [Supabase Vector Columns Guide](https://supabase.com/docs/guides/ai/vector-columns)\n\n## Workflow Description\n\nThis workflow automates the process of storing Notion pages as vector documents in a Supabase database with a vector column. The steps are as follows:\n\n1. **Notion Page Added Trigger**:\n - Monitors a specified Notion database for newly added pages. You can create a specific Notion database where you copy the pages you want to store in Supabase.\n - Node: `Page Added in Notion Database`\n\n2. **Retrieve Page Content**:\n - Fetches all block content from the newly added Notion page.\n - Node: `Get Blocks Content`\n\n3. **Filter Non-Text Content**:\n - Excludes blocks of type \"image\" and \"video\" to focus on textual content.\n - Node: `Filter - Exclude Media Content`\n\n4. **Summarize Content**:\n - Concatenates the Notion blocks content to create a single text for embedding.\n - Node: `Summarize - Concatenate Notion's blocks content`\n\n5. **Store in Supabase**:\n - Stores the processed documents and their embeddings into a Supabase table with a vector column.\n - Node: `Store Documents in Supabase`\n\n6. **Generate Embeddings**:\n - Utilizes OpenAI's API to generate embeddings for the textual content.\n - Node: `Generate Text Embeddings`\n\n\n7. **Create Metadata and Load Content**:\n - Loads the block content and creates associated metadata, such as page ID and block ID.\n - Node: `Load Block Content & Create Metadata`\n\n8. **Split Content into Chunks**:\n - Divides the text into smaller chunks for easier processing and embedding generation.\n - Node: `Token Splitter`\n\n\n\n"
},
"typeVersion": 1
},
{
"id": "3f3e65dc-2b26-407c-87e5-52ba3b315fed",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
760
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "6d2579b8-376f-44c3-82e8-9dc608efd98b",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2340,
960
],
"parameters": {
"chunkSize": 256,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "79b3c147-08ca-4db4-9116-958a868cbfd9",
"name": "Notion - Page Added Trigger",
"type": "n8n-nodes-base.notionTrigger",
"position": [
1180,
520
],
"parameters": {
"simple": false,
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"typeVersion": 1
},
{
"id": "e4a6f524-e3f5-4d02-949a-8523f2d21965",
"name": "Notion - Retrieve Page Content",
"type": "n8n-nodes-base.notion",
"position": [
1400,
520
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"typeVersion": 2.2
},
{
"id": "bfebc173-8d4b-4f8f-a625-4622949dd545",
"name": "Filter Non-Text Content",
"type": "n8n-nodes-base.filter",
"position": [
1620,
520
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e5b605e5-6d05-4bca-8f19-a859e474620f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "image"
},
{
"id": "c7415859-5ffd-4c78-b497-91a3d6303b6f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "video"
}
]
}
},
"typeVersion": 2
},
{
"id": "b04939f9-355a-430b-a069-b11800066313",
"name": "Summarize - Concatenate Notion's blocks content",
"type": "n8n-nodes-base.summarize",
"position": [
1920,
520
],
"parameters": {
"options": {
"outputFormat": "separateItems"
},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
},
{
"id": "0e64dbb5-20c1-4b90-b818-a1726aaf5112",
"name": "Create metadata and load content",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2320,
760
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "pageId",
"value": "={{ $('Notion - Page Added Trigger').item.json.id }}"
},
{
"name": "createdTime",
"value": "={{ $('Notion - Page Added Trigger').item.json.created_time }}"
},
{
"name": "pageTitle",
"value": "={{ $('Notion - Page Added Trigger').item.json.properties.Page.title[0].text.content }}"
}
]
}
},
"jsonData": "={{ $('Summarize - Concatenate Notion's blocks content').item.json.concatenated_content }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "187aba6f-eaed-4427-8d40-b9da025fb37d",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2200,
520
],
"parameters": {
"mode": "insert",
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultName": ""
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "77f6b6f7-d699-4a7e-b3e7-fe8a60bde7ba",
"connections": {
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Create metadata and load content",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Filter Non-Text Content": {
"main": [
[
{
"node": "Summarize - Concatenate Notion's blocks content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Page Added Trigger": {
"main": [
[
{
"node": "Notion - Retrieve Page Content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Retrieve Page Content": {
"main": [
[
{
"node": "Filter Non-Text Content",
"type": "main",
"index": 0
}
]
]
},
"Create metadata and load content": {
"ai_document": [
[
{
"node": "Supabase Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Summarize - Concatenate Notion's blocks content": {
"main": [
[
{
"node": "Supabase Vector Store",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,302 @@
{
"id": "DvP6IHWymTIVg8Up",
"meta": {
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5",
"templateCredsSetupCompleted": true
},
"name": "Store Notion's Pages as Vector Documents into Supabase with OpenAI",
"tags": [],
"nodes": [
{
"id": "495609cd-4ca0-426d-8413-69e771398188",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
400
],
"parameters": {
"width": 637.1327972412109,
"height": 1113.7434387207031,
"content": "## Store Notion's Pages as Vector Documents into Supabase\n\n**This workflow assumes you have a Supabase project with a table that has a vector column. If you don't have it, follow the instructions here:** [Supabase Vector Columns Guide](https://supabase.com/docs/guides/ai/vector-columns)\n\n## Workflow Description\n\nThis workflow automates the process of storing Notion pages as vector documents in a Supabase database with a vector column. The steps are as follows:\n\n1. **Notion Page Added Trigger**:\n - Monitors a specified Notion database for newly added pages. You can create a specific Notion database where you copy the pages you want to store in Supabase.\n - Node: `Page Added in Notion Database`\n\n2. **Retrieve Page Content**:\n - Fetches all block content from the newly added Notion page.\n - Node: `Get Blocks Content`\n\n3. **Filter Non-Text Content**:\n - Excludes blocks of type \"image\" and \"video\" to focus on textual content.\n - Node: `Filter - Exclude Media Content`\n\n4. **Summarize Content**:\n - Concatenates the Notion blocks content to create a single text for embedding.\n - Node: `Summarize - Concatenate Notion's blocks content`\n\n5. **Store in Supabase**:\n - Stores the processed documents and their embeddings into a Supabase table with a vector column.\n - Node: `Store Documents in Supabase`\n\n6. **Generate Embeddings**:\n - Utilizes OpenAI's API to generate embeddings for the textual content.\n - Node: `Generate Text Embeddings`\n\n\n7. **Create Metadata and Load Content**:\n - Loads the block content and creates associated metadata, such as page ID and block ID.\n - Node: `Load Block Content & Create Metadata`\n\n8. **Split Content into Chunks**:\n - Divides the text into smaller chunks for easier processing and embedding generation.\n - Node: `Token Splitter`\n\n\n\n"
},
"typeVersion": 1
},
{
"id": "3f3e65dc-2b26-407c-87e5-52ba3b315fed",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
2200,
760
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "6d2579b8-376f-44c3-82e8-9dc608efd98b",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2340,
960
],
"parameters": {
"chunkSize": 256,
"chunkOverlap": 30
},
"typeVersion": 1
},
{
"id": "79b3c147-08ca-4db4-9116-958a868cbfd9",
"name": "Notion - Page Added Trigger",
"type": "n8n-nodes-base.notionTrigger",
"position": [
1180,
520
],
"parameters": {
"simple": false,
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"typeVersion": 1
},
{
"id": "e4a6f524-e3f5-4d02-949a-8523f2d21965",
"name": "Notion - Retrieve Page Content",
"type": "n8n-nodes-base.notion",
"position": [
1400,
520
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "url",
"value": "={{ $json.url }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true
},
"typeVersion": 2.2
},
{
"id": "bfebc173-8d4b-4f8f-a625-4622949dd545",
"name": "Filter Non-Text Content",
"type": "n8n-nodes-base.filter",
"position": [
1620,
520
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e5b605e5-6d05-4bca-8f19-a859e474620f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "image"
},
{
"id": "c7415859-5ffd-4c78-b497-91a3d6303b6f",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.type }}",
"rightValue": "video"
}
]
}
},
"typeVersion": 2
},
{
"id": "b04939f9-355a-430b-a069-b11800066313",
"name": "Summarize - Concatenate Notion's blocks content",
"type": "n8n-nodes-base.summarize",
"position": [
1920,
520
],
"parameters": {
"options": {
"outputFormat": "separateItems"
},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
},
{
"id": "0e64dbb5-20c1-4b90-b818-a1726aaf5112",
"name": "Create metadata and load content",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2320,
760
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "pageId",
"value": "={{ $('Notion - Page Added Trigger').item.json.id }}"
},
{
"name": "createdTime",
"value": "={{ $('Notion - Page Added Trigger').item.json.created_time }}"
},
{
"name": "pageTitle",
"value": "={{ $('Notion - Page Added Trigger').item.json.properties.Page.title[0].text.content }}"
}
]
}
},
"jsonData": "={{ $('Summarize - Concatenate Notion's blocks content').item.json.concatenated_content }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "187aba6f-eaed-4427-8d40-b9da025fb37d",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2200,
520
],
"parameters": {
"mode": "insert",
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultName": ""
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "77f6b6f7-d699-4a7e-b3e7-fe8a60bde7ba",
"connections": {
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Create metadata and load content",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Filter Non-Text Content": {
"main": [
[
{
"node": "Summarize - Concatenate Notion's blocks content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Page Added Trigger": {
"main": [
[
{
"node": "Notion - Retrieve Page Content",
"type": "main",
"index": 0
}
]
]
},
"Notion - Retrieve Page Content": {
"main": [
[
{
"node": "Filter Non-Text Content",
"type": "main",
"index": 0
}
]
]
},
"Create metadata and load content": {
"ai_document": [
[
{
"node": "Supabase Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Summarize - Concatenate Notion's blocks content": {
"main": [
[
{
"node": "Supabase Vector Store",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -1,839 +0,0 @@
{
"id": "JxFP8FJ2W7e4Kmqn",
"meta": {
"instanceId": "fb8bc2e315f7f03c97140b30aa454a27bc7883a19000fa1da6e6b571bf56ad6d",
"templateCredsSetupCompleted": true
},
"name": "RAG on living data",
"tags": [],
"nodes": [
{
"id": "49086cdf-a38c-4cb8-9be9-d3e6ea5bdde5",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1740,
1040
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "X7Jf0zECd3IkQdSw",
"name": "OpenAi (octionicsolutions)"
}
},
"typeVersion": 1
},
{
"id": "f0670721-92f4-422a-99c9-f9c2aa6fe21f",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2380,
540
],
"parameters": {
"chunkSize": 500
},
"typeVersion": 1
},
{
"id": "fe80ecac-4f79-4b07-ad8e-60ab5f980cba",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1180,
-200
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "81b79248-08e8-4214-872b-1796e51ad0a4",
"name": "Question and Answer Chain",
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
"position": [
744,
495
],
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "e78f7b63-baef-4834-8f1b-aecfa9102d6c",
"name": "Vector Store Retriever",
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
"position": [
844,
715
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1d5ffbd0-b2cf-4660-a291-581d18608ecd",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
704,
715
],
"parameters": {
"model": "gpt-4o",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "X7Jf0zECd3IkQdSw",
"name": "OpenAi (octionicsolutions)"
}
},
"typeVersion": 1
},
{
"id": "37a3063f-aa21-4347-a72f-6dd316c58366",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
524,
495
],
"webhookId": "74479a54-418f-4de2-b70d-cfb3e3fdd5a7",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "5924bc01-1694-4b5c-8a06-7c46ee4c6425",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
520,
-200
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 1
}
]
}
},
"typeVersion": 1.2
},
{
"id": "5067eda6-8bbe-407a-a6af-93e81be53661",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
620,
0
],
"parameters": {
"width": 329.16412916774584,
"height": 312.52803480051045,
"content": "## Switch trigger (optional)\nIf you are on the cloud plan, consider switching to the Notion Trigger Node instead, to save on executions."
},
"typeVersion": 1
},
{
"id": "33458828-484d-426b-a3d1-974a81c6162e",
"name": "Limit",
"type": "n8n-nodes-base.limit",
"position": [
1620,
-60
],
"parameters": {},
"typeVersion": 1
},
{
"id": "4d39503a-378e-4942-a5d4-8c62785aac44",
"name": "Limit1",
"type": "n8n-nodes-base.limit",
"position": [
2660,
-60
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0e0b1391-3fe5-4d80-a2eb-a2483b79d9a6",
"name": "Delete old embeddings if exist",
"type": "n8n-nodes-base.supabase",
"position": [
1400,
-60
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>id=eq.{{ $('Input Reference').item.json.id }}"
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "4a8614e4-0a53-4731-bc68-57505d7d0a09",
"name": "Get page blocks",
"type": "n8n-nodes-base.notion",
"position": [
1840,
-60
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Input Reference').item.json.id }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true,
"fetchNestedBlocks": true
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"executeOnce": true,
"typeVersion": 2.2
},
{
"id": "8c922895-49d6-4778-8356-6f6cf49e5420",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2300,
260
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "id",
"value": "={{ $('Input Reference').item.json.id }}"
},
{
"name": "name",
"value": "={{ $('Input Reference').item.json.name }}"
}
]
}
}
},
"typeVersion": 1
},
{
"id": "8ad7ff2e-4bc2-4821-ae03-bab2dc11d947",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
400
],
"parameters": {
"width": 376.2098538932132,
"height": 264.37628764336097,
"content": "## Adjust chunk size and overlap\nFor more accurate search results, increase the overlap. For the *text-embedding-ada-002* model the chunk size plus overlap must not exceed 8191"
},
"typeVersion": 1
},
{
"id": "8078d59a-f45f-4e96-a8ec-6c2f1c328e84",
"name": "Input Reference",
"type": "n8n-nodes-base.noOp",
"position": [
960,
-200
],
"parameters": {},
"typeVersion": 1
},
{
"id": "aae6c517-a316-40e3-aee9-1cc4b448689f",
"name": "Notion Trigger",
"type": "n8n-nodes-base.notionTrigger",
"disabled": true,
"position": [
740,
120
],
"parameters": {
"event": "pagedUpdatedInDatabase",
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "ec6dc7b4-9ce0-47f7-8025-ef09295999fd",
"cachedResultUrl": "https://www.notion.so/ec6dc7b49ce047f78025ef09295999fd",
"cachedResultName": "Knowledge Base"
}
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"typeVersion": 1
},
{
"id": "3a43d66d-d4e3-4ca1-aee9-85ac65160e45",
"name": "Get updated pages",
"type": "n8n-nodes-base.notion",
"position": [
740,
-200
],
"parameters": {
"filters": {
"conditions": [
{
"key": "Last edited time|last_edited_time",
"condition": "equals",
"lastEditedTime": "={{ $now.minus(1, 'minutes').toISO() }}"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "ec6dc7b4-9ce0-47f7-8025-ef09295999fd",
"cachedResultUrl": "https://www.notion.so/ec6dc7b49ce047f78025ef09295999fd",
"cachedResultName": "Knowledge Base"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"typeVersion": 2.2
},
{
"id": "bbf1296f-4e2b-4a38-bdf3-ae2b63cc7774",
"name": "Sticky Note23",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "This placeholder serves as a reference point so it is easier to swap the data source with a different service"
},
"typeVersion": 1
},
{
"id": "631e1e10-0b52-4a17-89a4-769ac563321f",
"name": "Sticky Note24",
"type": "n8n-nodes-base.stickyNote",
"position": [
1340,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "All chunks of a previous version of the document are being deleted by filtering the meta data by the given ID"
},
"typeVersion": 1
},
{
"id": "6c830c83-4b70-4719-8e2a-26846e60085c",
"name": "Sticky Note25",
"type": "n8n-nodes-base.stickyNote",
"position": [
1560,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Reduce the active streams/items to just 1 to prevent the following nodes from double-processing"
},
"typeVersion": 1
},
{
"id": "46c8e4e4-0a5e-4ede-947b-5773710d4e55",
"name": "Sticky Note26",
"type": "n8n-nodes-base.stickyNote",
"position": [
1780,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Retrieve all page contents/blocks"
},
"typeVersion": 1
},
{
"id": "0369e610-d074-4812-9d04-8615b42965a5",
"name": "Sticky Note27",
"type": "n8n-nodes-base.stickyNote",
"position": [
2600,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Reduce the active streams/items to just 1 to prevent the following nodes from double-processing"
},
"typeVersion": 1
},
{
"id": "4f3bce54-1650-45fa-abb0-c881358c7e8d",
"name": "Sticky Note28",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
-160
],
"parameters": {
"color": 7,
"width": 375.9283286479995,
"height": 275.841854198618,
"content": "Embed item and store in Vector Store. Depending on the length the content is being split up into multiple chunks/embeds"
},
"typeVersion": 1
},
{
"id": "44125921-e068-4a5d-a56b-b0e63c103556",
"name": "Supabase Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
924,
935
],
"parameters": {
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1
},
{
"id": "467322a9-949d-4569-aac6-92196da46ba5",
"name": "Sticky Note30",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
400
],
"parameters": {
"color": 7,
"width": 730.7522093855692,
"height": 668.724737081502,
"content": "Simple chat bot to ask specific questions while having access to the context of the Notion Knowledge Base which was stored in the Vector Store"
},
"typeVersion": 1
},
{
"id": "27f078cf-b309-4dd1-a8ce-b4fc504d6e29",
"name": "Sticky Note31",
"type": "n8n-nodes-base.stickyNote",
"position": [
1660,
900
],
"parameters": {
"color": 7,
"width": 219.31927574471658,
"height": 275.841854198618,
"content": "Model used for both creating and reading embeddings"
},
"typeVersion": 1
},
{
"id": "2f59cba1-4318-47e7-bf0b-b908d4186b86",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2280,
-60
],
"parameters": {
"mode": "insert",
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1
},
{
"id": "729849e7-0eff-40c2-ae00-ae660c1eec69",
"name": "Sticky Note32",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Process each page/document separately."
},
"typeVersion": 1
},
{
"id": "3f632a24-ca0a-45c4-801d-041aa3f887a7",
"name": "Sticky Note29",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
120
],
"parameters": {
"color": 7,
"width": 376.0759088111347,
"height": 275.841854198618,
"content": "Store additional meta data with each embed, especially the Notion ID, which can be later used to find all belonging entries of one page, even if they got split into multiple embeds."
},
"typeVersion": 1
},
{
"id": "ffaf3861-5287-4f57-8372-09216a18cb4d",
"name": "Sticky Note33",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Using a manual approach for polling data from Notion for more accuracy."
},
"typeVersion": 1
},
{
"id": "cbbedfc0-4d64-42a6-8f55-21e04887305f",
"name": "Sticky Note34",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-300
],
"parameters": {
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "## Select Database\nChoose the database which represents your Knowledge Base"
},
"typeVersion": 1
},
{
"id": "8b6767f2-1bc9-42fb-b319-f39f6734b9f2",
"name": "Sticky Note35",
"type": "n8n-nodes-base.stickyNote",
"position": [
2000,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Combine all contents to a single text formatted into one line which can be easily stored as an embed"
},
"typeVersion": 1
},
{
"id": "cdff1756-77d7-421e-8672-25c9862840b0",
"name": "Concatenate to single string",
"type": "n8n-nodes-base.summarize",
"position": [
2060,
-60
],
"parameters": {
"options": {},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "51075175-868a-4a3a-9580-5ad55e25ac71",
"connections": {
"Limit": {
"main": [
[
{
"node": "Get page blocks",
"type": "main",
"index": 0
}
]
]
},
"Limit1": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Notion Trigger": {
"main": [
[
{
"node": "Input Reference",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Get page blocks": {
"main": [
[
{
"node": "Concatenate to single string",
"type": "main",
"index": 0
}
]
]
},
"Input Reference": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Delete old embeddings if exist",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get updated pages",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
},
{
"node": "Supabase Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Get updated pages": {
"main": [
[
{
"node": "Input Reference",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Question and Answer Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Supabase Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"main": [
[
{
"node": "Limit1",
"type": "main",
"index": 0
}
]
]
},
"Supabase Vector Store1": {
"ai_vectorStore": [
[
{
"node": "Vector Store Retriever",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Retriever": {
"ai_retriever": [
[
{
"node": "Question and Answer Chain",
"type": "ai_retriever",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Question and Answer Chain",
"type": "main",
"index": 0
}
]
]
},
"Concatenate to single string": {
"main": [
[
{
"node": "Supabase Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Delete old embeddings if exist": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,839 @@
{
"id": "JxFP8FJ2W7e4Kmqn",
"meta": {
"instanceId": "fb8bc2e315f7f03c97140b30aa454a27bc7883a19000fa1da6e6b571bf56ad6d",
"templateCredsSetupCompleted": true
},
"name": "RAG on living data",
"tags": [],
"nodes": [
{
"id": "49086cdf-a38c-4cb8-9be9-d3e6ea5bdde5",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1740,
1040
],
"parameters": {
"options": {}
},
"credentials": {
"openAiApi": {
"id": "X7Jf0zECd3IkQdSw",
"name": "OpenAi (octionicsolutions)"
}
},
"typeVersion": 1
},
{
"id": "f0670721-92f4-422a-99c9-f9c2aa6fe21f",
"name": "Token Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
"position": [
2380,
540
],
"parameters": {
"chunkSize": 500
},
"typeVersion": 1
},
{
"id": "fe80ecac-4f79-4b07-ad8e-60ab5f980cba",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1180,
-200
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "81b79248-08e8-4214-872b-1796e51ad0a4",
"name": "Question and Answer Chain",
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
"position": [
744,
495
],
"parameters": {
"options": {}
},
"typeVersion": 1.3
},
{
"id": "e78f7b63-baef-4834-8f1b-aecfa9102d6c",
"name": "Vector Store Retriever",
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
"position": [
844,
715
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1d5ffbd0-b2cf-4660-a291-581d18608ecd",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
704,
715
],
"parameters": {
"model": "gpt-4o",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "X7Jf0zECd3IkQdSw",
"name": "OpenAi (octionicsolutions)"
}
},
"typeVersion": 1
},
{
"id": "37a3063f-aa21-4347-a72f-6dd316c58366",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
524,
495
],
"webhookId": "74479a54-418f-4de2-b70d-cfb3e3fdd5a7",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "5924bc01-1694-4b5c-8a06-7c46ee4c6425",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
520,
-200
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 1
}
]
}
},
"typeVersion": 1.2
},
{
"id": "5067eda6-8bbe-407a-a6af-93e81be53661",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
620,
0
],
"parameters": {
"width": 329.16412916774584,
"height": 312.52803480051045,
"content": "## Switch trigger (optional)\nIf you are on the cloud plan, consider switching to the Notion Trigger Node instead, to save on executions."
},
"typeVersion": 1
},
{
"id": "33458828-484d-426b-a3d1-974a81c6162e",
"name": "Limit",
"type": "n8n-nodes-base.limit",
"position": [
1620,
-60
],
"parameters": {},
"typeVersion": 1
},
{
"id": "4d39503a-378e-4942-a5d4-8c62785aac44",
"name": "Limit1",
"type": "n8n-nodes-base.limit",
"position": [
2660,
-60
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0e0b1391-3fe5-4d80-a2eb-a2483b79d9a6",
"name": "Delete old embeddings if exist",
"type": "n8n-nodes-base.supabase",
"position": [
1400,
-60
],
"parameters": {
"tableId": "documents",
"operation": "delete",
"filterType": "string",
"filterString": "=metadata->>id=eq.{{ $('Input Reference').item.json.id }}"
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "4a8614e4-0a53-4731-bc68-57505d7d0a09",
"name": "Get page blocks",
"type": "n8n-nodes-base.notion",
"position": [
1840,
-60
],
"parameters": {
"blockId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Input Reference').item.json.id }}"
},
"resource": "block",
"operation": "getAll",
"returnAll": true,
"fetchNestedBlocks": true
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"executeOnce": true,
"typeVersion": 2.2
},
{
"id": "8c922895-49d6-4778-8356-6f6cf49e5420",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
2300,
260
],
"parameters": {
"options": {
"metadata": {
"metadataValues": [
{
"name": "id",
"value": "={{ $('Input Reference').item.json.id }}"
},
{
"name": "name",
"value": "={{ $('Input Reference').item.json.name }}"
}
]
}
}
},
"typeVersion": 1
},
{
"id": "8ad7ff2e-4bc2-4821-ae03-bab2dc11d947",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
400
],
"parameters": {
"width": 376.2098538932132,
"height": 264.37628764336097,
"content": "## Adjust chunk size and overlap\nFor more accurate search results, increase the overlap. For the *text-embedding-ada-002* model the chunk size plus overlap must not exceed 8191"
},
"typeVersion": 1
},
{
"id": "8078d59a-f45f-4e96-a8ec-6c2f1c328e84",
"name": "Input Reference",
"type": "n8n-nodes-base.noOp",
"position": [
960,
-200
],
"parameters": {},
"typeVersion": 1
},
{
"id": "aae6c517-a316-40e3-aee9-1cc4b448689f",
"name": "Notion Trigger",
"type": "n8n-nodes-base.notionTrigger",
"disabled": true,
"position": [
740,
120
],
"parameters": {
"event": "pagedUpdatedInDatabase",
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"databaseId": {
"__rl": true,
"mode": "list",
"value": "ec6dc7b4-9ce0-47f7-8025-ef09295999fd",
"cachedResultUrl": "https://www.notion.so/ec6dc7b49ce047f78025ef09295999fd",
"cachedResultName": "Knowledge Base"
}
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"typeVersion": 1
},
{
"id": "3a43d66d-d4e3-4ca1-aee9-85ac65160e45",
"name": "Get updated pages",
"type": "n8n-nodes-base.notion",
"position": [
740,
-200
],
"parameters": {
"filters": {
"conditions": [
{
"key": "Last edited time|last_edited_time",
"condition": "equals",
"lastEditedTime": "={{ $now.minus(1, 'minutes').toISO() }}"
}
]
},
"options": {},
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"mode": "list",
"value": "ec6dc7b4-9ce0-47f7-8025-ef09295999fd",
"cachedResultUrl": "https://www.notion.so/ec6dc7b49ce047f78025ef09295999fd",
"cachedResultName": "Knowledge Base"
},
"filterType": "manual"
},
"credentials": {
"notionApi": {
"id": "ObmaBA0dJss3JJPv",
"name": "Notion (octionicsolutions / Test)"
}
},
"typeVersion": 2.2
},
{
"id": "bbf1296f-4e2b-4a38-bdf3-ae2b63cc7774",
"name": "Sticky Note23",
"type": "n8n-nodes-base.stickyNote",
"position": [
900,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "This placeholder serves as a reference point so it is easier to swap the data source with a different service"
},
"typeVersion": 1
},
{
"id": "631e1e10-0b52-4a17-89a4-769ac563321f",
"name": "Sticky Note24",
"type": "n8n-nodes-base.stickyNote",
"position": [
1340,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "All chunks of a previous version of the document are being deleted by filtering the meta data by the given ID"
},
"typeVersion": 1
},
{
"id": "6c830c83-4b70-4719-8e2a-26846e60085c",
"name": "Sticky Note25",
"type": "n8n-nodes-base.stickyNote",
"position": [
1560,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Reduce the active streams/items to just 1 to prevent the following nodes from double-processing"
},
"typeVersion": 1
},
{
"id": "46c8e4e4-0a5e-4ede-947b-5773710d4e55",
"name": "Sticky Note26",
"type": "n8n-nodes-base.stickyNote",
"position": [
1780,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Retrieve all page contents/blocks"
},
"typeVersion": 1
},
{
"id": "0369e610-d074-4812-9d04-8615b42965a5",
"name": "Sticky Note27",
"type": "n8n-nodes-base.stickyNote",
"position": [
2600,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Reduce the active streams/items to just 1 to prevent the following nodes from double-processing"
},
"typeVersion": 1
},
{
"id": "4f3bce54-1650-45fa-abb0-c881358c7e8d",
"name": "Sticky Note28",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
-160
],
"parameters": {
"color": 7,
"width": 375.9283286479995,
"height": 275.841854198618,
"content": "Embed item and store in Vector Store. Depending on the length the content is being split up into multiple chunks/embeds"
},
"typeVersion": 1
},
{
"id": "44125921-e068-4a5d-a56b-b0e63c103556",
"name": "Supabase Vector Store1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
924,
935
],
"parameters": {
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1
},
{
"id": "467322a9-949d-4569-aac6-92196da46ba5",
"name": "Sticky Note30",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
400
],
"parameters": {
"color": 7,
"width": 730.7522093855692,
"height": 668.724737081502,
"content": "Simple chat bot to ask specific questions while having access to the context of the Notion Knowledge Base which was stored in the Vector Store"
},
"typeVersion": 1
},
{
"id": "27f078cf-b309-4dd1-a8ce-b4fc504d6e29",
"name": "Sticky Note31",
"type": "n8n-nodes-base.stickyNote",
"position": [
1660,
900
],
"parameters": {
"color": 7,
"width": 219.31927574471658,
"height": 275.841854198618,
"content": "Model used for both creating and reading embeddings"
},
"typeVersion": 1
},
{
"id": "2f59cba1-4318-47e7-bf0b-b908d4186b86",
"name": "Supabase Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [
2280,
-60
],
"parameters": {
"mode": "insert",
"options": {},
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
}
},
"credentials": {
"supabaseApi": {
"id": "DjIb4HMTYXhTU8Uc",
"name": "Supabase (VectorStore)"
}
},
"typeVersion": 1
},
{
"id": "729849e7-0eff-40c2-ae00-ae660c1eec69",
"name": "Sticky Note32",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Process each page/document separately."
},
"typeVersion": 1
},
{
"id": "3f632a24-ca0a-45c4-801d-041aa3f887a7",
"name": "Sticky Note29",
"type": "n8n-nodes-base.stickyNote",
"position": [
2220,
120
],
"parameters": {
"color": 7,
"width": 376.0759088111347,
"height": 275.841854198618,
"content": "Store additional meta data with each embed, especially the Notion ID, which can be later used to find all belonging entries of one page, even if they got split into multiple embeds."
},
"typeVersion": 1
},
{
"id": "ffaf3861-5287-4f57-8372-09216a18cb4d",
"name": "Sticky Note33",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
-300
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Using a manual approach for polling data from Notion for more accuracy."
},
"typeVersion": 1
},
{
"id": "cbbedfc0-4d64-42a6-8f55-21e04887305f",
"name": "Sticky Note34",
"type": "n8n-nodes-base.stickyNote",
"position": [
680,
-300
],
"parameters": {
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "## Select Database\nChoose the database which represents your Knowledge Base"
},
"typeVersion": 1
},
{
"id": "8b6767f2-1bc9-42fb-b319-f39f6734b9f2",
"name": "Sticky Note35",
"type": "n8n-nodes-base.stickyNote",
"position": [
2000,
-160
],
"parameters": {
"color": 7,
"width": 216.47293010628914,
"height": 275.841854198618,
"content": "Combine all contents to a single text formatted into one line which can be easily stored as an embed"
},
"typeVersion": 1
},
{
"id": "cdff1756-77d7-421e-8672-25c9862840b0",
"name": "Concatenate to single string",
"type": "n8n-nodes-base.summarize",
"position": [
2060,
-60
],
"parameters": {
"options": {},
"fieldsToSummarize": {
"values": [
{
"field": "content",
"separateBy": "\n",
"aggregation": "concatenate"
}
]
}
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "51075175-868a-4a3a-9580-5ad55e25ac71",
"connections": {
"Limit": {
"main": [
[
{
"node": "Get page blocks",
"type": "main",
"index": 0
}
]
]
},
"Limit1": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Notion Trigger": {
"main": [
[
{
"node": "Input Reference",
"type": "main",
"index": 0
}
]
]
},
"Token Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Get page blocks": {
"main": [
[
{
"node": "Concatenate to single string",
"type": "main",
"index": 0
}
]
]
},
"Input Reference": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Delete old embeddings if exist",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Get updated pages",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Supabase Vector Store",
"type": "ai_embedding",
"index": 0
},
{
"node": "Supabase Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Get updated pages": {
"main": [
[
{
"node": "Input Reference",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Question and Answer Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Supabase Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Supabase Vector Store": {
"main": [
[
{
"node": "Limit1",
"type": "main",
"index": 0
}
]
]
},
"Supabase Vector Store1": {
"ai_vectorStore": [
[
{
"node": "Vector Store Retriever",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Store Retriever": {
"ai_retriever": [
[
{
"node": "Question and Answer Chain",
"type": "ai_retriever",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Question and Answer Chain",
"type": "main",
"index": 0
}
]
]
},
"Concatenate to single string": {
"main": [
[
{
"node": "Supabase Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Delete old embeddings if exist": {
"main": [
[
{
"node": "Limit",
"type": "main",
"index": 0
}
]
]
}
}
}