Revert "change to json formatted text and reformat all .txt to .json & fix error json format"
This commit is contained in:
@@ -1,915 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "f577f6bd-b1a4-48ec-9329-7bccc3fc1463",
|
||||
"name": "Get All files",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
400,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"prefix\": \"\",\n \"limit\": 100,\n \"offset\": 0,\n \"sortBy\": {\n \"column\": \"name\",\n \"order\": \"asc\"\n }\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "supabaseApi"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "10693bc8-560d-4cf6-8bd0-2fe3f4d863d1",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
1780,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "=file_id",
|
||||
"value": "={{ $json.id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jsonData": "={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}",
|
||||
"jsonMode": "expressionData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "49428060-e707-4269-8344-77b301f56f7c",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
1780,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 500,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "08742063-e235-4874-a128-b352786b19ce",
|
||||
"name": "Extract Document PDF",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
1240,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "21f19360-d7ce-4106-ae5a-aa0f15b7c4aa",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1600,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-small",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fLfRtaXbR0EVD0pl",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4147409f-8686-418f-b979-04f8c8e7fe42",
|
||||
"name": "Create File record2",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
1540,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "files",
|
||||
"fieldsUi": {
|
||||
"fieldValues": [
|
||||
{
|
||||
"fieldId": "name",
|
||||
"fieldValue": "={{ $('Loop Over Items').item.json.name }}"
|
||||
},
|
||||
{
|
||||
"fieldId": "storage_id",
|
||||
"fieldValue": "={{ $('Loop Over Items').item.json.id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "016f1afe-172b-4609-b451-8d67609214d3",
|
||||
"name": "If",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
720,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ \n !$('Aggregate').item.json.data || \n !Array.isArray($('Aggregate').item.json.data) || \n !$('Aggregate').item.json.data.some(item => \n item.storage_id === $('Loop Over Items').item.json.id \n ) \n}}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"id": "c3c0af88-9aea-4539-8948-1b69e601c27c",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.name }}",
|
||||
"rightValue": ".emptyFolderPlaceholder"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "75e8a7db-8c4a-4ad8-b902-062cbc93e1eb",
|
||||
"name": "Get All Files",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
20,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "files",
|
||||
"operation": "getAll"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "b22a3bab-f615-4d8a-8832-ce25b1a385fe",
|
||||
"name": "Download",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
900,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "supabaseApi"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "50d1fede-4bd0-4cd4-b74a-7d689fe211cc",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
560,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"batchSize": "=1"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "f9c23b5e-0b40-4886-b54f-59fb46132d3f",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-160,
|
||||
-100
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0a0ec290-2c3d-40ba-8d03-6abf75202e73",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
220,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
800,
|
||||
-1020
|
||||
],
|
||||
"webhookId": "3c40d311-7996-4ed4-b2fa-c73bea5f4cf5",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "79073b5c-a4ad-45a6-bbfa-e900a05bfde3",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
940,
|
||||
-820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f8663483-76d5-4fc8-ad07-7eec815ff7a6",
|
||||
"name": "Embeddings OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1020,
|
||||
-540
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-small",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1458799-d379-46de-93e6-a5ba0c665163",
|
||||
"name": "OpenAI Chat Model2",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1300,
|
||||
-680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d6eeda2f-c984-406d-a625-726840308413",
|
||||
"name": "Vector Store Tool1",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
1100,
|
||||
-820
|
||||
],
|
||||
"parameters": {
|
||||
"name": "knowledge_base",
|
||||
"topK": 8,
|
||||
"description": "Retrieve data about user request"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e1d9a348-7d44-4ad1-adbd-2c9a31e06876",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1060,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "txt",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{$binary.data?.fileExtension == undefined }}",
|
||||
"rightValue": "txt"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "pdf",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bf04cbec-dd86-4607-988f-4c96b6fd4b58",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{$binary.data.fileExtension }}",
|
||||
"rightValue": "pdf"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.1
|
||||
},
|
||||
{
|
||||
"id": "d38afb92-87ae-4e2a-a712-ec24b1efd105",
|
||||
"name": "Insert into Supabase Vectorstore",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
|
||||
"position": [
|
||||
1700,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {
|
||||
"queryName": "match_documents"
|
||||
},
|
||||
"tableName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "documents",
|
||||
"cachedResultName": "documents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1a903b2e-cab0-4798-b820-ec08d6a71ddd",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1380,
|
||||
-100
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "3afd552e-4995-493e-9cd5-ef496dfe359f",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1020,
|
||||
-1020
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "d9688acc-311b-42fd-afa8-2c0e493be34b",
|
||||
"name": "Supabase Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
|
||||
"position": [
|
||||
1020,
|
||||
-660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "file_id",
|
||||
"value": "300b0128-0955-4058-b0d3-a9aefe728432"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tableName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "documents",
|
||||
"cachedResultName": "documents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "66df007c-0418-4551-950e-32e7d79840bd",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 89.3775420487804,
|
||||
"content": "### Replace Storage name, database ID and credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b164b520-20dd-44a4-aa3b-647391786b20",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-20,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8688c219-5af4-4e54-9fd1-91851829445b",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1540,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "45c6ece4-f849-4496-8149-31385f5e36a4",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
840,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 89.3775420487804,
|
||||
"content": "### Replace Storage name, database ID and credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2ca07cb0-b5f4-4761-b954-faf2131872d9",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1500,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d682dae-6f88-42f0-a717-affffd37d882",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
-520
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "796b5dca-d60e-43a9-afe8-194244643557",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-520,
|
||||
-940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [10 min]\n[](https://www.youtube.com/watch?v=glWUkdZe_3w)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eba121de-a3f7-4ba5-8396-f7d64e648322",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-820,
|
||||
-1460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent To Chat With Files In Supabase Storage\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\n\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\n- Fetching and comparing files to avoid duplicate processing.\n- Handling file downloads and extracting content based on the file type.\n- Converting documents into vectorized data for contextual information retrieval.\n- Storing and querying vectorized data from a Supabase vector store.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df054036-d6b9-4f53-86cb-85ad96f07d0e",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-820,
|
||||
-940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n1. **Fetch File List from Supabase**:\n - Use Supabase to retrieve the stored file list from a specified bucket.\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\n\n2. **Compare and Filter Files**:\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\n\n3. **Handle File Downloads**:\n - Download new files using detailed storage configurations for public/private access.\n - Adjust the storage settings and GET requests to match your Supabase setup.\n\n4. **File Type Processing**:\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\n - Employ relevant tools to process the content:\n - For PDFs, extract embedded content.\n - For text files, directly process the text data.\n\n5. **Content Chunking**:\n - Break large text data into smaller chunks using the Text Splitter node.\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\n\n6. **Vector Embedding Creation**:\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\n - Ensure metadata, such as file ID, is included for easy data retrieval.\n\n7. **Store Vectorized Data**:\n - Save the vectorized information into a dedicated Supabase vector store.\n - Use the default schema and table provided by Supabase for seamless setup.\n\n8. **AI Chatbot Integration**:\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "450a1e49-4be9-451a-9d05-2860e29c3695",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-1160
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 951.7421645394404,
|
||||
"height": 809.7437181509877,
|
||||
"content": "## Scenario 2 - AI agent"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c3814c5d-8881-4598-897e-268019bee1bc",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-260,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 2304.723519246249,
|
||||
"height": 739.2522526116408,
|
||||
"content": "## Scenario 1 - Flow for adding new files from Supabase storage"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"If": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create File record2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Extract Document PDF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get All files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get All Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get All files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
null,
|
||||
[
|
||||
{
|
||||
"node": "If",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI2": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Supabase Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model2": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool1": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create File record2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract Document PDF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Supabase Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool1",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert into Supabase Vectorstore": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get All Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,915 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "6a2a7715680b8313f7cb4676321c5baa46680adfb913072f089f2766f42e43bd"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "f577f6bd-b1a4-48ec-9329-7bccc3fc1463",
|
||||
"name": "Get All files",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
400,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/list/private",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"prefix\": \"\",\n \"limit\": 100,\n \"offset\": 0,\n \"sortBy\": {\n \"column\": \"name\",\n \"order\": \"asc\"\n }\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "supabaseApi"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "10693bc8-560d-4cf6-8bd0-2fe3f4d863d1",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
1780,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "=file_id",
|
||||
"value": "={{ $json.id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"jsonData": "={{ $('Merge').item.json.data ?? $('Merge').item.json.text }}",
|
||||
"jsonMode": "expressionData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "49428060-e707-4269-8344-77b301f56f7c",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
1780,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 500,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "08742063-e235-4874-a128-b352786b19ce",
|
||||
"name": "Extract Document PDF",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
1240,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "21f19360-d7ce-4106-ae5a-aa0f15b7c4aa",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1600,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-small",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fLfRtaXbR0EVD0pl",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4147409f-8686-418f-b979-04f8c8e7fe42",
|
||||
"name": "Create File record2",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
1540,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "files",
|
||||
"fieldsUi": {
|
||||
"fieldValues": [
|
||||
{
|
||||
"fieldId": "name",
|
||||
"fieldValue": "={{ $('Loop Over Items').item.json.name }}"
|
||||
},
|
||||
{
|
||||
"fieldId": "storage_id",
|
||||
"fieldValue": "={{ $('Loop Over Items').item.json.id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "016f1afe-172b-4609-b451-8d67609214d3",
|
||||
"name": "If",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
720,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "9b14e306-a04d-40f7-bc5b-b8eda8d8f7f2",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ \n !$('Aggregate').item.json.data || \n !Array.isArray($('Aggregate').item.json.data) || \n !$('Aggregate').item.json.data.some(item => \n item.storage_id === $('Loop Over Items').item.json.id \n ) \n}}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"id": "c3c0af88-9aea-4539-8948-1b69e601c27c",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.name }}",
|
||||
"rightValue": ".emptyFolderPlaceholder"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "75e8a7db-8c4a-4ad8-b902-062cbc93e1eb",
|
||||
"name": "Get All Files",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
20,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "files",
|
||||
"operation": "getAll"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "b22a3bab-f615-4d8a-8832-ce25b1a385fe",
|
||||
"name": "Download",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
900,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://yqtvdcvjboenlblgcivl.supabase.co/storage/v1/object/private/{{ $json.name }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "supabaseApi"
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "50d1fede-4bd0-4cd4-b74a-7d689fe211cc",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
560,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"batchSize": "=1"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "f9c23b5e-0b40-4886-b54f-59fb46132d3f",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-160,
|
||||
-100
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0a0ec290-2c3d-40ba-8d03-6abf75202e73",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
220,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "32b3e2e1-2d25-4dd1-93e8-3f693beb7b6f",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
800,
|
||||
-1020
|
||||
],
|
||||
"webhookId": "3c40d311-7996-4ed4-b2fa-c73bea5f4cf5",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "79073b5c-a4ad-45a6-bbfa-e900a05bfde3",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
940,
|
||||
-820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f8663483-76d5-4fc8-ad07-7eec815ff7a6",
|
||||
"name": "Embeddings OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1020,
|
||||
-540
|
||||
],
|
||||
"parameters": {
|
||||
"model": "text-embedding-3-small",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1458799-d379-46de-93e6-a5ba0c665163",
|
||||
"name": "OpenAI Chat Model2",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1300,
|
||||
-680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d6eeda2f-c984-406d-a625-726840308413",
|
||||
"name": "Vector Store Tool1",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
1100,
|
||||
-820
|
||||
],
|
||||
"parameters": {
|
||||
"name": "knowledge_base",
|
||||
"topK": 8,
|
||||
"description": "Retrieve data about user request"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e1d9a348-7d44-4ad1-adbd-2c9a31e06876",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1060,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "txt",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{$binary.data?.fileExtension == undefined }}",
|
||||
"rightValue": "txt"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "pdf",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bf04cbec-dd86-4607-988f-4c96b6fd4b58",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{$binary.data.fileExtension }}",
|
||||
"rightValue": "pdf"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.1
|
||||
},
|
||||
{
|
||||
"id": "d38afb92-87ae-4e2a-a712-ec24b1efd105",
|
||||
"name": "Insert into Supabase Vectorstore",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
|
||||
"position": [
|
||||
1700,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {
|
||||
"queryName": "match_documents"
|
||||
},
|
||||
"tableName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "documents",
|
||||
"cachedResultName": "documents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1a903b2e-cab0-4798-b820-ec08d6a71ddd",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1380,
|
||||
-100
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "3afd552e-4995-493e-9cd5-ef496dfe359f",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1020,
|
||||
-1020
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "d9688acc-311b-42fd-afa8-2c0e493be34b",
|
||||
"name": "Supabase Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
|
||||
"position": [
|
||||
1020,
|
||||
-660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "file_id",
|
||||
"value": "300b0128-0955-4058-b0d3-a9aefe728432"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tableName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "documents",
|
||||
"cachedResultName": "documents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "t8AQJzvZvrOMDLec",
|
||||
"name": "Supabase account My Airtable Gen"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "66df007c-0418-4551-950e-32e7d79840bd",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 89.3775420487804,
|
||||
"content": "### Replace Storage name, database ID and credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b164b520-20dd-44a4-aa3b-647391786b20",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-20,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8688c219-5af4-4e54-9fd1-91851829445b",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1540,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "45c6ece4-f849-4496-8149-31385f5e36a4",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
840,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 89.3775420487804,
|
||||
"content": "### Replace Storage name, database ID and credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2ca07cb0-b5f4-4761-b954-faf2131872d9",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1500,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d682dae-6f88-42f0-a717-affffd37d882",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
-520
|
||||
],
|
||||
"parameters": {
|
||||
"height": 80,
|
||||
"content": "### Replace credentials."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "796b5dca-d60e-43a9-afe8-194244643557",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-520,
|
||||
-940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [10 min]\n[](https://www.youtube.com/watch?v=glWUkdZe_3w)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eba121de-a3f7-4ba5-8396-f7d64e648322",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-820,
|
||||
-1460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent To Chat With Files In Supabase Storage\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nManually retrieving and analyzing specific information from large document repositories is time-consuming and inefficient. This workflow automates the process by vectorizing documents and enabling AI-powered interactions, making it easy to query and retrieve context-based information from uploaded files.\n\nThe workflow integrates Supabase with an AI-powered chatbot to process, store, and query text and PDF files. The steps include:\n- Fetching and comparing files to avoid duplicate processing.\n- Handling file downloads and extracting content based on the file type.\n- Converting documents into vectorized data for contextual information retrieval.\n- Storing and querying vectorized data from a Supabase vector store.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df054036-d6b9-4f53-86cb-85ad96f07d0e",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-820,
|
||||
-940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n1. **Fetch File List from Supabase**:\n - Use Supabase to retrieve the stored file list from a specified bucket.\n - Add logic to manage empty folder placeholders returned by Supabase, avoiding incorrect processing.\n\n2. **Compare and Filter Files**:\n - Aggregate the files retrieved from storage and compare them to the existing list in the Supabase `files` table.\n - Exclude duplicates and skip placeholder files to ensure only unprocessed files are handled.\n\n3. **Handle File Downloads**:\n - Download new files using detailed storage configurations for public/private access.\n - Adjust the storage settings and GET requests to match your Supabase setup.\n\n4. **File Type Processing**:\n - Use a Switch node to target specific file types (e.g., PDFs or text files).\n - Employ relevant tools to process the content:\n - For PDFs, extract embedded content.\n - For text files, directly process the text data.\n\n5. **Content Chunking**:\n - Break large text data into smaller chunks using the Text Splitter node.\n - Define chunk size (default: 500 tokens) and overlap to retain necessary context across chunks.\n\n6. **Vector Embedding Creation**:\n - Generate vectorized embeddings for the processed content using OpenAI's embedding tools.\n - Ensure metadata, such as file ID, is included for easy data retrieval.\n\n7. **Store Vectorized Data**:\n - Save the vectorized information into a dedicated Supabase vector store.\n - Use the default schema and table provided by Supabase for seamless setup.\n\n8. **AI Chatbot Integration**:\n - Add a chatbot node to handle user input and retrieve relevant document chunks.\n - Use metadata like file ID for targeted queries, especially when multiple documents are involved."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "450a1e49-4be9-451a-9d05-2860e29c3695",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-1160
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 951.7421645394404,
|
||||
"height": 809.7437181509877,
|
||||
"content": "## Scenario 2 - AI agent"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c3814c5d-8881-4598-897e-268019bee1bc",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-260,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 2304.723519246249,
|
||||
"height": 739.2522526116408,
|
||||
"content": "## Scenario 1 - Flow for adding new files from Supabase storage"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"If": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create File record2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Extract Document PDF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get All files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get All Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get All files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
null,
|
||||
[
|
||||
{
|
||||
"node": "If",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI2": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Supabase Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model2": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool1",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool1": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create File record2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Supabase Vectorstore",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract Document PDF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Supabase Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool1",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert into Supabase Vectorstore": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get All Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,319 +0,0 @@
|
||||
{
|
||||
"id": "ITH6r6UYtlCyUcpj",
|
||||
"meta": {
|
||||
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5"
|
||||
},
|
||||
"name": "AI Agent : Google calendar assistant using OpenAI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "2e670a54-f789-4c8b-abba-ae35c458f5ed",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-280,
|
||||
0
|
||||
],
|
||||
"webhookId": "5308edc9-738b-4aae-a789-214e2392579a",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "96bf895f-a18c-4a4c-bc26-3ec5d2372de5",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
160,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "",
|
||||
"name": "OpenAi"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "270176df-9c2d-4f1a-b017-9349cb249341",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
580,
|
||||
820
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "5cdece35-bd69-4c77-b240-963df8781d64",
|
||||
"name": "Google Calendar - Get Events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
960,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"timeMax": "={{ $fromAI('end_date') }}",
|
||||
"timeMin": "={{ $fromAI('start_date') }}"
|
||||
},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"operation": "getAll",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this tool when you’re asked to retrieve events data."
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "634e6472-099c-4f0e-b9eb-67956c4881b8",
|
||||
"name": "Google Calendar - Create events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
1380,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"end": "={{ $fromAI('end_date') }} ",
|
||||
"start": "={{ $fromAI('start_date') }} ",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this Google Calendar tool when you are asked to create an event.",
|
||||
"additionalFields": {
|
||||
"summary": "={{ $fromAI('event_title') }} ",
|
||||
"attendees": [],
|
||||
"description": "={{ $fromAI('event_description') }} "
|
||||
},
|
||||
"useDefaultReminders": false
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "5c93e130-29d5-489b-84ea-3e31f5849b3a",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 320,
|
||||
"height": 560,
|
||||
"content": "## Chat trigger - When a message is received\n\nThis node is the **entry point of the workflow**. \nIt triggers the workflow whenever a message is sent to the **chat interface**.\n\nOptions with n8n:\n- **Embed the chat interface** anywhere you want.\n- Use a **webhook node** instead of this node to connect with interfaces like **[Streamlit](https://docs.streamlit.io/develop/tutorials/llms/build-conversational-apps)** or **[OpenWebUI](https://docs.openwebui.com/)**.\n- Use nodes for communication platforms (**Slack**, **Teams**, **Discord**, etc.) if you know how to configure them.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1e850b4-d0fe-417c-8e1e-13fb4cdbb0a8",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
60,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1520,
|
||||
"height": 560,
|
||||
"content": "## Tools Agent - Calendar AI Agent\n\nThis **node** configures the **AI agent** for interaction with Google Calendar. \nIt includes the following features:\n\n- A **prompt source**: This is the user message derived from the chat input of the preceding node (`When chat message is received`).\n- A **system message**: This defines the system prompt to guide the AI agent's behavior. It incorporates the variable `{{ DateTime.local().toFormat('cccc d LLLL yyyy') }`, allowing the AI agent to determine the current date and interact with Google Calendar accordingly. For example, the agent can understand a request like \"Create an event called 'n8n workflow review' for next Tuesday.\"\n\n\nn8n nodes come with built-in **guardrails**, ensuring that if the user requests tasks outside the AI agent's setup, it may not function as intended. (Feel free to test it!)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9b259245-5fd5-4798-973e-bc6aa15da20f",
|
||||
"name": "Calendar AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
580,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a Google Calendar assistant.\nYour primary goal is to assist the user in managing their calendar effectively using two tools: Event Creation and Event Retrieval. Always base your responses on the current date: \n{{ DateTime.local().toFormat('cccc d LLLL yyyy') }}.\nGeneral Guidelines:\nIf the user's initial message is vague (e.g., \"hello\" or a generic greeting) or does not specify a request, explain your capabilities clearly:\nExample: \"Hello! I can help you manage your Google Calendar. You can ask me to create an event or retrieve event data. What would you like me to do?\"\nIf the user specifies a request in their first message, begin preparing to use the appropriate tool:\nFor event creation, gather necessary details like start date, end date, title, and description.\nFor event retrieval, ask for the date range or time period they want to query.\nTool: Event Creation\nWhen asked to create an event:\n\nRequest the start and end dates/times from the user.\nDate format: YYYY-MM-DD HH:mm:ss\nCollect the following information:\nstart_date: Exact start date and time of the event.\nend_date: Exact end date and time of the event.\nevent_title: Event title in uppercase. Suggest one if not provided.\nevent_description: Generate a brief description and present it for confirmation.\nTool: Event Retrieval\nWhen asked to retrieve events:\n\nAsk for the date range or period they are interested in. Examples:\nFor \"last week,\" retrieve events from Monday of the previous week to Friday of the same week.\nFor \"today,\" use the current date.\nFormat the date range:\nstart_date: Start date and time in YYYY-MM-DD HH:mm:ss.\nend_date: End date and time in YYYY-MM-DD HH:mm:ss.\nKey Behaviors:\nClarity: Provide a clear and helpful introduction when the user's request is unclear.\nValidation: Confirm details with the user before finalizing actions.\nAdaptation: Handle varying levels of detail in requests (e.g., \"Add a meeting for next Monday morning\" or \"Retrieve my events for this weekend\").\nProactivity: Offer suggestions to fill in missing details or clarify ambiguous inputs.\nLanguage Matching: Ensure all interactions, including event titles, descriptions, and messages, are in the user's language to provide a seamless experience."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "b902a7d0-c2ca-4ab9-9f2a-047b9ccb1678",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
60,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## OpenAI chat model\n\nThis node specifies the chat model used by the agent. \nIn the template, the **default LLM is gpt-4o** for its high relevance.\n\nOther options:\n- You can **try gpt-4o-mini**, which is more cost-effective.\n- You can also choose **other LLM providers besides OpenAI**, but make sure the LLM you select **supports tool-calling**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c67e1e1b-ef9a-4fec-a860-4ec6b7439df6",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
460,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Window buffer memory\n\nThis node manages the **memory** of the agent, specifically the **context window length** for chat history. \nThe default is set to 5 messages.\n\nNote: \nThe **memory** is **temporary**. If you want to **store conversations with the agent**, you should use other nodes like **Postgres chat memory**. \nThis can be easily set up with services like **[Supabase](https://supabase.com/)**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bf719d53-e21b-4bd5-9443-c24d008f732b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Google Calendar - Get Events\n\nThis sub-node is a tool used by the AI agent. \nIts purpose is to **retrieve events based on the user input**. \nFor example: *\"Can you give me the events from last week about internal process ?\"*\n\nThe AI agent is designed to **use this tool only** when it has a **date range**. \nIf the user hasn’t provided a date range, the **AI agent will ask the user** for it.\n\nThe **variables** `{{ $fromAI('start_date') }}` and `{{ $fromAI('end_date') }}` are **dynamically filled by the AI**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e94eb1f8-df42-414b-9bec-9e6991a5a832",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1260,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Google Calendar - Create Events\n\nThis sub-node is a tool used by the AI agent. \nIts purpose is to **create events based on the user input**. \nFor example: \"Can you create an event 'Quarter revenue meeting' on [date] from [hour] to [hour] ?\"\n\nThe AI agent is designed to **use this tool only** when it has a **date range**. \nIf the user hasn’t provided a **date range**, the AI agent will **ask the user** for it. \nThe variables `{{ $fromAI('start_date') }}` and `{{ $fromAI('end_date') }}` are dynamically filled by the AI.\n\nBefore creating the event, the AI agent will **confirm with the user** if the **title** and **description** of the event are correct. \nThe variables used for this are:\n- `{{ $fromAI('event_title') }}`\n- `{{ $fromAI('event_description') }}`\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "707c011c-c822-4922-8ef7-c4368947d179",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
1000
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 720,
|
||||
"height": 380,
|
||||
"content": "## Having fun with it ? Here’s how to level up this AI agent ! \n\nThis workflow demonstrates **how easily you can set up an AI agent to call tools** for you using **n8n**. \nThe tasks here are **useful but very basic**. \n\nIf you want to **enhance the tool-calling capabilities**, consider the following:\n\n- Explore the **\"options\"** in the Google Calendar nodes to see additional features you can use. \n For example, let the AI agent add attendees to events it creates.\n\n- Implement the AI agent with your **teammates and link it to each calendar**. \n Use a `{{ $fromAI('') }}` variable for the calendar field and refine the prompts to suit your needs.\n\n- Add **more actions** for the AI agent to perform with the **Google Calendar API**, expanding its functionality.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"timezone": "Europe/Paris",
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "25b51038-e103-4be6-bcd1-64df4b90d4c6",
|
||||
"connections": {
|
||||
"Calendar AI Agent": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Get Events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Create events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
{
|
||||
"id": "ITH6r6UYtlCyUcpj",
|
||||
"meta": {
|
||||
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5"
|
||||
},
|
||||
"name": "AI Agent : Google calendar assistant using OpenAI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "2e670a54-f789-4c8b-abba-ae35c458f5ed",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-280,
|
||||
0
|
||||
],
|
||||
"webhookId": "5308edc9-738b-4aae-a789-214e2392579a",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "96bf895f-a18c-4a4c-bc26-3ec5d2372de5",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
160,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "",
|
||||
"name": "OpenAi"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "270176df-9c2d-4f1a-b017-9349cb249341",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
580,
|
||||
820
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "5cdece35-bd69-4c77-b240-963df8781d64",
|
||||
"name": "Google Calendar - Get Events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
960,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"timeMax": "={{ $fromAI('end_date') }}",
|
||||
"timeMin": "={{ $fromAI('start_date') }}"
|
||||
},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"operation": "getAll",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this tool when you’re asked to retrieve events data."
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "634e6472-099c-4f0e-b9eb-67956c4881b8",
|
||||
"name": "Google Calendar - Create events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
1380,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"end": "={{ $fromAI('end_date') }} ",
|
||||
"start": "={{ $fromAI('start_date') }} ",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this Google Calendar tool when you are asked to create an event.",
|
||||
"additionalFields": {
|
||||
"summary": "={{ $fromAI('event_title') }} ",
|
||||
"attendees": [],
|
||||
"description": "={{ $fromAI('event_description') }} "
|
||||
},
|
||||
"useDefaultReminders": false
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "5c93e130-29d5-489b-84ea-3e31f5849b3a",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 320,
|
||||
"height": 560,
|
||||
"content": "## Chat trigger - When a message is received\n\nThis node is the **entry point of the workflow**. \nIt triggers the workflow whenever a message is sent to the **chat interface**.\n\nOptions with n8n:\n- **Embed the chat interface** anywhere you want.\n- Use a **webhook node** instead of this node to connect with interfaces like **[Streamlit](https://docs.streamlit.io/develop/tutorials/llms/build-conversational-apps)** or **[OpenWebUI](https://docs.openwebui.com/)**.\n- Use nodes for communication platforms (**Slack**, **Teams**, **Discord**, etc.) if you know how to configure them.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1e850b4-d0fe-417c-8e1e-13fb4cdbb0a8",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
60,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1520,
|
||||
"height": 560,
|
||||
"content": "## Tools Agent - Calendar AI Agent\n\nThis **node** configures the **AI agent** for interaction with Google Calendar. \nIt includes the following features:\n\n- A **prompt source**: This is the user message derived from the chat input of the preceding node (`When chat message is received`).\n- A **system message**: This defines the system prompt to guide the AI agent's behavior. It incorporates the variable `{{ DateTime.local().toFormat('cccc d LLLL yyyy') }`, allowing the AI agent to determine the current date and interact with Google Calendar accordingly. For example, the agent can understand a request like \"Create an event called 'n8n workflow review' for next Tuesday.\"\n\n\nn8n nodes come with built-in **guardrails**, ensuring that if the user requests tasks outside the AI agent's setup, it may not function as intended. (Feel free to test it!)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9b259245-5fd5-4798-973e-bc6aa15da20f",
|
||||
"name": "Calendar AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
580,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a Google Calendar assistant.\nYour primary goal is to assist the user in managing their calendar effectively using two tools: Event Creation and Event Retrieval. Always base your responses on the current date: \n{{ DateTime.local().toFormat('cccc d LLLL yyyy') }}.\nGeneral Guidelines:\nIf the user's initial message is vague (e.g., \"hello\" or a generic greeting) or does not specify a request, explain your capabilities clearly:\nExample: \"Hello! I can help you manage your Google Calendar. You can ask me to create an event or retrieve event data. What would you like me to do?\"\nIf the user specifies a request in their first message, begin preparing to use the appropriate tool:\nFor event creation, gather necessary details like start date, end date, title, and description.\nFor event retrieval, ask for the date range or time period they want to query.\nTool: Event Creation\nWhen asked to create an event:\n\nRequest the start and end dates/times from the user.\nDate format: YYYY-MM-DD HH:mm:ss\nCollect the following information:\nstart_date: Exact start date and time of the event.\nend_date: Exact end date and time of the event.\nevent_title: Event title in uppercase. Suggest one if not provided.\nevent_description: Generate a brief description and present it for confirmation.\nTool: Event Retrieval\nWhen asked to retrieve events:\n\nAsk for the date range or period they are interested in. Examples:\nFor \"last week,\" retrieve events from Monday of the previous week to Friday of the same week.\nFor \"today,\" use the current date.\nFormat the date range:\nstart_date: Start date and time in YYYY-MM-DD HH:mm:ss.\nend_date: End date and time in YYYY-MM-DD HH:mm:ss.\nKey Behaviors:\nClarity: Provide a clear and helpful introduction when the user's request is unclear.\nValidation: Confirm details with the user before finalizing actions.\nAdaptation: Handle varying levels of detail in requests (e.g., \"Add a meeting for next Monday morning\" or \"Retrieve my events for this weekend\").\nProactivity: Offer suggestions to fill in missing details or clarify ambiguous inputs.\nLanguage Matching: Ensure all interactions, including event titles, descriptions, and messages, are in the user's language to provide a seamless experience."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "b902a7d0-c2ca-4ab9-9f2a-047b9ccb1678",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
60,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## OpenAI chat model\n\nThis node specifies the chat model used by the agent. \nIn the template, the **default LLM is gpt-4o** for its high relevance.\n\nOther options:\n- You can **try gpt-4o-mini**, which is more cost-effective.\n- You can also choose **other LLM providers besides OpenAI**, but make sure the LLM you select **supports tool-calling**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c67e1e1b-ef9a-4fec-a860-4ec6b7439df6",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
460,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Window buffer memory\n\nThis node manages the **memory** of the agent, specifically the **context window length** for chat history. \nThe default is set to 5 messages.\n\nNote: \nThe **memory** is **temporary**. If you want to **store conversations with the agent**, you should use other nodes like **Postgres chat memory**. \nThis can be easily set up with services like **[Supabase](https://supabase.com/)**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bf719d53-e21b-4bd5-9443-c24d008f732b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Google Calendar - Get Events\n\nThis sub-node is a tool used by the AI agent. \nIts purpose is to **retrieve events based on the user input**. \nFor example: *\"Can you give me the events from last week about internal process ?\"*\n\nThe AI agent is designed to **use this tool only** when it has a **date range**. \nIf the user hasn’t provided a date range, the **AI agent will ask the user** for it.\n\nThe **variables** `{{ $fromAI('start_date') }}` and `{{ $fromAI('end_date') }}` are **dynamically filled by the AI**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e94eb1f8-df42-414b-9bec-9e6991a5a832",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1260,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 320,
|
||||
"height": 720,
|
||||
"content": "## Google Calendar - Create Events\n\nThis sub-node is a tool used by the AI agent. \nIts purpose is to **create events based on the user input**. \nFor example: \"Can you create an event 'Quarter revenue meeting' on [date] from [hour] to [hour] ?\"\n\nThe AI agent is designed to **use this tool only** when it has a **date range**. \nIf the user hasn’t provided a **date range**, the AI agent will **ask the user** for it. \nThe variables `{{ $fromAI('start_date') }}` and `{{ $fromAI('end_date') }}` are dynamically filled by the AI.\n\nBefore creating the event, the AI agent will **confirm with the user** if the **title** and **description** of the event are correct. \nThe variables used for this are:\n- `{{ $fromAI('event_title') }}`\n- `{{ $fromAI('event_description') }}`\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "707c011c-c822-4922-8ef7-c4368947d179",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
1000
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 720,
|
||||
"height": 380,
|
||||
"content": "## Having fun with it ? Here’s how to level up this AI agent ! \n\nThis workflow demonstrates **how easily you can set up an AI agent to call tools** for you using **n8n**. \nThe tasks here are **useful but very basic**. \n\nIf you want to **enhance the tool-calling capabilities**, consider the following:\n\n- Explore the **\"options\"** in the Google Calendar nodes to see additional features you can use. \n For example, let the AI agent add attendees to events it creates.\n\n- Implement the AI agent with your **teammates and link it to each calendar**. \n Use a `{{ $fromAI('') }}` variable for the calendar field and refine the prompts to suit your needs.\n\n- Add **more actions** for the AI agent to perform with the **Google Calendar API**, expanding its functionality.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"timezone": "Europe/Paris",
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "25b51038-e103-4be6-bcd1-64df4b90d4c6",
|
||||
"connections": {
|
||||
"Calendar AI Agent": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Get Events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Create events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,580 +0,0 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d44489b8-8cb7-4776-8c16-a8bb01e52171",
|
||||
"name": "OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
300,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ \n JSON.parse($('Insert Transcription Part').item.json.dialog)\n .filter(item => item.date_updated && new Date(item.date_updated) >= new Date($('Insert Transcription Part').item.json.date_updated))\n .sort((a, b) => a.order - b.order)\n .map(item => `${item.words}\\n${item.speaker}`)\n .join('\\n\\n')\n}}",
|
||||
"memory": "threadId",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"threadId": "={{ $json.thread_id }}",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_D5t6bNnNpenmfC7PmvywMqyR",
|
||||
"cachedResultName": "5minAI - Realtime Agent"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "3425f1c1-ad68-495e-bb9a-95ea92e7cf23",
|
||||
"name": "Insert Transcription Part",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"position": [
|
||||
-120,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"query": "UPDATE public.data\nSET output = jsonb_set(\n output,\n '{dialog}', \n (\n COALESCE(\n (output->'dialog')::jsonb, \n '[]'::jsonb -- Initialize as empty array if dialog does not exist\n ) || jsonb_build_object(\n 'order', (COALESCE(jsonb_array_length(output->'dialog'), 0) + 1), -- Calculate the next order\n 'words', '{{ $('Webhook2').item.json.body.data.transcript.words.map(word => word.text.replace(/'/g, \"''\")).join(\" \") }}',\n 'speaker', '{{ $('Webhook2').item.json.body.data.transcript.speaker }}',\n 'language', '{{ $('Webhook2').item.json.body.data.transcript.language }}',\n 'speaker_id', ('{{ $('Webhook2').item.json.body.data.transcript.speaker_id }}')::int,\n 'date_updated', to_jsonb('{{ $now }}'::text)\n )\n )\n)\nWHERE input->>'recall_bot_id' = $1\nReturning input->>'openai_thread_id' as thread_id;",
|
||||
"options": {
|
||||
"queryReplacement": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.bot_id }}"
|
||||
},
|
||||
"operation": "executeQuery"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "9bcc0605-fc35-4842-a3f4-30ef902f35c1",
|
||||
"name": "Create Note",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"query": "UPDATE public.data\nSET output = jsonb_set(\n output,\n '{notes}', \n (\n COALESCE(\n (output->'notes')::jsonb, \n '[]'::jsonb -- Initialize as empty array if dialog does not exist\n ) || jsonb_build_object(\n 'order', (COALESCE(jsonb_array_length(output->'notes'), 0) + 1), -- Calculate the next order\n 'text', '{{ $fromAI(\"note\",\"Text of note.\") }}'\n )\n )\n)\nWHERE input->>'recall_bot_id' = $1",
|
||||
"options": {
|
||||
"queryReplacement": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.bot_id }}"
|
||||
},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Create note record."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "0831c139-ca4b-4b4c-aa7f-7495c4ca0110",
|
||||
"name": "Create Recall bot",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-60,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://us-west-2.recall.ai/api/v1/bot",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"meeting_url\":\"{{ $json.meeting_url }}\",\n \"transcription_options\": {\n \"provider\": \"assembly_ai\"\n }\n,\n\"real_time_transcription\": {\n \"destination_url\": \"https://n8n.lowcoding.dev/webhook/d074ca1e-52f9-47af-8587-8c24d431f9cd\"\n },\n\"automatic_leave\": {\n \"silence_detection\": {\n \"timeout\": 300, \n \"activate_after\": 600\n },\n \"bot_detection\": {\n \"using_participant_events\": {\n \"timeout\": 600, \n \"activate_after\": 1200\n }\n },\n \"waiting_room_timeout\": 600,\n \"noone_joined_timeout\": 600,\n \"everyone_left_timeout\": 2,\n \"in_call_not_recording_timeout\": 600,\n \"recording_permission_denied_timeout\": 600\n}\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "lfHu7Kn7L7SH3LAF",
|
||||
"name": "Recall"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "e1122b5b-3af5-4836-802c-40c3a0eb3c93",
|
||||
"name": "Create OpenAI thread",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
140,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/threads",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "OpenAI-Beta",
|
||||
"value": "assistants=v2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "784c123d-adbb-4265-9485-2c88dd3091c2",
|
||||
"name": "Create data record",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
320,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "data",
|
||||
"fieldsUi": {
|
||||
"fieldValues": [
|
||||
{
|
||||
"fieldId": "input",
|
||||
"fieldValue": "={{ {\"openai_thread_id\": $('Create OpenAI thread').item.json.id, \"recall_bot_id\": $('Create Recall bot').item.json.id, \"meeting_url\":$('Webhook').item.json.body.meeting_url } }}"
|
||||
},
|
||||
{
|
||||
"fieldId": "output",
|
||||
"fieldValue": "={{ {\"dialog\":[]} }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "iVKNf5qv3ZFhq0ZV",
|
||||
"name": "Supabase 5minAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f455c7de-1e64-4a28-9eef-11d19c982813",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-900,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [10 min]\n[](https://www.youtube.com/watch?v=rtaX6BMiTeo)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ea90c110-18ad-4f4b-90ab-fcb88b92e709",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
-1060
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636,
|
||||
"height": 657,
|
||||
"content": "\n## AI Agent for realtime insights on meetings\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai)**\n\nTranscribing meetings manually can be tedious and prone to error. This workflow automates the transcription process in real-time, ensuring that key discussions and decisions are accurately captured and easily accessible for later review, thus enhancing productivity and clarity in communications.\n\nThe workflow employs an AI-powered assistant to join virtual meetings and capture discussions through real-time transcription. Key functionalities include:\n- Automatic joining of meetings on platforms like Zoom, Google Meet, and others with the ability to provide real-time transcription.\n- Integration with transcription APIs (e.g., AssemblyAI) to deliver seamless and accurate capture of dialogue.\n- Structuring and storing transcriptions efficiently in a database for easy retrieval and analysis.\n\n1. **Real-Time Transcription**: The assistant captures audio during meetings and transcribes it in real-time, allowing participants to focus on discussions.\n2. **Keyword Recognition**: Key phrases can trigger specific actions, such as noting important points or making prompts to the assistant.\n3. **Structured Data Management**: The assistant maintains a database of transcriptions linked to meeting details for organized storage and quick access later."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "378c19bb-0e4a-43d3-9ba5-2a77ebfb5b83",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280,
|
||||
"height": 626,
|
||||
"content": "### Set up steps\n\n#### Preparation\n\n1. **Create Recall.ai API key**\n2. **Setup Supabase account and table**\n```\ncreate table\n public.data (\n id uuid not null default gen_random_uuid (),\n date_created timestamp with time zone not null default (now() at time zone 'utc'::text),\n input jsonb null,\n output jsonb null,\n constraint data_pkey primary key (id),\n ) tablespace pg_default;\n\n```\n3. **Create OpenAI API key**\n\n#### Development\n\n1. **Bot Creation**: \n - Use a node to create the bot that will join meetings. Provide the meeting URL and set transcription options within the API request.\n\n2. **Authentication**: \n - Configure authentication settings via a Bearer token for interacting with your transcription service.\n\n3. **Webhook Setup**: \n - Create a webhook to receive real-time transcription updates, ensuring timely data capture during meetings.\n\n4. **Join Meeting**: \n - Set the bot to join the specified meeting and actively listen to capture conversations.\n\n5. **Transcription Handling**: \n - Combine transcription fragments into cohesive sentences and manage dialog arrays for coherence.\n\n6. **Trigger Actions on Keywords**: \n - Set up keyword recognition that can initiate requests to the OpenAI API for additional interactions based on captured dialogue.\n\n7. **Output and Summary Generation**: \n - Produce insights and summary notes from the transcriptions that can be stored back into the database for future reference."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a4ff741-ccfd-42e9-883e-43297a73e2c3",
|
||||
"name": "Scenario 1 Start - Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-260,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4891fa6e-2dd5-4433-925c-5497ec82e8ab",
|
||||
"name": "meeting_url",
|
||||
"type": "string",
|
||||
"value": "https://meet.google.com/iix-vrav-kuc"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "a4368763-b96e-45e7-884d-aa0cbae2d276",
|
||||
"name": "Scenario 2 Start - Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-320,
|
||||
-300
|
||||
],
|
||||
"webhookId": "7f176935-cb83-4147-ac14-48c8d747863a",
|
||||
"parameters": {
|
||||
"path": "d074ca1e-52f9-47af-8587-8c24d431f9cd",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "107b26af-d1d2-40c7-ad4f-7193d3ae9b70",
|
||||
"name": "If Jimmy word",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
80,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ba6c2ae5-d0f4-4242-9cf8-97cb84335a93",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.transcript.words.map(word => word.text.replace(/'/g, \"''\")).join(\" \") }}",
|
||||
"rightValue": "=Jimmy"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "49cf34f6-86cf-42cc-9da4-3efb37e6f565",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-1040
|
||||
],
|
||||
"parameters": {
|
||||
"width": 920,
|
||||
"height": 400,
|
||||
"content": "## Scenario 1\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "34660f39-6ecc-4f2d-98e8-a2c529255e98",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1020,
|
||||
"height": 420,
|
||||
"content": "## Scenario 2\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5027e72d-2b2c-40b4-921e-c4f40d85f251",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-200,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 270,
|
||||
"height": 80,
|
||||
"content": "### Replace Supabase credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dddea341-da40-4b6a-ae25-a8417e869cc9",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-100,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 200,
|
||||
"height": 80,
|
||||
"content": "### Replace server location\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8e76c2a-f949-400e-92b2-39da8034b471",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 270,
|
||||
"height": 80,
|
||||
"content": "### Replace OpenAI credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "729a5f6e-5aea-4908-9a82-2a7d7bea1322",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 290,
|
||||
"height": 80,
|
||||
"content": "### Replace credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "31178e90-62ce-4bf8-8381-dc8138088889",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-320,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 200,
|
||||
"height": 80,
|
||||
"content": "### Replace meeting url\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Create Recall bot": [
|
||||
{
|
||||
"id": "ab35fa56-e42b-47c6-b716-eac8d12af601",
|
||||
"join_at": null,
|
||||
"metadata": {},
|
||||
"recording": null,
|
||||
"video_url": null,
|
||||
"recordings": [],
|
||||
"meeting_url": {
|
||||
"platform": "google_meet",
|
||||
"meeting_id": "zst-ymag-zoa"
|
||||
},
|
||||
"status_changes": [
|
||||
{
|
||||
"code": "ready",
|
||||
"message": null,
|
||||
"sub_code": null,
|
||||
"created_at": "2024-11-01T11:29:32.364684Z"
|
||||
}
|
||||
],
|
||||
"meeting_metadata": null,
|
||||
"calendar_meetings": [],
|
||||
"meeting_participants": []
|
||||
}
|
||||
],
|
||||
"Insert Transcription Part": [
|
||||
{
|
||||
"dialog": "[{\"order\": 1, \"words\": \"Wait.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 2, \"words\": \"A bit.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 3, \"words\": \"It's not even subtitles and it's not even a real. It's. A Google Meet.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 4, \"words\": \"Same story. I wasn't prepared. I don't know what to tell you. Maybe my AI body can help me.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 5, \"words\": \"What truth?\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 6, \"words\": \"You can get the same AI body in one day. Just drop AI in comment and I will. Send you a guide.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 7, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 8, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 9, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 10, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 11, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 12, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100, \"date_updated\": \"2024-11-22T08:41:24.164+01:00\"}, {\"order\": 13, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100, \"date_updated\": \"2024-11-22T08:50:11.330+01:00\"}]",
|
||||
"thread_id": "thread_0g7p3iE7MYmDPiUuPiZP5vfR",
|
||||
"date_updated": "2024-11-22T08:37:55.751+01:00"
|
||||
}
|
||||
],
|
||||
"Scenario 2 Start - Webhook": [
|
||||
{
|
||||
"body": {
|
||||
"data": {
|
||||
"bot_id": "0032c6e2-78e9-46e7-a2ef-41d7b853ef48",
|
||||
"transcript": {
|
||||
"words": [
|
||||
{
|
||||
"text": "Let's",
|
||||
"end_time": 11.88,
|
||||
"start_time": 11.68
|
||||
},
|
||||
{
|
||||
"text": "it",
|
||||
"end_time": 12.12,
|
||||
"start_time": 11.88
|
||||
},
|
||||
{
|
||||
"text": "works",
|
||||
"end_time": 12.44,
|
||||
"start_time": 12.12
|
||||
},
|
||||
{
|
||||
"text": "well.",
|
||||
"end_time": 12.48,
|
||||
"start_time": 12.44
|
||||
}
|
||||
],
|
||||
"source": "smart_annotator",
|
||||
"speaker": "Mark S.",
|
||||
"is_final": true,
|
||||
"language": null,
|
||||
"speaker_id": 100,
|
||||
"original_transcript_id": 32
|
||||
},
|
||||
"recording_id": "ee1ad589-39fe-4ed5-b96f-cd14c63f3bc2"
|
||||
},
|
||||
"event": "bot.transcription"
|
||||
},
|
||||
"query": {},
|
||||
"params": {},
|
||||
"headers": {
|
||||
"host": "n8n.lowcoding.dev",
|
||||
"accept": "*/*",
|
||||
"content-type": "application/json",
|
||||
"content-length": "495",
|
||||
"accept-encoding": "gzip",
|
||||
"x-forwarded-for": "52.10.191.34",
|
||||
"x-forwarded-host": "n8n.lowcoding.dev",
|
||||
"x-forwarded-proto": "https"
|
||||
},
|
||||
"webhookUrl": "https://n8n.lowcoding.dev/webhook/d074ca1e-52f9-47af-8587-8c24d431f9cd",
|
||||
"executionMode": "production"
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"OpenAI1": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create Note": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI1",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If Jimmy word": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Recall bot": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create OpenAI thread",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create data record": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create OpenAI thread": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create data record",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert Transcription Part": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If Jimmy word",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Scenario 2 Start - Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Transcription Part",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Scenario 1 Start - Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Recall bot",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
580
OpenAI_and_LLMs/AI Agent for realtime insights on meetings.txt
Normal file
580
OpenAI_and_LLMs/AI Agent for realtime insights on meetings.txt
Normal file
@@ -0,0 +1,580 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d44489b8-8cb7-4776-8c16-a8bb01e52171",
|
||||
"name": "OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
300,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ \n JSON.parse($('Insert Transcription Part').item.json.dialog)\n .filter(item => item.date_updated && new Date(item.date_updated) >= new Date($('Insert Transcription Part').item.json.date_updated))\n .sort((a, b) => a.order - b.order)\n .map(item => `${item.words}\\n${item.speaker}`)\n .join('\\n\\n')\n}}",
|
||||
"memory": "threadId",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"threadId": "={{ $json.thread_id }}",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_D5t6bNnNpenmfC7PmvywMqyR",
|
||||
"cachedResultName": "5minAI - Realtime Agent"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "3425f1c1-ad68-495e-bb9a-95ea92e7cf23",
|
||||
"name": "Insert Transcription Part",
|
||||
"type": "n8n-nodes-base.postgres",
|
||||
"position": [
|
||||
-120,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"query": "UPDATE public.data\nSET output = jsonb_set(\n output,\n '{dialog}', \n (\n COALESCE(\n (output->'dialog')::jsonb, \n '[]'::jsonb -- Initialize as empty array if dialog does not exist\n ) || jsonb_build_object(\n 'order', (COALESCE(jsonb_array_length(output->'dialog'), 0) + 1), -- Calculate the next order\n 'words', '{{ $('Webhook2').item.json.body.data.transcript.words.map(word => word.text.replace(/'/g, \"''\")).join(\" \") }}',\n 'speaker', '{{ $('Webhook2').item.json.body.data.transcript.speaker }}',\n 'language', '{{ $('Webhook2').item.json.body.data.transcript.language }}',\n 'speaker_id', ('{{ $('Webhook2').item.json.body.data.transcript.speaker_id }}')::int,\n 'date_updated', to_jsonb('{{ $now }}'::text)\n )\n )\n)\nWHERE input->>'recall_bot_id' = $1\nReturning input->>'openai_thread_id' as thread_id;",
|
||||
"options": {
|
||||
"queryReplacement": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.bot_id }}"
|
||||
},
|
||||
"operation": "executeQuery"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "9bcc0605-fc35-4842-a3f4-30ef902f35c1",
|
||||
"name": "Create Note",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"query": "UPDATE public.data\nSET output = jsonb_set(\n output,\n '{notes}', \n (\n COALESCE(\n (output->'notes')::jsonb, \n '[]'::jsonb -- Initialize as empty array if dialog does not exist\n ) || jsonb_build_object(\n 'order', (COALESCE(jsonb_array_length(output->'notes'), 0) + 1), -- Calculate the next order\n 'text', '{{ $fromAI(\"note\",\"Text of note.\") }}'\n )\n )\n)\nWHERE input->>'recall_bot_id' = $1",
|
||||
"options": {
|
||||
"queryReplacement": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.bot_id }}"
|
||||
},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Create note record."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "0831c139-ca4b-4b4c-aa7f-7495c4ca0110",
|
||||
"name": "Create Recall bot",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-60,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://us-west-2.recall.ai/api/v1/bot",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"meeting_url\":\"{{ $json.meeting_url }}\",\n \"transcription_options\": {\n \"provider\": \"assembly_ai\"\n }\n,\n\"real_time_transcription\": {\n \"destination_url\": \"https://n8n.lowcoding.dev/webhook/d074ca1e-52f9-47af-8587-8c24d431f9cd\"\n },\n\"automatic_leave\": {\n \"silence_detection\": {\n \"timeout\": 300, \n \"activate_after\": 600\n },\n \"bot_detection\": {\n \"using_participant_events\": {\n \"timeout\": 600, \n \"activate_after\": 1200\n }\n },\n \"waiting_room_timeout\": 600,\n \"noone_joined_timeout\": 600,\n \"everyone_left_timeout\": 2,\n \"in_call_not_recording_timeout\": 600,\n \"recording_permission_denied_timeout\": 600\n}\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "lfHu7Kn7L7SH3LAF",
|
||||
"name": "Recall"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "e1122b5b-3af5-4836-802c-40c3a0eb3c93",
|
||||
"name": "Create OpenAI thread",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
140,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/threads",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "OpenAI-Beta",
|
||||
"value": "assistants=v2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "SphXAX7rlwRLkiox",
|
||||
"name": "Test club key"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "784c123d-adbb-4265-9485-2c88dd3091c2",
|
||||
"name": "Create data record",
|
||||
"type": "n8n-nodes-base.supabase",
|
||||
"position": [
|
||||
320,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"tableId": "data",
|
||||
"fieldsUi": {
|
||||
"fieldValues": [
|
||||
{
|
||||
"fieldId": "input",
|
||||
"fieldValue": "={{ {\"openai_thread_id\": $('Create OpenAI thread').item.json.id, \"recall_bot_id\": $('Create Recall bot').item.json.id, \"meeting_url\":$('Webhook').item.json.body.meeting_url } }}"
|
||||
},
|
||||
{
|
||||
"fieldId": "output",
|
||||
"fieldValue": "={{ {\"dialog\":[]} }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"supabaseApi": {
|
||||
"id": "iVKNf5qv3ZFhq0ZV",
|
||||
"name": "Supabase 5minAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f455c7de-1e64-4a28-9eef-11d19c982813",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-900,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [10 min]\n[](https://www.youtube.com/watch?v=rtaX6BMiTeo)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ea90c110-18ad-4f4b-90ab-fcb88b92e709",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
-1060
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636,
|
||||
"height": 657,
|
||||
"content": "\n## AI Agent for realtime insights on meetings\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai)**\n\nTranscribing meetings manually can be tedious and prone to error. This workflow automates the transcription process in real-time, ensuring that key discussions and decisions are accurately captured and easily accessible for later review, thus enhancing productivity and clarity in communications.\n\nThe workflow employs an AI-powered assistant to join virtual meetings and capture discussions through real-time transcription. Key functionalities include:\n- Automatic joining of meetings on platforms like Zoom, Google Meet, and others with the ability to provide real-time transcription.\n- Integration with transcription APIs (e.g., AssemblyAI) to deliver seamless and accurate capture of dialogue.\n- Structuring and storing transcriptions efficiently in a database for easy retrieval and analysis.\n\n1. **Real-Time Transcription**: The assistant captures audio during meetings and transcribes it in real-time, allowing participants to focus on discussions.\n2. **Keyword Recognition**: Key phrases can trigger specific actions, such as noting important points or making prompts to the assistant.\n3. **Structured Data Management**: The assistant maintains a database of transcriptions linked to meeting details for organized storage and quick access later."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "378c19bb-0e4a-43d3-9ba5-2a77ebfb5b83",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1200,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280,
|
||||
"height": 626,
|
||||
"content": "### Set up steps\n\n#### Preparation\n\n1. **Create Recall.ai API key**\n2. **Setup Supabase account and table**\n```\ncreate table\n public.data (\n id uuid not null default gen_random_uuid (),\n date_created timestamp with time zone not null default (now() at time zone 'utc'::text),\n input jsonb null,\n output jsonb null,\n constraint data_pkey primary key (id),\n ) tablespace pg_default;\n\n```\n3. **Create OpenAI API key**\n\n#### Development\n\n1. **Bot Creation**: \n - Use a node to create the bot that will join meetings. Provide the meeting URL and set transcription options within the API request.\n\n2. **Authentication**: \n - Configure authentication settings via a Bearer token for interacting with your transcription service.\n\n3. **Webhook Setup**: \n - Create a webhook to receive real-time transcription updates, ensuring timely data capture during meetings.\n\n4. **Join Meeting**: \n - Set the bot to join the specified meeting and actively listen to capture conversations.\n\n5. **Transcription Handling**: \n - Combine transcription fragments into cohesive sentences and manage dialog arrays for coherence.\n\n6. **Trigger Actions on Keywords**: \n - Set up keyword recognition that can initiate requests to the OpenAI API for additional interactions based on captured dialogue.\n\n7. **Output and Summary Generation**: \n - Produce insights and summary notes from the transcriptions that can be stored back into the database for future reference."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a4ff741-ccfd-42e9-883e-43297a73e2c3",
|
||||
"name": "Scenario 1 Start - Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-260,
|
||||
-980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4891fa6e-2dd5-4433-925c-5497ec82e8ab",
|
||||
"name": "meeting_url",
|
||||
"type": "string",
|
||||
"value": "https://meet.google.com/iix-vrav-kuc"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "a4368763-b96e-45e7-884d-aa0cbae2d276",
|
||||
"name": "Scenario 2 Start - Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-320,
|
||||
-300
|
||||
],
|
||||
"webhookId": "7f176935-cb83-4147-ac14-48c8d747863a",
|
||||
"parameters": {
|
||||
"path": "d074ca1e-52f9-47af-8587-8c24d431f9cd",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "107b26af-d1d2-40c7-ad4f-7193d3ae9b70",
|
||||
"name": "If Jimmy word",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
80,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ba6c2ae5-d0f4-4242-9cf8-97cb84335a93",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $('Scenario 2 Start - Webhook').item.json.body.data.transcript.words.map(word => word.text.replace(/'/g, \"''\")).join(\" \") }}",
|
||||
"rightValue": "=Jimmy"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "49cf34f6-86cf-42cc-9da4-3efb37e6f565",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-1040
|
||||
],
|
||||
"parameters": {
|
||||
"width": 920,
|
||||
"height": 400,
|
||||
"content": "## Scenario 1\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "34660f39-6ecc-4f2d-98e8-a2c529255e98",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-380,
|
||||
-360
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1020,
|
||||
"height": 420,
|
||||
"content": "## Scenario 2\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5027e72d-2b2c-40b4-921e-c4f40d85f251",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-200,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 270,
|
||||
"height": 80,
|
||||
"content": "### Replace Supabase credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dddea341-da40-4b6a-ae25-a8417e869cc9",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-100,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 200,
|
||||
"height": 80,
|
||||
"content": "### Replace server location\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8e76c2a-f949-400e-92b2-39da8034b471",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 270,
|
||||
"height": 80,
|
||||
"content": "### Replace OpenAI credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "729a5f6e-5aea-4908-9a82-2a7d7bea1322",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 290,
|
||||
"height": 80,
|
||||
"content": "### Replace credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "31178e90-62ce-4bf8-8381-dc8138088889",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-320,
|
||||
-780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 200,
|
||||
"height": 80,
|
||||
"content": "### Replace meeting url\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {
|
||||
"Create Recall bot": [
|
||||
{
|
||||
"id": "ab35fa56-e42b-47c6-b716-eac8d12af601",
|
||||
"join_at": null,
|
||||
"metadata": {},
|
||||
"recording": null,
|
||||
"video_url": null,
|
||||
"recordings": [],
|
||||
"meeting_url": {
|
||||
"platform": "google_meet",
|
||||
"meeting_id": "zst-ymag-zoa"
|
||||
},
|
||||
"status_changes": [
|
||||
{
|
||||
"code": "ready",
|
||||
"message": null,
|
||||
"sub_code": null,
|
||||
"created_at": "2024-11-01T11:29:32.364684Z"
|
||||
}
|
||||
],
|
||||
"meeting_metadata": null,
|
||||
"calendar_meetings": [],
|
||||
"meeting_participants": []
|
||||
}
|
||||
],
|
||||
"Insert Transcription Part": [
|
||||
{
|
||||
"dialog": "[{\"order\": 1, \"words\": \"Wait.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 2, \"words\": \"A bit.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 3, \"words\": \"It's not even subtitles and it's not even a real. It's. A Google Meet.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 4, \"words\": \"Same story. I wasn't prepared. I don't know what to tell you. Maybe my AI body can help me.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 5, \"words\": \"What truth?\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 6, \"words\": \"You can get the same AI body in one day. Just drop AI in comment and I will. Send you a guide.\", \"speaker\": \"Mark S.\", \"language\": null, \"speaker_id\": 100}, {\"order\": 7, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 8, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 9, \"words\": \"As it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 10, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 11, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100}, {\"order\": 12, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100, \"date_updated\": \"2024-11-22T08:41:24.164+01:00\"}, {\"order\": 13, \"words\": \"Let's it works well.\", \"speaker\": \"Mark S.\", \"language\": \"null\", \"speaker_id\": 100, \"date_updated\": \"2024-11-22T08:50:11.330+01:00\"}]",
|
||||
"thread_id": "thread_0g7p3iE7MYmDPiUuPiZP5vfR",
|
||||
"date_updated": "2024-11-22T08:37:55.751+01:00"
|
||||
}
|
||||
],
|
||||
"Scenario 2 Start - Webhook": [
|
||||
{
|
||||
"body": {
|
||||
"data": {
|
||||
"bot_id": "0032c6e2-78e9-46e7-a2ef-41d7b853ef48",
|
||||
"transcript": {
|
||||
"words": [
|
||||
{
|
||||
"text": "Let's",
|
||||
"end_time": 11.88,
|
||||
"start_time": 11.68
|
||||
},
|
||||
{
|
||||
"text": "it",
|
||||
"end_time": 12.12,
|
||||
"start_time": 11.88
|
||||
},
|
||||
{
|
||||
"text": "works",
|
||||
"end_time": 12.44,
|
||||
"start_time": 12.12
|
||||
},
|
||||
{
|
||||
"text": "well.",
|
||||
"end_time": 12.48,
|
||||
"start_time": 12.44
|
||||
}
|
||||
],
|
||||
"source": "smart_annotator",
|
||||
"speaker": "Mark S.",
|
||||
"is_final": true,
|
||||
"language": null,
|
||||
"speaker_id": 100,
|
||||
"original_transcript_id": 32
|
||||
},
|
||||
"recording_id": "ee1ad589-39fe-4ed5-b96f-cd14c63f3bc2"
|
||||
},
|
||||
"event": "bot.transcription"
|
||||
},
|
||||
"query": {},
|
||||
"params": {},
|
||||
"headers": {
|
||||
"host": "n8n.lowcoding.dev",
|
||||
"accept": "*/*",
|
||||
"content-type": "application/json",
|
||||
"content-length": "495",
|
||||
"accept-encoding": "gzip",
|
||||
"x-forwarded-for": "52.10.191.34",
|
||||
"x-forwarded-host": "n8n.lowcoding.dev",
|
||||
"x-forwarded-proto": "https"
|
||||
},
|
||||
"webhookUrl": "https://n8n.lowcoding.dev/webhook/d074ca1e-52f9-47af-8587-8c24d431f9cd",
|
||||
"executionMode": "production"
|
||||
}
|
||||
]
|
||||
},
|
||||
"connections": {
|
||||
"OpenAI1": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create Note": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI1",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If Jimmy word": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Recall bot": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create OpenAI thread",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create data record": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Create OpenAI thread": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create data record",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert Transcription Part": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If Jimmy word",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Scenario 2 Start - Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Transcription Part",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Scenario 1 Start - Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Recall bot",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,261 +0,0 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0a4e65b7-39be-44eb-8c66-913ebfe8a87a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Replace password and username for Supabase**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2cea21fc-f3fe-47b7-a7b6-12acb0bc03ac",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n#### Preparation\n1. **Create Accounts**:\n - [N8N](https://n8n.partnerlinks.io/2hr10zpkki6a): For workflow automation.\n - [Supabase](https://supabase.com/): For database hosting and management.\n - [OpenAI](https://openai.com/): For building the conversational AI agent.\n2. **Configure Database Connection**:\n - Set up a PostgreSQL database in Supabase.\n - Use appropriate credentials (`username`, `password`, `host`, and `database` name) in your workflow.\n\n#### N8N Workflow\n\nAI agent with tools:\n\n1. **Code Tool**:\n - Execute SQL queries based on user input.\n2. **Database Schema Tool**:\n - Retrieve a list of all tables in the database.\n - Use a predefined SQL query to fetch table definitions, including column names, types, and references.\n3. **Table Definition**:\n - Retrieve a list of columns with types for one table."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eacc0c8c-11d5-44fb-8ff1-10533a233693",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent to chat with Supabase/PostgreSQL DB\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nAccessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow empowers users to interact with a database conversationally through an AI-powered agent. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis.\n\nThis workflow integrates OpenAI with a Supabase database, enabling users to interact with their data via an AI agent. The agent can:\n- Retrieve records from the database.\n- Extract and analyze JSON data stored in tables.\n- Provide summaries, aggregations, or specific data points based on user queries.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "be1559ea-1f75-4e7c-9bdd-3add8d8be70b",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [20 min]\n[](https://www.youtube.com/watch?v=-GgKzhCNxjk)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ea87754-dead-49ea-848c-ed86c98e217b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
720,
|
||||
400
|
||||
],
|
||||
"webhookId": "6e95bc27-99a6-417c-8bf7-2831d7f7a4be",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c20d6e57-eb41-4682-a7f5-5bb4323df476",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d3b1faf-643c-4070-996d-a59cb06e1827",
|
||||
"name": "DB Schema",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1180,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT table_schema, table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE' AND table_schema = 'public';",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables in database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "d9346ade-79d1-44c2-8fa6-b337ad8b0544",
|
||||
"name": "Get table definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1340,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nFROM \n information_schema.columns c\nLEFT JOIN \n information_schema.key_column_usage kcu \n ON c.table_name = kcu.table_name \n AND c.column_name = kcu.column_name\nLEFT JOIN \n information_schema.table_constraints tc \n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT JOIN\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nWHERE \n c.table_name = '{{ $fromAI(\"table_name\") }}' -- Your table name\n AND c.table_schema = 'public' -- Ensure it's in the right schema\nORDER BY \n c.ordinal_position;\n",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "b88a21e0-d2ff-4431-bd84-dfd43edeb5c4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Finetune the prompt of assistant**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fbe9eb68-5990-485c-820f-08234ea33194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
940,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('When chat message received').item.json.chatInput }}",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user.\n\nFetch all data to analyse it for response if needed.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7f82d6d9-d7d6-4443-bbaa-c9b276a376e3",
|
||||
"name": "Run SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"query\",\"SQL query for PostgreSQL DB in Supabase\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Run custom SQL queries using knowledge about Output structure to provide needed response for user request.\nUse ->> operator to extract JSON data."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"DB Schema": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Run SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get table definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
261
OpenAI_and_LLMs/AI Agent to chat with Supabase_PostgreSQL DB.txt
Normal file
261
OpenAI_and_LLMs/AI Agent to chat with Supabase_PostgreSQL DB.txt
Normal file
@@ -0,0 +1,261 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0a4e65b7-39be-44eb-8c66-913ebfe8a87a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1140,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Replace password and username for Supabase**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2cea21fc-f3fe-47b7-a7b6-12acb0bc03ac",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 280.2462120317618,
|
||||
"height": 545.9087885077763,
|
||||
"content": "### Set up steps\n\n#### Preparation\n1. **Create Accounts**:\n - [N8N](https://n8n.partnerlinks.io/2hr10zpkki6a): For workflow automation.\n - [Supabase](https://supabase.com/): For database hosting and management.\n - [OpenAI](https://openai.com/): For building the conversational AI agent.\n2. **Configure Database Connection**:\n - Set up a PostgreSQL database in Supabase.\n - Use appropriate credentials (`username`, `password`, `host`, and `database` name) in your workflow.\n\n#### N8N Workflow\n\nAI agent with tools:\n\n1. **Code Tool**:\n - Execute SQL queries based on user input.\n2. **Database Schema Tool**:\n - Retrieve a list of all tables in the database.\n - Use a predefined SQL query to fetch table definitions, including column names, types, and references.\n3. **Table Definition**:\n - Retrieve a list of columns with types for one table."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eacc0c8c-11d5-44fb-8ff1-10533a233693",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 636.2128494576581,
|
||||
"height": 497.1532689930921,
|
||||
"content": "\n## AI Agent to chat with Supabase/PostgreSQL DB\n**Made by [Mark Shcherbakov](https://www.linkedin.com/in/marklowcoding/) from community [5minAI](https://www.skool.com/5minai-2861)**\n\nAccessing and analyzing database data often requires SQL expertise or dedicated reports, which can be time-consuming. This workflow empowers users to interact with a database conversationally through an AI-powered agent. It dynamically generates SQL queries based on user requests, streamlining data retrieval and analysis.\n\nThis workflow integrates OpenAI with a Supabase database, enabling users to interact with their data via an AI agent. The agent can:\n- Retrieve records from the database.\n- Extract and analyze JSON data stored in tables.\n- Provide summaries, aggregations, or specific data points based on user queries.\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "be1559ea-1f75-4e7c-9bdd-3add8d8be70b",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
140,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 330.5152611046425,
|
||||
"height": 239.5888196628349,
|
||||
"content": "### ... or watch set up video [20 min]\n[](https://www.youtube.com/watch?v=-GgKzhCNxjk)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ea87754-dead-49ea-848c-ed86c98e217b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
720,
|
||||
400
|
||||
],
|
||||
"webhookId": "6e95bc27-99a6-417c-8bf7-2831d7f7a4be",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c20d6e57-eb41-4682-a7f5-5bb4323df476",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
760,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "zJhr5piyEwVnWtaI",
|
||||
"name": "OpenAi club"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8d3b1faf-643c-4070-996d-a59cb06e1827",
|
||||
"name": "DB Schema",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1180,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT table_schema, table_name\nFROM information_schema.tables\nWHERE table_type = 'BASE TABLE' AND table_schema = 'public';",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get list of all tables in database"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "d9346ade-79d1-44c2-8fa6-b337ad8b0544",
|
||||
"name": "Get table definition",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1340,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT \n c.column_name,\n c.data_type,\n c.is_nullable,\n c.column_default,\n tc.constraint_type,\n ccu.table_name AS referenced_table,\n ccu.column_name AS referenced_column\nFROM \n information_schema.columns c\nLEFT JOIN \n information_schema.key_column_usage kcu \n ON c.table_name = kcu.table_name \n AND c.column_name = kcu.column_name\nLEFT JOIN \n information_schema.table_constraints tc \n ON kcu.constraint_name = tc.constraint_name\n AND tc.constraint_type = 'FOREIGN KEY'\nLEFT JOIN\n information_schema.constraint_column_usage ccu\n ON tc.constraint_name = ccu.constraint_name\nWHERE \n c.table_name = '{{ $fromAI(\"table_name\") }}' -- Your table name\n AND c.table_schema = 'public' -- Ensure it's in the right schema\nORDER BY \n c.ordinal_position;\n",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Get table definition to find all columns and types."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
},
|
||||
{
|
||||
"id": "b88a21e0-d2ff-4431-bd84-dfd43edeb5c4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 215,
|
||||
"height": 80,
|
||||
"content": "**Finetune the prompt of assistant**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fbe9eb68-5990-485c-820f-08234ea33194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
940,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('When chat message received').item.json.chatInput }}",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {
|
||||
"systemMessage": "You are DB assistant. You need to run queries in DB aligned with user requests.\n\nRun custom SQL query to aggregate data and response to user.\n\nFetch all data to analyse it for response if needed.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7f82d6d9-d7d6-4443-bbaa-c9b276a376e3",
|
||||
"name": "Run SQL Query",
|
||||
"type": "n8n-nodes-base.postgresTool",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"query": "{{ $fromAI(\"query\",\"SQL query for PostgreSQL DB in Supabase\") }}",
|
||||
"options": {},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Run custom SQL queries using knowledge about Output structure to provide needed response for user request.\nUse ->> operator to extract JSON data."
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "AO9cER6p8uX7V07T",
|
||||
"name": "Postgres 5minai"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.5
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"DB Schema": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Run SQL Query": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get table definition": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,827 +0,0 @@
|
||||
{
|
||||
"id": "PoiRk5w0xd1ysq4U",
|
||||
"meta": {
|
||||
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "AI Agent to chat with you Search Console Data, using OpenAI and Postgres",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9ee6710b-19b7-4bfd-ac2d-0fe1e2561f1d",
|
||||
"name": "Postgres Chat Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
1796,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "insights_chat_histories"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "",
|
||||
"name": "Postgres"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "eb9f07e9-ded1-485c-9bf3-cf223458384a",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1356,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"maxTokens": 16000
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "",
|
||||
"name": "OpenAi"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d3d6fb7-a171-4590-be42-df7eb0c208ed",
|
||||
"name": "Set fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
940,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "9f47b322-e42f-42d7-93eb-a57d22adb849",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body?.chatInput || $json.chatInput }}"
|
||||
},
|
||||
{
|
||||
"id": "73ec4dd0-e986-4f60-9dca-6aad2f86bdeb",
|
||||
"name": "sessionId",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body?.sessionId || $json.sessionId }}"
|
||||
},
|
||||
{
|
||||
"id": "4b688c46-b60f-4f0a-83d8-e283f2d7055c",
|
||||
"name": "date_message",
|
||||
"type": "string",
|
||||
"value": "={{ $now.format('yyyy-MM-dd') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "92dc5e8b-5140-49be-8713-5749b7e2d46b",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
407.32142857142867,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Webhook - ChatInput\n\nThis webhook serves as the endpoint for receiving `ChatInput` data. Ensure that you include:\n- `chatInput` – the content you wish to send (😉)\n- `sessionId` – a unique identifier for the session\n\nIf you're using an interface such as **Open WebUI**, the `sessionId` will be generated automatically."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ca9f3732-9b62-4f44-b970-77d5d470ec76",
|
||||
"name": "Webhook - ChatInput",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
500,
|
||||
-20
|
||||
],
|
||||
"webhookId": "a6820b65-76cf-402b-a934-0f836dee6ba0",
|
||||
"parameters": {
|
||||
"path": "a6820b65-76cf-402b-a934-0f836dee6ba0/chat",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode",
|
||||
"authentication": "basicAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpBasicAuth": {
|
||||
"id": "",
|
||||
"name": "basic-auth"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "9d684873-6dfe-4709-928d-293b187dfb30",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Set fields\n\nThis node sets three fields:\n- `chatInput`: retrieved from the previous webhook node\n- `sessionId`: retrieved from the previous webhook node\n- `date_message`: formatted within this node. This will be used later to help the AI agent determine the date range for retrieving Search Console data."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8750215a-1e33-4ac8-a6da-95efa8ffed65",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2600,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "1b879496-5c0f-4bd5-b4cb-18df2662aef2",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1240,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1154.2857142857138,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## AI Agent - Tools Agent\n\nThis AI Agent is configured with a system prompt that instructs it to:\n- On the first user message, **retrieve available Search Console properties** and offer the user the option to **fetch data from these properties**\n- Based on the user’s natural language input, **construct an API call** to the selected Search Console property and retrieve the requested data\n- Present the data in a **markdown-formatted table**\n\nThe AI Agent has a friendly tone and is designed to **confirm the user’s data requirements accurately** before executing any API requests.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c44c6402-9ddd-4a7b-bc5a-b6c3679a3f68",
|
||||
"name": "Call Search Console Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2196,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"name": "SearchConsoleRequestTool",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "PoiRk5w0xd1ysq4U",
|
||||
"cachedResultName": "My workflow 10"
|
||||
},
|
||||
"description": "Call this tool when you need to get the website_list or custom_insights",
|
||||
"jsonSchemaExample": ""
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "b1701a89-c5b3-47fb-99d5-4896a6d5c7a2",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1234,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - OpenAI Chat Model\n\nThis sub-node utilizes the selected **OpenAI Chat Model**. You can replace it with any LLM that **supports tool calling**.\n\n### ⚠️ Choose Your Model\nIn this template, the **default model is `gpt-4o`**, a **costly option**. If you'd like a more **affordable alternative**, select `gpt4-o-mini`, though note that responses may occasionally be of slightly lower quality compared to `gpt-4o`."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd1a7cec-5845-47b1-a2c8-d3b458a02eb0",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1656,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Postgres Chat Memory\n\nConnect your **Postgres credentials** and specify a **table name** to store the chat history. In this template, the default table name is `insights_chat_histories`, and the **context window length is set to 5**.\n\n**👋 Tip:** If you don’t have a Postgres database, you can quickly **set one up with [Supabase](https://supabase.com/)**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "290a07d1-c7ed-434d-9851-2a2dcdd35bdf",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2076,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Call Search Console Tool\n\nThis **tool is used by the AI Agent** to:\n- Retrieve the **list of accessible properties in Search Console**\n- **Fetch Search Console data** based on the user’s natural language request\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "07805c90-7ba5-44d0-b6eb-5a65efb0f8be",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2480,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Respond to Webhook\n\nThis node is used to send a response back to the user.\n\n**👋 Tip:** `intermediateSteps` are configured, allowing you to use raw data fetched from Search Console to **create charts or other visualizations** if desired.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a927a40-45e4-4fd5-ab3e-b77578469f82",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
400,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 492.3973214285712,
|
||||
"content": "## Tool Call Trigger\n\nThis **node is triggered when the AI Agent needs to retrieve the `website_list`** (accessible Search Console properties) or **`custom_insights`** based on user data.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c54a4653-0f09-46b0-bd20-68919b96e154",
|
||||
"name": "Tool calling",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
500,
|
||||
1080
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cc7303ee-1afa-4859-83e7-3af0e963a0f1",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1300,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "custom_insights",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "a30fe6a6-7d0a-4f14-8492-ae021ddc8ec6",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $json.request_type }}",
|
||||
"rightValue": "custom_insights"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "website_list",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "1b7d6039-6474-4a73-b157-584743a9d7f0",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{$json.request_type}}",
|
||||
"rightValue": "website_list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "6860ff98-4050-4f64-b8c1-a153e3388df0",
|
||||
"name": "Set fields - Consruct API CALL",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "06373437-8288-4171-9f98-e8a417220dd4",
|
||||
"name": "request_type",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().request_type }}"
|
||||
},
|
||||
{
|
||||
"id": "da45c0c5-05f6-4107-81aa-8c08c972d9bf",
|
||||
"name": "start_date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().startDate }}"
|
||||
},
|
||||
{
|
||||
"id": "59d55034-c612-43d7-9700-4cacdb630ec2",
|
||||
"name": "end_date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().endDate }}"
|
||||
},
|
||||
{
|
||||
"id": "4c2478c0-7f96-4d3d-a632-089307dc989e",
|
||||
"name": "dimensions",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().dimensions }}"
|
||||
},
|
||||
{
|
||||
"id": "eceefbf9-44e5-4617-96ea-58aca2a29618",
|
||||
"name": "rowLimit",
|
||||
"type": "number",
|
||||
"value": "={{ $json.query.parseJson().rowLimit }}"
|
||||
},
|
||||
{
|
||||
"id": "4e18386e-8548-4385-b620-43efbb11cd63",
|
||||
"name": "startRow",
|
||||
"type": "number",
|
||||
"value": "={{ $json.query.parseJson().startRow}}"
|
||||
},
|
||||
{
|
||||
"id": "a9323a7b-08b4-4015-b3d7-632bcdf56f4e",
|
||||
"name": "property",
|
||||
"type": "string",
|
||||
"value": "={{ encodeURIComponent($json.query.parseJson().property) }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "0a2dfb28-17ee-477f-b9ea-f1d8e05e3745",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 492.3973214285712,
|
||||
"content": "## Set Fields - Construct API Call\n\nThis node configures fields based on the JSON sent by the AI agent:\n- The `request_type` field determines the route: `website_list` (to retrieve the list of websites) or `custom_insights` (to get insights from Search Console)\n- Additional fields are set to construct the API call, following the **[Search Console API Documentation](https://developers.google.com/webmaster-tools/v1/searchanalytics/query?hl=en)**\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e6ef5c28-01e4-4a0b-9081-b62ec28be635",
|
||||
"name": "Set fields - Create searchConsoleDataArray",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2180,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
|
||||
"name": "searchConsoleData",
|
||||
"type": "array",
|
||||
"value": "={{ $json.rows }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "abc80061-a794-4e1d-a055-bd88ea5c93eb",
|
||||
"name": "Set fields - Create searchConsoleDataArray 2",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2180,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
|
||||
"name": "searchConsoleData",
|
||||
"type": "array",
|
||||
"value": "={{ $json.siteEntry }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "24981eea-980e-4e07-9036-d0042c5b2fbe",
|
||||
"name": "Search Console - Get Custom Insights",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://www.googleapis.com/webmasters/v3/sites/{{ $json.property }}/searchAnalytics/query",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"startDate\": \"{{ $json.start_date }}\",\n \"endDate\": \"{{ $json.end_date }}\",\n \"dimensions\": {{ $json.dimensions }},\n \"rowLimit\": {{ $json.rowLimit }},\n \"startRow\": 0,\n \"dataState\":\"all\"\n}",
|
||||
"sendBody": true,
|
||||
"sendQuery": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "oAuth2Api",
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"oAuth2Api": {
|
||||
"id": "",
|
||||
"name": "search-console"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "645ff407-857d-4629-926b-5cfc52cfa8ba",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1520,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 364.3185243941325,
|
||||
"content": "## Search Console - Get Custom Insights\n\nThis node **performs the API call to retrieve data from Search Console**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "15aa66e2-f288-4c86-8dad-47e22aa9104f",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1520,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 334.24982142857124,
|
||||
"content": "## Search Console - Get List of Properties\n\nThis node **performs the API call to retrieve the list of accessible properties from Search Console**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd804a52-833a-451a-8e0c-f640210ee2c4",
|
||||
"name": "## Search Console - Get List of Properties",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://www.googleapis.com/webmasters/v3/sites",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "oAuth2Api",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"oAuth2Api": {
|
||||
"id": "",
|
||||
"name": "search-console"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "3eac4df1-00ac-4262-b520-3a7e218c7e57",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2040,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 725.1298214285712,
|
||||
"content": "## Set Fields - Create `searchConsoleDataArray`\n\nThese nodes **create an array based on the response from the Search Console API**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "86db5800-a735-4749-a800-63d78908610b",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2520,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 722.6464176100125,
|
||||
"content": "## Array Aggregation - Response to AI Agent\n\nThese nodes **aggregate the array from the previous** step and send it back to the AI Agent through the field named output as `response`.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "aefbacc7-8dfc-4655-bc4d-f0498c823711",
|
||||
"name": "Array aggregation - response to AI Agent",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2640,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5334c72-981c-4375-ae8e-9a3a0457880b",
|
||||
"name": "Array aggregation - response to AI Agent1",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2660,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2e93a798-6c26-4d34-a553-ba01b64ca3fe",
|
||||
"name": "Sticky Note13",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-398.45627799387194,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 735.5589746610085,
|
||||
"height": 1615.4504601771982,
|
||||
"content": "# AI Agent to Chat with Your Search Console Data\n\nThis **AI Agent enables you to interact with your Search Console data** through a **chat interface**. Each node is **documented within the template**, providing sufficient information for setup and usage. You will also need to **configure Search Console OAuth credentials**.\n\nFollow this **[n8n documentation](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#configure-your-oauth-consent-screen)** to set up the OAuth credentials.\n\n## Important Notes\n\n### Correctly Configure Scopes for Search Console API Calls\n- It’s essential to **configure the scopes correctly** in your Google Search Console API OAuth2 credentials. Incorrect **configuration can cause issues with the refresh token**, requiring frequent reconnections. Below is the configuration I use to **avoid constant re-authentication**:\n\n\n\nOf course, you'll need to add your **client_id** and **client_secret** from the **Google Cloud Platform app** you created to access your Search Console data.\n\n### Configure Authentication for the Webhook\n\nSince the **webhook will be publicly accessible**, don’t forget to **set up authentication**. I’ve used **Basic Auth**, but feel free to **choose the method that best meets your security requirements**.\n\n## 🤩💖 Example of awesome things you can do with this AI Agent\n\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fa630aa9-3c60-4b27-9477-aaeb79c7f37d",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1676,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=user_message : {{ $json.chatInput }}\ndate_message : {{ $json.date_message }}",
|
||||
"options": {
|
||||
"systemMessage": "=Assist users by asking natural, conversational questions to understand their data needs and building a custom JSON API request to retrieve Search Console data. Handle assumptions internally, confirming them with the user in a friendly way. Avoid technical jargon and never imply that the user is directly building an API request.\n\nPre-Step: Retrieve the Website List\nImportant: Initial Action: Before sending your first message to the user, retrieve the list of connected Search Console properties.\n\nTool Call for Website List:\n\nTool name: SearchConsoleRequestTool\nRequest:\n{\n \"request_type\": \"website_list\" // Always include `request_type` in the API call.\n}\nUsage: Use this list to personalize your response in the initial interaction.\nStep-by-Step Guide\nStep 1: Initial Interaction and Introduction\nGreeting:\n\n\"Hi there! I’m here to help you gain valuable insights from your Search Console data. Whether you're interested in a specific time frame, performance breakdown by pages, queries, or other dimensions, I've got you covered.\n\nI can help you retrieve data for these websites:\n\nhttps://example1.com\nhttps://example2.com\nhttps://example3.com\nWhich of these properties would you like to analyze?\"\nStep 2: Handling User Response for Property Selection\nAction: When the user selects a property, use the property URL exactly as listed (e.g., \"https://example.com\") when constructing the API call.\n\nStep 3: Understanding the User's Needs\nAcknowledgment and Setting Defaults:\n\nIf the user expresses a general need (e.g., \"I want the last 3 months of page performance\"), acknowledge their request and set reasonable defaults.\n\nExample Response:\n\n\"Great! I'll gather the top 300 queries from the last 3 months for https://example.com. If you'd like more details or adjustments, just let me know.\"\n\nFollow-up Questions:\n\nConfirming Dimensions: If the user doesn’t specify dimensions, ask:\n\n\"For this analysis, I’ll look at page performance. Does that sound good, or would you like to include other details like queries, devices, or other dimensions?\"\n\nNumber of Results: If the user hasn’t specified the number of results, confirm:\n\n\"I can show you the top 100 results. Let me know if you'd like more or fewer!\"\n\nStep 4: Gathering Specific Inputs (If Necessary)\nAction: If the user provides specific needs, capture and confirm them naturally.\n\nExample Response:\n\n\"Perfect, I’ll pull the data for [specified date range], focusing on [specified dimensions]. Anything else you’d like me to include?\"\n\nImplicit Defaults:\n\nDate Range: Assume \"last 3 months\" if not specified.\nRow Limit: Default to 100, adjustable based on user input.\nStep 5: Confirming Input with the User\nAction: Summarize the request to ensure accuracy.\n\nExample Response:\n\n\"Here’s what I’m preparing: data for https://example.com, covering the last 3 months, focusing on the top 100 queries. Let me know if you’d like to adjust anything!\"\n\nStep 6: Constructing the JSON for Custom Insights\nAction: Build the API call based on the conversation.\n\n{\n \"property\": \"<USER_PROVIDED_PROPERTY_URL>\", // Use the exact property URL.\n \"request_type\": \"custom_insights\",\n \"startDate\": \"<ASSUMED_OR_USER_SPECIFIED_START_DATE>\",\n \"endDate\": \"<ASSUMED_OR_USER_SPECIFIED_END_DATE>\",\n \"dimensions\": [\"<IMPLIED_OR_USER_SPECIFIED_DIMENSIONS>\"], // Array of one or more: \"page\", \"query\", \"searchAppearance\", \"device\", \"country\"\n \"rowLimit\": 300 // Default or user-specified limit.\n}\nStep 7: Presenting the Data\nWhen Retrieving Custom Insights:\n\nImportant: Display all retrieved data in an easy-to-read markdown table format.\nStep 8: Error Handling\nAction: Provide clear, user-friendly error messages when necessary.\n\nExample Response:\n\n\"Hmm, there seems to be an issue retrieving the data. Let’s review what we have or try a different approach.\"\n\nAdditional Notes\nProactive Assistance: Offer suggestions based on user interactions, such as adding dimensions or refining details.\nTone: Maintain a friendly and helpful demeanor throughout the conversation.",
|
||||
"returnIntermediateSteps": true
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "abda3766-7d18-46fb-83e7-c2343ff26385",
|
||||
"connections": {
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search Console - Get Custom Insights",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "## Search Console - Get List of Properties",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Tool calling": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Consruct API CALL",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook - ChatInput": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Call Search Console Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Consruct API CALL": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search Console - Get Custom Insights": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Create searchConsoleDataArray",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"## Search Console - Get List of Properties": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Create searchConsoleDataArray 2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Create searchConsoleDataArray": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Array aggregation - response to AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Create searchConsoleDataArray 2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Array aggregation - response to AI Agent1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,827 @@
|
||||
{
|
||||
"id": "PoiRk5w0xd1ysq4U",
|
||||
"meta": {
|
||||
"instanceId": "b9faf72fe0d7c3be94b3ebff0778790b50b135c336412d28fd4fca2cbbf8d1f5",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "AI Agent to chat with you Search Console Data, using OpenAI and Postgres",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9ee6710b-19b7-4bfd-ac2d-0fe1e2561f1d",
|
||||
"name": "Postgres Chat Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
1796,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "insights_chat_histories"
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "",
|
||||
"name": "Postgres"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "eb9f07e9-ded1-485c-9bf3-cf223458384a",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1356,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"maxTokens": 16000
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "",
|
||||
"name": "OpenAi"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d3d6fb7-a171-4590-be42-df7eb0c208ed",
|
||||
"name": "Set fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
940,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "9f47b322-e42f-42d7-93eb-a57d22adb849",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body?.chatInput || $json.chatInput }}"
|
||||
},
|
||||
{
|
||||
"id": "73ec4dd0-e986-4f60-9dca-6aad2f86bdeb",
|
||||
"name": "sessionId",
|
||||
"type": "string",
|
||||
"value": "={{ $json.body?.sessionId || $json.sessionId }}"
|
||||
},
|
||||
{
|
||||
"id": "4b688c46-b60f-4f0a-83d8-e283f2d7055c",
|
||||
"name": "date_message",
|
||||
"type": "string",
|
||||
"value": "={{ $now.format('yyyy-MM-dd') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "92dc5e8b-5140-49be-8713-5749b7e2d46b",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
407.32142857142867,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Webhook - ChatInput\n\nThis webhook serves as the endpoint for receiving `ChatInput` data. Ensure that you include:\n- `chatInput` – the content you wish to send (😉)\n- `sessionId` – a unique identifier for the session\n\nIf you're using an interface such as **Open WebUI**, the `sessionId` will be generated automatically."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ca9f3732-9b62-4f44-b970-77d5d470ec76",
|
||||
"name": "Webhook - ChatInput",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
500,
|
||||
-20
|
||||
],
|
||||
"webhookId": "a6820b65-76cf-402b-a934-0f836dee6ba0",
|
||||
"parameters": {
|
||||
"path": "a6820b65-76cf-402b-a934-0f836dee6ba0/chat",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode",
|
||||
"authentication": "basicAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpBasicAuth": {
|
||||
"id": "",
|
||||
"name": "basic-auth"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "9d684873-6dfe-4709-928d-293b187dfb30",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Set fields\n\nThis node sets three fields:\n- `chatInput`: retrieved from the previous webhook node\n- `sessionId`: retrieved from the previous webhook node\n- `date_message`: formatted within this node. This will be used later to help the AI agent determine the date range for retrieving Search Console data."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8750215a-1e33-4ac8-a6da-95efa8ffed65",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2600,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "1b879496-5c0f-4bd5-b4cb-18df2662aef2",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1240,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1154.2857142857138,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## AI Agent - Tools Agent\n\nThis AI Agent is configured with a system prompt that instructs it to:\n- On the first user message, **retrieve available Search Console properties** and offer the user the option to **fetch data from these properties**\n- Based on the user’s natural language input, **construct an API call** to the selected Search Console property and retrieve the requested data\n- Present the data in a **markdown-formatted table**\n\nThe AI Agent has a friendly tone and is designed to **confirm the user’s data requirements accurately** before executing any API requests.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c44c6402-9ddd-4a7b-bc5a-b6c3679a3f68",
|
||||
"name": "Call Search Console Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2196,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"name": "SearchConsoleRequestTool",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "PoiRk5w0xd1ysq4U",
|
||||
"cachedResultName": "My workflow 10"
|
||||
},
|
||||
"description": "Call this tool when you need to get the website_list or custom_insights",
|
||||
"jsonSchemaExample": ""
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "b1701a89-c5b3-47fb-99d5-4896a6d5c7a2",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1234,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - OpenAI Chat Model\n\nThis sub-node utilizes the selected **OpenAI Chat Model**. You can replace it with any LLM that **supports tool calling**.\n\n### ⚠️ Choose Your Model\nIn this template, the **default model is `gpt-4o`**, a **costly option**. If you'd like a more **affordable alternative**, select `gpt4-o-mini`, though note that responses may occasionally be of slightly lower quality compared to `gpt-4o`."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd1a7cec-5845-47b1-a2c8-d3b458a02eb0",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1656,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Postgres Chat Memory\n\nConnect your **Postgres credentials** and specify a **table name** to store the chat history. In this template, the default table name is `insights_chat_histories`, and the **context window length is set to 5**.\n\n**👋 Tip:** If you don’t have a Postgres database, you can quickly **set one up with [Supabase](https://supabase.com/)**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "290a07d1-c7ed-434d-9851-2a2dcdd35bdf",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2076,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 328.9664285714292,
|
||||
"height": 468.13107142857154,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n### AI Agent Sub-node - Call Search Console Tool\n\nThis **tool is used by the AI Agent** to:\n- Retrieve the **list of accessible properties in Search Console**\n- **Fetch Search Console data** based on the user’s natural language request\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "07805c90-7ba5-44d0-b6eb-5a65efb0f8be",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2480,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 347.9910714285712,
|
||||
"height": 516.8973214285712,
|
||||
"content": "## Respond to Webhook\n\nThis node is used to send a response back to the user.\n\n**👋 Tip:** `intermediateSteps` are configured, allowing you to use raw data fetched from Search Console to **create charts or other visualizations** if desired.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a927a40-45e4-4fd5-ab3e-b77578469f82",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
400,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 492.3973214285712,
|
||||
"content": "## Tool Call Trigger\n\nThis **node is triggered when the AI Agent needs to retrieve the `website_list`** (accessible Search Console properties) or **`custom_insights`** based on user data.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c54a4653-0f09-46b0-bd20-68919b96e154",
|
||||
"name": "Tool calling",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
500,
|
||||
1080
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cc7303ee-1afa-4859-83e7-3af0e963a0f1",
|
||||
"name": "Switch",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
1300,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "custom_insights",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "a30fe6a6-7d0a-4f14-8492-ae021ddc8ec6",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $json.request_type }}",
|
||||
"rightValue": "custom_insights"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
},
|
||||
{
|
||||
"outputKey": "website_list",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "1b7d6039-6474-4a73-b157-584743a9d7f0",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{$json.request_type}}",
|
||||
"rightValue": "website_list"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "6860ff98-4050-4f64-b8c1-a153e3388df0",
|
||||
"name": "Set fields - Consruct API CALL",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "06373437-8288-4171-9f98-e8a417220dd4",
|
||||
"name": "request_type",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().request_type }}"
|
||||
},
|
||||
{
|
||||
"id": "da45c0c5-05f6-4107-81aa-8c08c972d9bf",
|
||||
"name": "start_date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().startDate }}"
|
||||
},
|
||||
{
|
||||
"id": "59d55034-c612-43d7-9700-4cacdb630ec2",
|
||||
"name": "end_date",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().endDate }}"
|
||||
},
|
||||
{
|
||||
"id": "4c2478c0-7f96-4d3d-a632-089307dc989e",
|
||||
"name": "dimensions",
|
||||
"type": "string",
|
||||
"value": "={{ $json.query.parseJson().dimensions }}"
|
||||
},
|
||||
{
|
||||
"id": "eceefbf9-44e5-4617-96ea-58aca2a29618",
|
||||
"name": "rowLimit",
|
||||
"type": "number",
|
||||
"value": "={{ $json.query.parseJson().rowLimit }}"
|
||||
},
|
||||
{
|
||||
"id": "4e18386e-8548-4385-b620-43efbb11cd63",
|
||||
"name": "startRow",
|
||||
"type": "number",
|
||||
"value": "={{ $json.query.parseJson().startRow}}"
|
||||
},
|
||||
{
|
||||
"id": "a9323a7b-08b4-4015-b3d7-632bcdf56f4e",
|
||||
"name": "property",
|
||||
"type": "string",
|
||||
"value": "={{ encodeURIComponent($json.query.parseJson().property) }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "0a2dfb28-17ee-477f-b9ea-f1d8e05e3745",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 492.3973214285712,
|
||||
"content": "## Set Fields - Construct API Call\n\nThis node configures fields based on the JSON sent by the AI agent:\n- The `request_type` field determines the route: `website_list` (to retrieve the list of websites) or `custom_insights` (to get insights from Search Console)\n- Additional fields are set to construct the API call, following the **[Search Console API Documentation](https://developers.google.com/webmaster-tools/v1/searchanalytics/query?hl=en)**\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e6ef5c28-01e4-4a0b-9081-b62ec28be635",
|
||||
"name": "Set fields - Create searchConsoleDataArray",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2180,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
|
||||
"name": "searchConsoleData",
|
||||
"type": "array",
|
||||
"value": "={{ $json.rows }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "abc80061-a794-4e1d-a055-bd88ea5c93eb",
|
||||
"name": "Set fields - Create searchConsoleDataArray 2",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2180,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "2cffd36f-72bd-4535-8427-a88028ea0c4c",
|
||||
"name": "searchConsoleData",
|
||||
"type": "array",
|
||||
"value": "={{ $json.siteEntry }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "24981eea-980e-4e07-9036-d0042c5b2fbe",
|
||||
"name": "Search Console - Get Custom Insights",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://www.googleapis.com/webmasters/v3/sites/{{ $json.property }}/searchAnalytics/query",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"startDate\": \"{{ $json.start_date }}\",\n \"endDate\": \"{{ $json.end_date }}\",\n \"dimensions\": {{ $json.dimensions }},\n \"rowLimit\": {{ $json.rowLimit }},\n \"startRow\": 0,\n \"dataState\":\"all\"\n}",
|
||||
"sendBody": true,
|
||||
"sendQuery": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "oAuth2Api",
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"oAuth2Api": {
|
||||
"id": "",
|
||||
"name": "search-console"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "645ff407-857d-4629-926b-5cfc52cfa8ba",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1520,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 364.3185243941325,
|
||||
"content": "## Search Console - Get Custom Insights\n\nThis node **performs the API call to retrieve data from Search Console**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "15aa66e2-f288-4c86-8dad-47e22aa9104f",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1520,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 334.24982142857124,
|
||||
"content": "## Search Console - Get List of Properties\n\nThis node **performs the API call to retrieve the list of accessible properties from Search Console**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd804a52-833a-451a-8e0c-f640210ee2c4",
|
||||
"name": "## Search Console - Get List of Properties",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://www.googleapis.com/webmasters/v3/sites",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "oAuth2Api",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"oAuth2Api": {
|
||||
"id": "",
|
||||
"name": "search-console"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "3eac4df1-00ac-4262-b520-3a7e218c7e57",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2040,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 725.1298214285712,
|
||||
"content": "## Set Fields - Create `searchConsoleDataArray`\n\nThese nodes **create an array based on the response from the Search Console API**.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "86db5800-a735-4749-a800-63d78908610b",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2520,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 370.3910714285712,
|
||||
"height": 722.6464176100125,
|
||||
"content": "## Array Aggregation - Response to AI Agent\n\nThese nodes **aggregate the array from the previous** step and send it back to the AI Agent through the field named output as `response`.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "aefbacc7-8dfc-4655-bc4d-f0498c823711",
|
||||
"name": "Array aggregation - response to AI Agent",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2640,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5334c72-981c-4375-ae8e-9a3a0457880b",
|
||||
"name": "Array aggregation - response to AI Agent1",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2660,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "response"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2e93a798-6c26-4d34-a553-ba01b64ca3fe",
|
||||
"name": "Sticky Note13",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-398.45627799387194,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 735.5589746610085,
|
||||
"height": 1615.4504601771982,
|
||||
"content": "# AI Agent to Chat with Your Search Console Data\n\nThis **AI Agent enables you to interact with your Search Console data** through a **chat interface**. Each node is **documented within the template**, providing sufficient information for setup and usage. You will also need to **configure Search Console OAuth credentials**.\n\nFollow this **[n8n documentation](https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#configure-your-oauth-consent-screen)** to set up the OAuth credentials.\n\n## Important Notes\n\n### Correctly Configure Scopes for Search Console API Calls\n- It’s essential to **configure the scopes correctly** in your Google Search Console API OAuth2 credentials. Incorrect **configuration can cause issues with the refresh token**, requiring frequent reconnections. Below is the configuration I use to **avoid constant re-authentication**:\n\n\n\nOf course, you'll need to add your **client_id** and **client_secret** from the **Google Cloud Platform app** you created to access your Search Console data.\n\n### Configure Authentication for the Webhook\n\nSince the **webhook will be publicly accessible**, don’t forget to **set up authentication**. I’ve used **Basic Auth**, but feel free to **choose the method that best meets your security requirements**.\n\n## 🤩💖 Example of awesome things you can do with this AI Agent\n\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fa630aa9-3c60-4b27-9477-aaeb79c7f37d",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1676,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=user_message : {{ $json.chatInput }}\ndate_message : {{ $json.date_message }}",
|
||||
"options": {
|
||||
"systemMessage": "=Assist users by asking natural, conversational questions to understand their data needs and building a custom JSON API request to retrieve Search Console data. Handle assumptions internally, confirming them with the user in a friendly way. Avoid technical jargon and never imply that the user is directly building an API request.\n\nPre-Step: Retrieve the Website List\nImportant: Initial Action: Before sending your first message to the user, retrieve the list of connected Search Console properties.\n\nTool Call for Website List:\n\nTool name: SearchConsoleRequestTool\nRequest:\n{\n \"request_type\": \"website_list\" // Always include `request_type` in the API call.\n}\nUsage: Use this list to personalize your response in the initial interaction.\nStep-by-Step Guide\nStep 1: Initial Interaction and Introduction\nGreeting:\n\n\"Hi there! I’m here to help you gain valuable insights from your Search Console data. Whether you're interested in a specific time frame, performance breakdown by pages, queries, or other dimensions, I've got you covered.\n\nI can help you retrieve data for these websites:\n\nhttps://example1.com\nhttps://example2.com\nhttps://example3.com\nWhich of these properties would you like to analyze?\"\nStep 2: Handling User Response for Property Selection\nAction: When the user selects a property, use the property URL exactly as listed (e.g., \"https://example.com\") when constructing the API call.\n\nStep 3: Understanding the User's Needs\nAcknowledgment and Setting Defaults:\n\nIf the user expresses a general need (e.g., \"I want the last 3 months of page performance\"), acknowledge their request and set reasonable defaults.\n\nExample Response:\n\n\"Great! I'll gather the top 300 queries from the last 3 months for https://example.com. If you'd like more details or adjustments, just let me know.\"\n\nFollow-up Questions:\n\nConfirming Dimensions: If the user doesn’t specify dimensions, ask:\n\n\"For this analysis, I’ll look at page performance. Does that sound good, or would you like to include other details like queries, devices, or other dimensions?\"\n\nNumber of Results: If the user hasn’t specified the number of results, confirm:\n\n\"I can show you the top 100 results. Let me know if you'd like more or fewer!\"\n\nStep 4: Gathering Specific Inputs (If Necessary)\nAction: If the user provides specific needs, capture and confirm them naturally.\n\nExample Response:\n\n\"Perfect, I’ll pull the data for [specified date range], focusing on [specified dimensions]. Anything else you’d like me to include?\"\n\nImplicit Defaults:\n\nDate Range: Assume \"last 3 months\" if not specified.\nRow Limit: Default to 100, adjustable based on user input.\nStep 5: Confirming Input with the User\nAction: Summarize the request to ensure accuracy.\n\nExample Response:\n\n\"Here’s what I’m preparing: data for https://example.com, covering the last 3 months, focusing on the top 100 queries. Let me know if you’d like to adjust anything!\"\n\nStep 6: Constructing the JSON for Custom Insights\nAction: Build the API call based on the conversation.\n\n{\n \"property\": \"<USER_PROVIDED_PROPERTY_URL>\", // Use the exact property URL.\n \"request_type\": \"custom_insights\",\n \"startDate\": \"<ASSUMED_OR_USER_SPECIFIED_START_DATE>\",\n \"endDate\": \"<ASSUMED_OR_USER_SPECIFIED_END_DATE>\",\n \"dimensions\": [\"<IMPLIED_OR_USER_SPECIFIED_DIMENSIONS>\"], // Array of one or more: \"page\", \"query\", \"searchAppearance\", \"device\", \"country\"\n \"rowLimit\": 300 // Default or user-specified limit.\n}\nStep 7: Presenting the Data\nWhen Retrieving Custom Insights:\n\nImportant: Display all retrieved data in an easy-to-read markdown table format.\nStep 8: Error Handling\nAction: Provide clear, user-friendly error messages when necessary.\n\nExample Response:\n\n\"Hmm, there seems to be an issue retrieving the data. Let’s review what we have or try a different approach.\"\n\nAdditional Notes\nProactive Assistance: Offer suggestions based on user interactions, such as adding dimensions or refining details.\nTone: Maintain a friendly and helpful demeanor throughout the conversation.",
|
||||
"returnIntermediateSteps": true
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "abda3766-7d18-46fb-83e7-c2343ff26385",
|
||||
"connections": {
|
||||
"Switch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search Console - Get Custom Insights",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "## Search Console - Get List of Properties",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Tool calling": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Consruct API CALL",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook - ChatInput": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Call Search Console Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Consruct API CALL": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Switch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search Console - Get Custom Insights": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Create searchConsoleDataArray",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"## Search Console - Get List of Properties": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set fields - Create searchConsoleDataArray 2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Create searchConsoleDataArray": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Array aggregation - response to AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set fields - Create searchConsoleDataArray 2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Array aggregation - response to AI Agent1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,235 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
|
||||
"templateId": "2931",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100f23d3-cbe9-458a-9ef1-7cc5fcba8f3c",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
640,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 205,
|
||||
"content": "### The conversation history(last 20 messages) is stored in a buffer memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b48f989f-deb9-479c-b163-03f098d00c9c",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "add8e8df-6b2a-4cbd-84e7-3b006733ef7d",
|
||||
"name": "Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
|
||||
"position": [
|
||||
1180,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a97454a8-001d-4986-9cb5-83176229ea70",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
980,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 205,
|
||||
"content": "### Tools which agent can use to accomplish the task"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "52b57e72-8cc9-4865-9a00-d03b2e7f1b92",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 422,
|
||||
"height": 211,
|
||||
"content": "### Conversational agent will utilise available tools to answer the prompt. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8f0653ab-376b-40b9-b876-e608defdeb89",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
740,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "13237945-e143-4f65-b034-785f5ebde5bb",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
680,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.input }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "ee06c0f4-b2de-4257-9735-3ec228f2b794",
|
||||
"name": "Weather HTTP Request",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1020,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.open-meteo.com/v1/forecast",
|
||||
"sendQuery": true,
|
||||
"parametersQuery": {
|
||||
"values": [
|
||||
{
|
||||
"name": "latitude"
|
||||
},
|
||||
{
|
||||
"name": "longitude"
|
||||
},
|
||||
{
|
||||
"name": "forecast_days",
|
||||
"value": "1",
|
||||
"valueProvider": "fieldValue"
|
||||
},
|
||||
{
|
||||
"name": "hourly",
|
||||
"value": "temperature_2m",
|
||||
"valueProvider": "fieldValue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"toolDescription": "Fetch current temperature for given coordinates."
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "3e5608c8-281d-47e0-af9d-77707530fd6b",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
520,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"model": "llama3.2:latest",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "xHuYe0MDGOs9IpBW",
|
||||
"name": "Local Ollama service"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b3d794f4-37b5-46c8-9d7d-ad1087006ce5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"height": 240,
|
||||
"content": "### In System Message, add the following.\n\n\"You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool.\""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Weather HTTP Request": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "558d88703fb65b2d0e44613bc35916258b0f0bf983c5d4730c00c424b77ca36a",
|
||||
"templateId": "2931",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "100f23d3-cbe9-458a-9ef1-7cc5fcba8f3c",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
640,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 205,
|
||||
"content": "### The conversation history(last 20 messages) is stored in a buffer memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b48f989f-deb9-479c-b163-03f098d00c9c",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "add8e8df-6b2a-4cbd-84e7-3b006733ef7d",
|
||||
"name": "Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
|
||||
"position": [
|
||||
1180,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a97454a8-001d-4986-9cb5-83176229ea70",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
980,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 205,
|
||||
"content": "### Tools which agent can use to accomplish the task"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "52b57e72-8cc9-4865-9a00-d03b2e7f1b92",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 422,
|
||||
"height": 211,
|
||||
"content": "### Conversational agent will utilise available tools to answer the prompt. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8f0653ab-376b-40b9-b876-e608defdeb89",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
740,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "13237945-e143-4f65-b034-785f5ebde5bb",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
680,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.input }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "ee06c0f4-b2de-4257-9735-3ec228f2b794",
|
||||
"name": "Weather HTTP Request",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1020,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.open-meteo.com/v1/forecast",
|
||||
"sendQuery": true,
|
||||
"parametersQuery": {
|
||||
"values": [
|
||||
{
|
||||
"name": "latitude"
|
||||
},
|
||||
{
|
||||
"name": "longitude"
|
||||
},
|
||||
{
|
||||
"name": "forecast_days",
|
||||
"value": "1",
|
||||
"valueProvider": "fieldValue"
|
||||
},
|
||||
{
|
||||
"name": "hourly",
|
||||
"value": "temperature_2m",
|
||||
"valueProvider": "fieldValue"
|
||||
}
|
||||
]
|
||||
},
|
||||
"toolDescription": "Fetch current temperature for given coordinates."
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "3e5608c8-281d-47e0-af9d-77707530fd6b",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
520,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"model": "llama3.2:latest",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "xHuYe0MDGOs9IpBW",
|
||||
"name": "Local Ollama service"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b3d794f4-37b5-46c8-9d7d-ad1087006ce5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"height": 240,
|
||||
"content": "### In System Message, add the following.\n\n\"You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool.\""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Weather HTTP Request": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,670 +0,0 @@
|
||||
{
|
||||
"id": "t1P14FvfibKYCh3E",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "HR-focused automation pipeline with AI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1092f93-502c-4af0-962e-2b69311b92a3",
|
||||
"name": "On form submission",
|
||||
"type": "n8n-nodes-base.formTrigger",
|
||||
"position": [
|
||||
-520,
|
||||
-200
|
||||
],
|
||||
"webhookId": "2a87705d-8ba1-41f1-80ef-85f364ce253e",
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"formTitle": "Send CV",
|
||||
"formFields": {
|
||||
"values": [
|
||||
{
|
||||
"fieldLabel": "Name",
|
||||
"placeholder": "Name",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "email",
|
||||
"fieldLabel": "Email",
|
||||
"placeholder": "Email",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "file",
|
||||
"fieldLabel": "CV",
|
||||
"requiredField": true,
|
||||
"acceptFileTypes": ".pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "77edfe2a-4c6a-48c8-8dc9-b275491be090",
|
||||
"name": "Extract from File",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf",
|
||||
"binaryPropertyName": "CV"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ebf2e194-3515-4c0a-8745-790b63bf336f",
|
||||
"name": "Qualifications",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
160,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.text }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
|
||||
},
|
||||
"attributes": {
|
||||
"attributes": [
|
||||
{
|
||||
"name": "Educational qualification",
|
||||
"required": true,
|
||||
"description": "Summary of your academic career. Focus on your high school and university studies. Summarize in 100 words maximum and also include your grade if applicable."
|
||||
},
|
||||
{
|
||||
"name": "Job History",
|
||||
"required": true,
|
||||
"description": "Work history summary. Focus on your most recent work experiences. Summarize in 100 words maximum"
|
||||
},
|
||||
{
|
||||
"name": "Skills",
|
||||
"required": true,
|
||||
"description": "Extract the candidate’s technical skills. What software and frameworks they are proficient in. Make a bulleted list."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4f40404c-1d47-4bde-9b4b-16367cf11e4f",
|
||||
"name": "Summarization Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
|
||||
"position": [
|
||||
900,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"summarizationMethodAndPrompts": {
|
||||
"values": {
|
||||
"prompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational.",
|
||||
"combineMapPrompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "9f9c5f16-1dc2-4928-aef8-284daeb6be51",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
660,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineAll"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "51bd14cc-2c54-4f72-b162-255f7e277aff",
|
||||
"name": "Profile Wanted",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1300,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "a3d049b0-5a70-4e7b-a6f2-81447da5282a",
|
||||
"name": "profile_wanted",
|
||||
"type": "string",
|
||||
"value": "We are a web agency and we are looking for a full-stack web developer who knows how to use PHP, Python and Javascript. He has experience in the sector and lives in Northern Italy."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "4a120e5d-b849-4a29-b7f3-12c653552367",
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1960,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"CITY": "={{ $('Merge').item.json.output.city }}",
|
||||
"DATA": "={{ $now.format('dd/LL/yyyy') }}",
|
||||
"NAME": "={{ $('On form submission').item.json.Nome }}",
|
||||
"VOTE": "={{ $json.output.vote }}",
|
||||
"EMAIL": "={{ $('On form submission').item.json.Email }}",
|
||||
"SKILLS": "={{ $('Merge').item.json.output.Skills }}",
|
||||
"TELEFONO": "={{ $('Merge').item.json.output.telephone }}",
|
||||
"SUMMARIZE": "={{ $('Summarization Chain').item.json.response.text }}",
|
||||
"EDUCATIONAL": "={{ $('Merge').item.json.output[\"Educational qualification\"] }}",
|
||||
"JOB HISTORY": "={{ $('Merge').item.json.output[\"Job History\"] }}",
|
||||
"DATA NASCITA": "={{ $('Merge').item.json.output.birthdate }}",
|
||||
"CONSIDERATION": "={{ $json.output.consideration }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "DATA",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "DATA",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "NAME",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "NAME",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "PHONE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "PHONE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "CITY",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "CITY",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "EMAIL",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "EMAIL",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "DATA NASCITA",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "DATA NASCITA",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "EDUCATIONAL",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "EDUCATIONAL",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "JOB HISTORY",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "JOB HISTORY",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "SKILLS",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "SKILLS",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "SUMMARIZE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "SUMMARIZE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "VOTE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "VOTE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "CONSIDERATION",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "CONSIDERATION",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit#gid=0",
|
||||
"cachedResultName": "Foglio1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Ricerca WebDev"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "JYR6a64Qecd6t8Hb",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "a154d8a5-9f85-45bb-b082-f702c13c3507",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1720,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"vote\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"consideration\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "037ac851-7885-4b78-ac75-dfa0ebb6003d",
|
||||
"name": "HR Expert",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1560,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Profilo ricercato:\n{{ $json.profile_wanted }}\n\nCandidato:\n{{ $('Summarization Chain').item.json.response.text }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "Sei un esperto HR e devi capire se il candidato è in linea con il profilo ricercato dall'azienda.\n\nDevi dare un voto da 1 a 10 dove 1 significa che il candidato non è in linea con quanto richiesto mentre 10 significa che è il candidato ideale perchè rispecchia in toto il profilo cercato.\n\nInoltre nel campo \"consideration\" motiva il perchè hai dato quel voto. "
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "ed5744c4-df06-4a01-a103-af4dd470d482",
|
||||
"name": "Personal Data",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
160,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.text }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
|
||||
},
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"telephone\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"city\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"birthdate\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "181c1249-b05c-4c35-8cac-5f9738cc1fe6",
|
||||
"name": "Upload CV",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-160,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"name": "=CV-{{ $now.format('yyyyLLdd') }}-{{ $json.CV[0].filename }}",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
|
||||
"cachedResultName": "CV"
|
||||
},
|
||||
"inputDataFieldName": "CV"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "d31ee1c4-e4be-41d9-8f36-e6fb797ced8e",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
920,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "0290cb72-a581-4aff-8b5d-1aa63e0a630f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
-680
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 540,
|
||||
"content": "## HR Expert \nThis workflow automates the process of handling job applications by extracting relevant information from submitted CVs, analyzing the candidate's qualifications against a predefined profile, and storing the results in a Google Sheet"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "361084ff-9735-4a56-8988-be573391838b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 420,
|
||||
"content": "The CV is uploaded to Google Drive and converted so that it can be processed\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4b6f004f-c77b-4522-99d4-737a68f6cfac",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
120,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"width": 360,
|
||||
"height": 440,
|
||||
"content": "The essential information for evaluating the candidate is collected in two different chains"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73e11af9-65e3-4fcd-bb99-8a3f212ce9fb",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 320,
|
||||
"height": 240,
|
||||
"content": "Summary of relevant information useful for classifying the candidate"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "606711d1-8e6d-44b3-91ac-c047d8a4054f",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1240,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 220,
|
||||
"height": 240,
|
||||
"content": "Characteristics of the profile sought by the company that intends to hire the candidate"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "89c3210c-c599-41dc-97a3-bf8df2beb751",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1500,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 360,
|
||||
"height": 240,
|
||||
"content": "Candidate evaluation with vote and considerations of the HR agent relating the profile sought with the candidate's skills"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "594728c0-b842-404d-8810-c6f7f3f4631d",
|
||||
"connections": {
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Summarization Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Qualifications",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Summarization Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Personal Data",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HR Expert": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Upload CV": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Personal Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Profile Wanted": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qualifications": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract from File": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qualifications",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Personal Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On form submission": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract from File",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Upload CV",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Summarization Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Profile Wanted",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,670 @@
|
||||
{
|
||||
"id": "t1P14FvfibKYCh3E",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "HR-focused automation pipeline with AI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1092f93-502c-4af0-962e-2b69311b92a3",
|
||||
"name": "On form submission",
|
||||
"type": "n8n-nodes-base.formTrigger",
|
||||
"position": [
|
||||
-520,
|
||||
-200
|
||||
],
|
||||
"webhookId": "2a87705d-8ba1-41f1-80ef-85f364ce253e",
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"formTitle": "Send CV",
|
||||
"formFields": {
|
||||
"values": [
|
||||
{
|
||||
"fieldLabel": "Name",
|
||||
"placeholder": "Name",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "email",
|
||||
"fieldLabel": "Email",
|
||||
"placeholder": "Email",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "file",
|
||||
"fieldLabel": "CV",
|
||||
"requiredField": true,
|
||||
"acceptFileTypes": ".pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "77edfe2a-4c6a-48c8-8dc9-b275491be090",
|
||||
"name": "Extract from File",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
-160,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf",
|
||||
"binaryPropertyName": "CV"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ebf2e194-3515-4c0a-8745-790b63bf336f",
|
||||
"name": "Qualifications",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
160,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.text }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
|
||||
},
|
||||
"attributes": {
|
||||
"attributes": [
|
||||
{
|
||||
"name": "Educational qualification",
|
||||
"required": true,
|
||||
"description": "Summary of your academic career. Focus on your high school and university studies. Summarize in 100 words maximum and also include your grade if applicable."
|
||||
},
|
||||
{
|
||||
"name": "Job History",
|
||||
"required": true,
|
||||
"description": "Work history summary. Focus on your most recent work experiences. Summarize in 100 words maximum"
|
||||
},
|
||||
{
|
||||
"name": "Skills",
|
||||
"required": true,
|
||||
"description": "Extract the candidate’s technical skills. What software and frameworks they are proficient in. Make a bulleted list."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4f40404c-1d47-4bde-9b4b-16367cf11e4f",
|
||||
"name": "Summarization Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
|
||||
"position": [
|
||||
900,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"summarizationMethodAndPrompts": {
|
||||
"values": {
|
||||
"prompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational.",
|
||||
"combineMapPrompt": "=Write a concise summary of the following:\n\nCity: {{ $json.output.city }}\nBirthdate: {{ $json.output.birthdate }}\nEducational qualification: {{ $json.output[\"Educational qualification\"] }}\nJob History: {{ $json.output[\"Job History\"] }}\nSkills: {{ $json.output.Skills }}\n\nUse 100 words or less. Be concise and conversational."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "9f9c5f16-1dc2-4928-aef8-284daeb6be51",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
660,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineAll"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "51bd14cc-2c54-4f72-b162-255f7e277aff",
|
||||
"name": "Profile Wanted",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1300,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "a3d049b0-5a70-4e7b-a6f2-81447da5282a",
|
||||
"name": "profile_wanted",
|
||||
"type": "string",
|
||||
"value": "We are a web agency and we are looking for a full-stack web developer who knows how to use PHP, Python and Javascript. He has experience in the sector and lives in Northern Italy."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "4a120e5d-b849-4a29-b7f3-12c653552367",
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1960,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"CITY": "={{ $('Merge').item.json.output.city }}",
|
||||
"DATA": "={{ $now.format('dd/LL/yyyy') }}",
|
||||
"NAME": "={{ $('On form submission').item.json.Nome }}",
|
||||
"VOTE": "={{ $json.output.vote }}",
|
||||
"EMAIL": "={{ $('On form submission').item.json.Email }}",
|
||||
"SKILLS": "={{ $('Merge').item.json.output.Skills }}",
|
||||
"TELEFONO": "={{ $('Merge').item.json.output.telephone }}",
|
||||
"SUMMARIZE": "={{ $('Summarization Chain').item.json.response.text }}",
|
||||
"EDUCATIONAL": "={{ $('Merge').item.json.output[\"Educational qualification\"] }}",
|
||||
"JOB HISTORY": "={{ $('Merge').item.json.output[\"Job History\"] }}",
|
||||
"DATA NASCITA": "={{ $('Merge').item.json.output.birthdate }}",
|
||||
"CONSIDERATION": "={{ $json.output.consideration }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "DATA",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "DATA",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "NAME",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "NAME",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "PHONE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "PHONE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "CITY",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "CITY",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "EMAIL",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "EMAIL",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "DATA NASCITA",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "DATA NASCITA",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "EDUCATIONAL",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "EDUCATIONAL",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "JOB HISTORY",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "JOB HISTORY",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "SKILLS",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "SKILLS",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "SUMMARIZE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "SUMMARIZE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "VOTE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "VOTE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "CONSIDERATION",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "CONSIDERATION",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit#gid=0",
|
||||
"cachedResultName": "Foglio1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ssz5RvN1Hr20Q31pnYnbjCLu1MGBvoLttBAjXunMRQE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Ricerca WebDev"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "JYR6a64Qecd6t8Hb",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "a154d8a5-9f85-45bb-b082-f702c13c3507",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1720,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"vote\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"consideration\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "037ac851-7885-4b78-ac75-dfa0ebb6003d",
|
||||
"name": "HR Expert",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1560,
|
||||
-220
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Profilo ricercato:\n{{ $json.profile_wanted }}\n\nCandidato:\n{{ $('Summarization Chain').item.json.response.text }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "Sei un esperto HR e devi capire se il candidato è in linea con il profilo ricercato dall'azienda.\n\nDevi dare un voto da 1 a 10 dove 1 significa che il candidato non è in linea con quanto richiesto mentre 10 significa che è il candidato ideale perchè rispecchia in toto il profilo cercato.\n\nInoltre nel campo \"consideration\" motiva il perchè hai dato quel voto. "
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "ed5744c4-df06-4a01-a103-af4dd470d482",
|
||||
"name": "Personal Data",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
160,
|
||||
-280
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.text }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
|
||||
},
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"telephone\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"city\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"birthdate\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "181c1249-b05c-4c35-8cac-5f9738cc1fe6",
|
||||
"name": "Upload CV",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-160,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"name": "=CV-{{ $now.format('yyyyLLdd') }}-{{ $json.CV[0].filename }}",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/1tzeSpx4D3EAGXa3Wg-gqGbdaUk6LIZTV",
|
||||
"cachedResultName": "CV"
|
||||
},
|
||||
"inputDataFieldName": "CV"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "d31ee1c4-e4be-41d9-8f36-e6fb797ced8e",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
920,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "0290cb72-a581-4aff-8b5d-1aa63e0a630f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
-680
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 540,
|
||||
"content": "## HR Expert \nThis workflow automates the process of handling job applications by extracting relevant information from submitted CVs, analyzing the candidate's qualifications against a predefined profile, and storing the results in a Google Sheet"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "361084ff-9735-4a56-8988-be573391838b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 420,
|
||||
"content": "The CV is uploaded to Google Drive and converted so that it can be processed\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4b6f004f-c77b-4522-99d4-737a68f6cfac",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
120,
|
||||
-380
|
||||
],
|
||||
"parameters": {
|
||||
"width": 360,
|
||||
"height": 440,
|
||||
"content": "The essential information for evaluating the candidate is collected in two different chains"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73e11af9-65e3-4fcd-bb99-8a3f212ce9fb",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 320,
|
||||
"height": 240,
|
||||
"content": "Summary of relevant information useful for classifying the candidate"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "606711d1-8e6d-44b3-91ac-c047d8a4054f",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1240,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 220,
|
||||
"height": 240,
|
||||
"content": "Characteristics of the profile sought by the company that intends to hire the candidate"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "89c3210c-c599-41dc-97a3-bf8df2beb751",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1500,
|
||||
-300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 360,
|
||||
"height": 240,
|
||||
"content": "Candidate evaluation with vote and considerations of the HR agent relating the profile sought with the candidate's skills"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "594728c0-b842-404d-8810-c6f7f3f4631d",
|
||||
"connections": {
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Summarization Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Qualifications",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Summarization Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Personal Data",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HR Expert": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Upload CV": {
|
||||
"main": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Personal Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Profile Wanted": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qualifications": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract from File": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qualifications",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Personal Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On form submission": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract from File",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Upload CV",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Summarization Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Profile Wanted",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "HR Expert",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,439 +0,0 @@
|
||||
{
|
||||
"id": "tMiRJYDrXzpKysTX",
|
||||
"meta": {
|
||||
"instanceId": "2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd",
|
||||
"templateId": "1960"
|
||||
},
|
||||
"name": "Stock Q&A Workflow",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ec3b86be-4113-4fd5-8365-02adb67693e9",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1960,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "42fd8020-3861-4d0f-a7a2-70e2c35f0bed",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"disabled": true,
|
||||
"position": [
|
||||
1620,
|
||||
240
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a9b48d04-691e-4537-90f8-d7a4aa6153af",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1560,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 903.0896125323785,
|
||||
"height": 733.5099670584011,
|
||||
"content": "## Step 2: Setup the Q&A \n### The incoming message from the webhook is queried from the Supabase Vector Store. The response is provided in the response webhook. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "472b4800-745a-4337-9545-163247f7e9ae",
|
||||
"name": "Retrieval QA Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
1880,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"query": "={{ $json.body.input }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e58bd82d-abc6-44ed-8e93-ec5436126d66",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2280,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.response.text }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "04bbf01e-8269-47c7-897d-4ea94a1bd1c0",
|
||||
"name": "Vector Store Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
|
||||
"position": [
|
||||
2020,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"topK": 5
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "feee6d68-2e0d-4d40-897e-c1d833a13bf2",
|
||||
"name": "Webhook1",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1620,
|
||||
420
|
||||
],
|
||||
"webhookId": "679f4afb-189e-4f04-9dc0-439eec2ec5f1",
|
||||
"parameters": {
|
||||
"path": "19f5499a-3083-4783-93a0-e8ed76a9f742",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "1b8d251f-7069-4d7d-b6d6-4bfa683d4ad1",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
280,
|
||||
260
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b746a7a4-ed94-4332-bf7b-65aadcf54130",
|
||||
"name": "Google Drive",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
580,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1LZezppYrWpMStr4qJXtoIX-Dwzvgehll",
|
||||
"cachedResultUrl": "https://drive.google.com/file/d/1LZezppYrWpMStr4qJXtoIX-Dwzvgehll/view?usp=drivesdk",
|
||||
"cachedResultName": "crowdstrike.pdf"
|
||||
},
|
||||
"options": {},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "1tsDIpjUaKbXy0be",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "83a7d470-f934-436d-ba3f-1ae7c776f5a5",
|
||||
"name": "Binary to Document",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentBinaryInputLoader",
|
||||
"position": [
|
||||
860,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b52b4a90-99a1-49cc-a6f0-7551d6754496",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
860,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 3000,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b525e130-2029-4f55-a603-1fdc05a19c17",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1160,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5358c53f-55f9-431d-8956-c6bae7ad25bc",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 772.0680602743597,
|
||||
"height": 732.3675002130781,
|
||||
"content": "## Step 1: Upserting the PDF\n### Fetch file from Google Drive, split it into chunks and insert into Supabase index\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fb91e2da-0eeb-47a5-aa49-65bf56986857",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
940,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=crowd"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "U5CpjAgFeXziP3I1",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "89e14837-d1fc-4b1e-9ebc-7cf3e7fd9a70",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
1980,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.body.company }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "U5CpjAgFeXziP3I1",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c619245b-5ea0-4354-974d-21ec6b8efa93",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1880,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e4aa780d-8069-4308-a61f-82ed876af71a",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 710.9124489067698,
|
||||
"height": 726.4452519516944,
|
||||
"content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[](https://www.youtube.com/watch?v=pMvizUx5n1g)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {},
|
||||
"versionId": "463aec94-26a6-436d-8732-fc01d637c6ae",
|
||||
"connections": {
|
||||
"Webhook1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Drive": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Binary to Document": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Retrieval QA Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store1": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Retriever",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Drive",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Binary to Document",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
{
|
||||
"id": "tMiRJYDrXzpKysTX",
|
||||
"meta": {
|
||||
"instanceId": "2723a3a635131edfcb16103f3d4dbaadf3658e386b4762989cbf49528dccbdbd",
|
||||
"templateId": "1960"
|
||||
},
|
||||
"name": "Stock Q&A Workflow",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ec3b86be-4113-4fd5-8365-02adb67693e9",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1960,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "42fd8020-3861-4d0f-a7a2-70e2c35f0bed",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"disabled": true,
|
||||
"position": [
|
||||
1620,
|
||||
240
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a9b48d04-691e-4537-90f8-d7a4aa6153af",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1560,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 903.0896125323785,
|
||||
"height": 733.5099670584011,
|
||||
"content": "## Step 2: Setup the Q&A \n### The incoming message from the webhook is queried from the Supabase Vector Store. The response is provided in the response webhook. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "472b4800-745a-4337-9545-163247f7e9ae",
|
||||
"name": "Retrieval QA Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
1880,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"query": "={{ $json.body.input }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e58bd82d-abc6-44ed-8e93-ec5436126d66",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2280,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.response.text }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "04bbf01e-8269-47c7-897d-4ea94a1bd1c0",
|
||||
"name": "Vector Store Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
|
||||
"position": [
|
||||
2020,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"topK": 5
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "feee6d68-2e0d-4d40-897e-c1d833a13bf2",
|
||||
"name": "Webhook1",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1620,
|
||||
420
|
||||
],
|
||||
"webhookId": "679f4afb-189e-4f04-9dc0-439eec2ec5f1",
|
||||
"parameters": {
|
||||
"path": "19f5499a-3083-4783-93a0-e8ed76a9f742",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "1b8d251f-7069-4d7d-b6d6-4bfa683d4ad1",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
280,
|
||||
260
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b746a7a4-ed94-4332-bf7b-65aadcf54130",
|
||||
"name": "Google Drive",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
580,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1LZezppYrWpMStr4qJXtoIX-Dwzvgehll",
|
||||
"cachedResultUrl": "https://drive.google.com/file/d/1LZezppYrWpMStr4qJXtoIX-Dwzvgehll/view?usp=drivesdk",
|
||||
"cachedResultName": "crowdstrike.pdf"
|
||||
},
|
||||
"options": {},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "1tsDIpjUaKbXy0be",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "83a7d470-f934-436d-ba3f-1ae7c776f5a5",
|
||||
"name": "Binary to Document",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentBinaryInputLoader",
|
||||
"position": [
|
||||
860,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b52b4a90-99a1-49cc-a6f0-7551d6754496",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
860,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 3000,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b525e130-2029-4f55-a603-1fdc05a19c17",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
1160,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5358c53f-55f9-431d-8956-c6bae7ad25bc",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 772.0680602743597,
|
||||
"height": 732.3675002130781,
|
||||
"content": "## Step 1: Upserting the PDF\n### Fetch file from Google Drive, split it into chunks and insert into Supabase index\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fb91e2da-0eeb-47a5-aa49-65bf56986857",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
940,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=crowd"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "U5CpjAgFeXziP3I1",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "89e14837-d1fc-4b1e-9ebc-7cf3e7fd9a70",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
1980,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.body.company }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "U5CpjAgFeXziP3I1",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c619245b-5ea0-4354-974d-21ec6b8efa93",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1880,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "fOF5kro9BJ6KMQ7n",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e4aa780d-8069-4308-a61f-82ed876af71a",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 710.9124489067698,
|
||||
"height": 726.4452519516944,
|
||||
"content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[](https://www.youtube.com/watch?v=pMvizUx5n1g)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {},
|
||||
"versionId": "463aec94-26a6-436d-8732-fc01d637c6ae",
|
||||
"connections": {
|
||||
"Webhook1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Drive": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Binary to Document": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Retrieval QA Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store1": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Retriever",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Drive",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Binary to Document",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,330 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "82a17fa4a0b8e81bf77e5ab999d980f392150f2a9541fde626dc5f74857b1f54"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "4ea39a4f-d8c1-438f-9738-bfbb906a3d7a",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1200,
|
||||
1020
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Send customer feedback to OpenAI for sentiment analysis"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6962ea41-7d15-4932-919f-21ac94fa1269",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1960,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Add new feedback to google sheets"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4c8a8984-2d8e-4139-866b-6f3536aced07",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
1600
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1407,
|
||||
"height": 254,
|
||||
"content": "## Instructions\n1. Connect Google sheets\n2. Connect your OpenAi account (api key + org Id)\n3. Create a customer feedback form, use an existing one or use the one below as example. \nAll set!\n\n\n- Here is the example google sheet being used in this workflow: https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=sharing. You can download it to your account."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d43a9574-626d-4817-87ba-d99bdd6f41dc",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Feedback form is submitted"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "76dab2dc-935f-416e-91aa-5a1b7017ec1b",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1600,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Merge form data and OpenAI result"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9772eac1-8df2-4305-9b2c-265d3c5a9a4a",
|
||||
"name": "Add customer feedback to Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
2020,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"Category": "={{ $json['What is your feedback about?'] }}",
|
||||
"Sentiment": "={{ $json.text }}",
|
||||
"Timestamp": "={{ $json.submittedAt }}",
|
||||
"Entered by": "=Form",
|
||||
"Customer Name": "={{ $json.Name }}",
|
||||
"Customer contact": "={{ $json['How do we get in touch with you?'] }}",
|
||||
"Customer Feedback": "={{ $json['Your feedback'] }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "Timestamp",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Timestamp",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Category",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Category",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer Feedback",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer Feedback",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer Name",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer Name",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer contact",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer contact",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Entered by",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Entered by",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Urgent?",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Urgent?",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Sentiment",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Sentiment",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": []
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=drivesdk",
|
||||
"cachedResultName": "CustomerFeedback"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "3",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "12084971-c81b-4a0e-814e-120867562642",
|
||||
"name": "Merge sentiment with form content",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1680,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "multiplex"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "235edf5b-7724-4712-8dc5-d8327a0620b8",
|
||||
"name": "Classify feedback with OpenAI",
|
||||
"type": "n8n-nodes-base.openAi",
|
||||
"position": [
|
||||
1280,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"prompt": "=Classify the sentiment in the following customer feedback: {{ $json['Your feedback'] }}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "s2iucY0IctjYNbrb",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af4b22aa-0925-40b1-a9ac-298f9745a98e",
|
||||
"name": "Submit form with customer feedback",
|
||||
"type": "n8n-nodes-base.formTrigger",
|
||||
"position": [
|
||||
860,
|
||||
1340
|
||||
],
|
||||
"webhookId": "e7bf682e-48e8-40de-9815-cd180cdd1480",
|
||||
"parameters": {
|
||||
"options": {
|
||||
"formSubmittedText": "Your response has been recorded"
|
||||
},
|
||||
"formTitle": "Customer Feedback",
|
||||
"formFields": {
|
||||
"values": [
|
||||
{
|
||||
"fieldLabel": "Name",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "dropdown",
|
||||
"fieldLabel": "What is your feedback about?",
|
||||
"fieldOptions": {
|
||||
"values": [
|
||||
{
|
||||
"option": "Product"
|
||||
},
|
||||
{
|
||||
"option": "Service"
|
||||
},
|
||||
{
|
||||
"option": "Other"
|
||||
}
|
||||
]
|
||||
},
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "textarea",
|
||||
"fieldLabel": "Your feedback",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldLabel": "How do we get in touch with you?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"formDescription": "Please give feedback about our company orproducts."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Classify feedback with OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge sentiment with form content",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge sentiment with form content": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add customer feedback to Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Submit form with customer feedback": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Classify feedback with OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge sentiment with form content",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
330
OpenAI_and_LLMs/AI Customer feedback sentiment analysis.txt
Normal file
330
OpenAI_and_LLMs/AI Customer feedback sentiment analysis.txt
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "82a17fa4a0b8e81bf77e5ab999d980f392150f2a9541fde626dc5f74857b1f54"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "4ea39a4f-d8c1-438f-9738-bfbb906a3d7a",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1200,
|
||||
1020
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Send customer feedback to OpenAI for sentiment analysis"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6962ea41-7d15-4932-919f-21ac94fa1269",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1960,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Add new feedback to google sheets"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4c8a8984-2d8e-4139-866b-6f3536aced07",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
1600
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1407,
|
||||
"height": 254,
|
||||
"content": "## Instructions\n1. Connect Google sheets\n2. Connect your OpenAi account (api key + org Id)\n3. Create a customer feedback form, use an existing one or use the one below as example. \nAll set!\n\n\n- Here is the example google sheet being used in this workflow: https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=sharing. You can download it to your account."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d43a9574-626d-4817-87ba-d99bdd6f41dc",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Feedback form is submitted"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "76dab2dc-935f-416e-91aa-5a1b7017ec1b",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1600,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"width": 253,
|
||||
"height": 342,
|
||||
"content": "## Merge form data and OpenAI result"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9772eac1-8df2-4305-9b2c-265d3c5a9a4a",
|
||||
"name": "Add customer feedback to Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
2020,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"Category": "={{ $json['What is your feedback about?'] }}",
|
||||
"Sentiment": "={{ $json.text }}",
|
||||
"Timestamp": "={{ $json.submittedAt }}",
|
||||
"Entered by": "=Form",
|
||||
"Customer Name": "={{ $json.Name }}",
|
||||
"Customer contact": "={{ $json['How do we get in touch with you?'] }}",
|
||||
"Customer Feedback": "={{ $json['Your feedback'] }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "Timestamp",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Timestamp",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Category",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Category",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer Feedback",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer Feedback",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer Name",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer Name",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Customer contact",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Customer contact",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Entered by",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Entered by",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Urgent?",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Urgent?",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Sentiment",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Sentiment",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": []
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1omWdRbiT6z6GNZ6JClu9gEsRhPQ6J0EJ2yXyFH9Zng4/edit?usp=drivesdk",
|
||||
"cachedResultName": "CustomerFeedback"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "3",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "12084971-c81b-4a0e-814e-120867562642",
|
||||
"name": "Merge sentiment with form content",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1680,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "multiplex"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "235edf5b-7724-4712-8dc5-d8327a0620b8",
|
||||
"name": "Classify feedback with OpenAI",
|
||||
"type": "n8n-nodes-base.openAi",
|
||||
"position": [
|
||||
1280,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"prompt": "=Classify the sentiment in the following customer feedback: {{ $json['Your feedback'] }}",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "s2iucY0IctjYNbrb",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af4b22aa-0925-40b1-a9ac-298f9745a98e",
|
||||
"name": "Submit form with customer feedback",
|
||||
"type": "n8n-nodes-base.formTrigger",
|
||||
"position": [
|
||||
860,
|
||||
1340
|
||||
],
|
||||
"webhookId": "e7bf682e-48e8-40de-9815-cd180cdd1480",
|
||||
"parameters": {
|
||||
"options": {
|
||||
"formSubmittedText": "Your response has been recorded"
|
||||
},
|
||||
"formTitle": "Customer Feedback",
|
||||
"formFields": {
|
||||
"values": [
|
||||
{
|
||||
"fieldLabel": "Name",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "dropdown",
|
||||
"fieldLabel": "What is your feedback about?",
|
||||
"fieldOptions": {
|
||||
"values": [
|
||||
{
|
||||
"option": "Product"
|
||||
},
|
||||
{
|
||||
"option": "Service"
|
||||
},
|
||||
{
|
||||
"option": "Other"
|
||||
}
|
||||
]
|
||||
},
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldType": "textarea",
|
||||
"fieldLabel": "Your feedback",
|
||||
"requiredField": true
|
||||
},
|
||||
{
|
||||
"fieldLabel": "How do we get in touch with you?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"formDescription": "Please give feedback about our company orproducts."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Classify feedback with OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge sentiment with form content",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge sentiment with form content": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add customer feedback to Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Submit form with customer feedback": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Classify feedback with OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge sentiment with form content",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,257 +0,0 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "c3ef40df-084e-435c-9a11-3aa0a2f94f36",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
740,
|
||||
520
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e0583472-a450-4582-83bc-84a014bea543",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1640,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "output.results"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b8aa573d-5b63-4669-900f-bcc915b6ad41",
|
||||
"name": "Save to Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1900,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {},
|
||||
"schema": [
|
||||
{
|
||||
"id": "name",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "name",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "price",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "price",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "availability",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "availability",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "image",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "image",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "autoMapInputData",
|
||||
"matchingColumns": [
|
||||
"Book prices"
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": 258629074,
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit#gid=258629074",
|
||||
"cachedResultName": "Sheet2"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit?usp=drivesdk",
|
||||
"cachedResultName": "Book Prices"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GHRceL2SKjXxz0Dx",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "a63c3ab3-6aab-43b2-8af6-8b00e24e0ee6",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1300,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "5oYe8Cxj7liOPAKk",
|
||||
"name": "Derek T"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "40326966-0c46-4df2-8d80-fa014e05b693",
|
||||
"name": "Information Extractor",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
1260,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.data }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value.\nAlways output the data in a json array called results. Each book should have a title, price, availability and product_url, image_url"
|
||||
},
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n \"results\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"price\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"image_url\": {\n \"type\": \"string\"\n },\n \"product_url\": {\n \"type\": \"string\"\n },\n \"availability\": {\n \"type\": \"string\"\n } \n }\n }\n }\n}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8ddca560-8da7-4090-b865-0523f95ca463",
|
||||
"name": "Jina Fetch",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1020,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://r.jina.ai/http://books.toscrape.com/catalogue/category/books/historical-fiction_4/index.html",
|
||||
"options": {
|
||||
"allowUnauthorizedCerts": true
|
||||
},
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "ALBmOXmADcPmyHr1",
|
||||
"name": "jina"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "b1745cea-fdbe-4f14-b09c-884549beac7e",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 587,
|
||||
"height": 570,
|
||||
"content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[](https://youtu.be/f3AJYXHirr8)\n\n[Google Sheet Example](https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit?usp=sharing)\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save to Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Jina Fetch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Information Extractor",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Information Extractor",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Information Extractor": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Jina Fetch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "c3ef40df-084e-435c-9a11-3aa0a2f94f36",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
740,
|
||||
520
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e0583472-a450-4582-83bc-84a014bea543",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1640,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "output.results"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b8aa573d-5b63-4669-900f-bcc915b6ad41",
|
||||
"name": "Save to Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1900,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {},
|
||||
"schema": [
|
||||
{
|
||||
"id": "name",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "name",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "price",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "price",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "availability",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "availability",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "image",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "image",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "autoMapInputData",
|
||||
"matchingColumns": [
|
||||
"Book prices"
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": 258629074,
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit#gid=258629074",
|
||||
"cachedResultName": "Sheet2"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit?usp=drivesdk",
|
||||
"cachedResultName": "Book Prices"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GHRceL2SKjXxz0Dx",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "a63c3ab3-6aab-43b2-8af6-8b00e24e0ee6",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1300,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "5oYe8Cxj7liOPAKk",
|
||||
"name": "Derek T"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "40326966-0c46-4df2-8d80-fa014e05b693",
|
||||
"name": "Information Extractor",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
1260,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.data }}",
|
||||
"options": {
|
||||
"systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value.\nAlways output the data in a json array called results. Each book should have a title, price, availability and product_url, image_url"
|
||||
},
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n \"results\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"price\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"image_url\": {\n \"type\": \"string\"\n },\n \"product_url\": {\n \"type\": \"string\"\n },\n \"availability\": {\n \"type\": \"string\"\n } \n }\n }\n }\n}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8ddca560-8da7-4090-b865-0523f95ca463",
|
||||
"name": "Jina Fetch",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1020,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://r.jina.ai/http://books.toscrape.com/catalogue/category/books/historical-fiction_4/index.html",
|
||||
"options": {
|
||||
"allowUnauthorizedCerts": true
|
||||
},
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth"
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "ALBmOXmADcPmyHr1",
|
||||
"name": "jina"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "b1745cea-fdbe-4f14-b09c-884549beac7e",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 587,
|
||||
"height": 570,
|
||||
"content": "## Start here: Step-by Step Youtube Tutorial :star:\n\n[](https://youtu.be/f3AJYXHirr8)\n\n[Google Sheet Example](https://docs.google.com/spreadsheets/d/1VDbfi2PpeheD2ZlO6feX3RdMeSsm0XukQlNVW8uVcuo/edit?usp=sharing)\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save to Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Jina Fetch": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Information Extractor",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Information Extractor",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Information Extractor": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Jina Fetch",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,423 +0,0 @@
|
||||
{
|
||||
"id": "TtoDcjgthgA4NTkU",
|
||||
"meta": {
|
||||
"instanceId": "fb261afc5089eae952e09babdadd9983000b3d863639802f6ded8c5be2e40067",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "AI Voice Chat using Webhook, Memory Manager, OpenAI, Google Gemini & ElevenLabs",
|
||||
"tags": [
|
||||
{
|
||||
"id": "mqOrNvCDgQLzPA2x",
|
||||
"name": "Workflows",
|
||||
"createdAt": "2024-08-07T14:18:53.614Z",
|
||||
"updatedAt": "2024-08-07T14:18:53.614Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "86cbf150-df4f-42f7-b7b3-e03c32e6f23c",
|
||||
"name": "Get Chat",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
1700,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "a9153a24-e902-4f29-9b83-447317ce3119",
|
||||
"name": "Insert Chat",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
2540,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "user",
|
||||
"message": "={{ $('OpenAI - Speech to Text').item.json[\"text\"] }}"
|
||||
},
|
||||
{
|
||||
"type": "ai",
|
||||
"message": "={{ $json.text }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "f5c272d4-248b-45a5-87b5-eb659a865d05",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1664,
|
||||
-491
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 486.4746124819703,
|
||||
"height": 238.4911357933579,
|
||||
"content": "## Get Context"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "32ad17ca-0045-487d-9387-71c2e73629d4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2510,
|
||||
-489
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 321.2536584847704,
|
||||
"height": 231.05945912581728,
|
||||
"content": "## Save Context"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "17ae4f1a-6192-4c52-8157-3cb47b37e0fb",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2020,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "context"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "00b3081e-fbcd-489b-b45a-4e847c346594",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
2080,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "test-0dacb3b5-4bcd-47dd-8456-dcfd8c258204",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "55ca2790-e905-414a-a9f6-7d88a9e5807d",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
2220,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "2bUF1ZI9hoMIM5XN",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8b3433f-b205-404c-9f05-504556d6b6dd",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
3560,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "binary"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "de296743-5ac7-454b-bf3a-d020cc024511",
|
||||
"name": "ElevenLabs - Generate Audio",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
3240,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.elevenlabs.io/v1/text-to-speech/{{voice id}}",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "text",
|
||||
"value": "={{ $('Basic LLM Chain').item.json.text }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"genericAuthType": "httpCustomAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpCustomAuth": {
|
||||
"id": "lnGfV4BlxSE6Xc4X",
|
||||
"name": "Eleven Labs"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "214e15f2-8a16-4598-b4ac-9fc2ec6545e6",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3040,
|
||||
-560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 468.73250812192407,
|
||||
"height": 843.7602354099661,
|
||||
"content": "* ### For the Text-to-Speech part, we'll use ElevenLabs.io, which is free and offers a variety of voices to choose from. However, you can also use the OpenAI `\"Generate audio\"` node instead.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n* ### Since there is no pre-built node for `\"ElevenLabs\"` in n8n, we'll connect to it through its API using the \"HTTP Request\" node.\n\n## Prerequisites:\n* ### `\"ElevenLabs API Key\"` (you can obtain it from their website).\n* ### `\"Voice ID\"` (you can also get it from ElevenLabs' \"Voice Library\").\n## Setup\n* ### In the URL parameter, replace \"{{voice id}}\" at the end of the URL with the Voice ID you obtained from ElevenLabs.io.\n* ### To set up your API Key, add custom authentication and include the following `JSON` with your acual ElevenLabs API Key:\n```json\n{\n \"headers\": {\n \"xi-api-key\": \"put-your-API-Key-here\"\n }\n}\n```"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "94ad934c-4a13-47b1-83a5-76fab43b3a47",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1663,
|
||||
-598
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 487.4293487597613,
|
||||
"height": 91.01435855269375,
|
||||
"content": "### The \"Get Chat,\" \"Insert Chat,\" and \"Window Buffer Memory\" nodes will help the LLM model maintain context throughout the conversation."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0a96f48d-0d8b-4240-9eab-a681bfd4c8b5",
|
||||
"name": "Limit",
|
||||
"type": "n8n-nodes-base.limit",
|
||||
"position": [
|
||||
2900,
|
||||
-400
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a5d4ddb-6403-4758-858e-9fbe10c421a9",
|
||||
"name": "Basic LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
2200,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('OpenAI - Speech to Text').item.json[\"text\"] }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "AIMessagePromptTemplate",
|
||||
"message": "=To maintain context and fully understand the user's question, always review the previous conversation between you and him before providing an answer.\nThis is the previous conversation:\n{{ $('Aggregate').item.json[\"context\"].map(m => `\nHuman: ${m.human || 'undefined'}\nAI Assistant: ${m.ai || 'undefined'}\n`).join('') }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "f2f99895-9678-41b8-ad28-db40e1e23dc0",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1320,
|
||||
-400
|
||||
],
|
||||
"webhookId": "e9f611eb-a8dd-4520-8d24-9f36deaca528",
|
||||
"parameters": {
|
||||
"path": "voice_message",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d9a5fb04-4c02-4da4-b690-7b0ecd0ae052",
|
||||
"name": "OpenAI - Speech to Text",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1500,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "audio",
|
||||
"operation": "transcribe",
|
||||
"binaryPropertyName": "voice_message"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "2Cije3KX7OIVwn9B",
|
||||
"name": "n8n OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"executionOrder": "v1",
|
||||
"saveManualExecutions": true
|
||||
},
|
||||
"versionId": "fe5792ca-03d7-4cdd-96db-20f4cd479c7e",
|
||||
"connections": {
|
||||
"Limit": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ElevenLabs - Generate Audio",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Speech to Text",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Chat": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert Chat": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Limit",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Chat",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Chat",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get Chat",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Speech to Text": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Chat",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ElevenLabs - Generate Audio": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
{
|
||||
"id": "TtoDcjgthgA4NTkU",
|
||||
"meta": {
|
||||
"instanceId": "fb261afc5089eae952e09babdadd9983000b3d863639802f6ded8c5be2e40067",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "AI Voice Chat using Webhook, Memory Manager, OpenAI, Google Gemini & ElevenLabs",
|
||||
"tags": [
|
||||
{
|
||||
"id": "mqOrNvCDgQLzPA2x",
|
||||
"name": "Workflows",
|
||||
"createdAt": "2024-08-07T14:18:53.614Z",
|
||||
"updatedAt": "2024-08-07T14:18:53.614Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "86cbf150-df4f-42f7-b7b3-e03c32e6f23c",
|
||||
"name": "Get Chat",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
1700,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "a9153a24-e902-4f29-9b83-447317ce3119",
|
||||
"name": "Insert Chat",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
2540,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "user",
|
||||
"message": "={{ $('OpenAI - Speech to Text').item.json[\"text\"] }}"
|
||||
},
|
||||
{
|
||||
"type": "ai",
|
||||
"message": "={{ $json.text }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "f5c272d4-248b-45a5-87b5-eb659a865d05",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1664,
|
||||
-491
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 486.4746124819703,
|
||||
"height": 238.4911357933579,
|
||||
"content": "## Get Context"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "32ad17ca-0045-487d-9387-71c2e73629d4",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2510,
|
||||
-489
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 321.2536584847704,
|
||||
"height": 231.05945912581728,
|
||||
"content": "## Save Context"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "17ae4f1a-6192-4c52-8157-3cb47b37e0fb",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
2020,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "context"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "00b3081e-fbcd-489b-b45a-4e847c346594",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
2080,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "test-0dacb3b5-4bcd-47dd-8456-dcfd8c258204",
|
||||
"sessionIdType": "customKey"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "55ca2790-e905-414a-a9f6-7d88a9e5807d",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
2220,
|
||||
-100
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "2bUF1ZI9hoMIM5XN",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8b3433f-b205-404c-9f05-504556d6b6dd",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
3560,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "binary"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "de296743-5ac7-454b-bf3a-d020cc024511",
|
||||
"name": "ElevenLabs - Generate Audio",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
3240,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.elevenlabs.io/v1/text-to-speech/{{voice id}}",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"authentication": "genericCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "text",
|
||||
"value": "={{ $('Basic LLM Chain').item.json.text }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"genericAuthType": "httpCustomAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpCustomAuth": {
|
||||
"id": "lnGfV4BlxSE6Xc4X",
|
||||
"name": "Eleven Labs"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "214e15f2-8a16-4598-b4ac-9fc2ec6545e6",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3040,
|
||||
-560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 468.73250812192407,
|
||||
"height": 843.7602354099661,
|
||||
"content": "* ### For the Text-to-Speech part, we'll use ElevenLabs.io, which is free and offers a variety of voices to choose from. However, you can also use the OpenAI `\"Generate audio\"` node instead.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n* ### Since there is no pre-built node for `\"ElevenLabs\"` in n8n, we'll connect to it through its API using the \"HTTP Request\" node.\n\n## Prerequisites:\n* ### `\"ElevenLabs API Key\"` (you can obtain it from their website).\n* ### `\"Voice ID\"` (you can also get it from ElevenLabs' \"Voice Library\").\n## Setup\n* ### In the URL parameter, replace \"{{voice id}}\" at the end of the URL with the Voice ID you obtained from ElevenLabs.io.\n* ### To set up your API Key, add custom authentication and include the following `JSON` with your acual ElevenLabs API Key:\n```json\n{\n \"headers\": {\n \"xi-api-key\": \"put-your-API-Key-here\"\n }\n}\n```"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "94ad934c-4a13-47b1-83a5-76fab43b3a47",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1663,
|
||||
-598
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 487.4293487597613,
|
||||
"height": 91.01435855269375,
|
||||
"content": "### The \"Get Chat,\" \"Insert Chat,\" and \"Window Buffer Memory\" nodes will help the LLM model maintain context throughout the conversation."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0a96f48d-0d8b-4240-9eab-a681bfd4c8b5",
|
||||
"name": "Limit",
|
||||
"type": "n8n-nodes-base.limit",
|
||||
"position": [
|
||||
2900,
|
||||
-400
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9a5d4ddb-6403-4758-858e-9fbe10c421a9",
|
||||
"name": "Basic LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
2200,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $('OpenAI - Speech to Text').item.json[\"text\"] }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "AIMessagePromptTemplate",
|
||||
"message": "=To maintain context and fully understand the user's question, always review the previous conversation between you and him before providing an answer.\nThis is the previous conversation:\n{{ $('Aggregate').item.json[\"context\"].map(m => `\nHuman: ${m.human || 'undefined'}\nAI Assistant: ${m.ai || 'undefined'}\n`).join('') }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "f2f99895-9678-41b8-ad28-db40e1e23dc0",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1320,
|
||||
-400
|
||||
],
|
||||
"webhookId": "e9f611eb-a8dd-4520-8d24-9f36deaca528",
|
||||
"parameters": {
|
||||
"path": "voice_message",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d9a5fb04-4c02-4da4-b690-7b0ecd0ae052",
|
||||
"name": "OpenAI - Speech to Text",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1500,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "audio",
|
||||
"operation": "transcribe",
|
||||
"binaryPropertyName": "voice_message"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "2Cije3KX7OIVwn9B",
|
||||
"name": "n8n OpenAI"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"callerPolicy": "workflowsFromSameOwner",
|
||||
"executionOrder": "v1",
|
||||
"saveManualExecutions": true
|
||||
},
|
||||
"versionId": "fe5792ca-03d7-4cdd-96db-20f4cd479c7e",
|
||||
"connections": {
|
||||
"Limit": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ElevenLabs - Generate Audio",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - Speech to Text",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Chat": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Insert Chat": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Limit",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Chat",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Insert Chat",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get Chat",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - Speech to Text": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Chat",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ElevenLabs - Generate Audio": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,638 +0,0 @@
|
||||
{
|
||||
"id": "ibiHg6umCqvcTF4g",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Voice RAG Chatbot with ElevenLabs and OpenAI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "5898da57-38b0-4d29-af25-fe029cda7c4a",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-180,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.body.question }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "81bbedb6-5a07-4977-a68f-2bdc75b17aba",
|
||||
"name": "Vector Store Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
20,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"name": "company",
|
||||
"description": "Risponde alle domande relative a ciò che ti viene chiesto"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fd021f6c-248d-41f4-a4f9-651e70692327",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-140,
|
||||
1300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "84aca7bb-4812-498f-b319-88831e4ca412",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-140,
|
||||
1460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "82e430db-2ad7-427d-bcf9-6aa226253d18",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-760,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 1400,
|
||||
"height": 240,
|
||||
"content": "# STEP 4\n\n## RAG System\n\nClick on \"test workflow\" on n8n and \"Test AI agent\" on ElevenLabs. If everything is configured correctly, when you ask a question to the agent, the webhook on n8n is activated with the \"question\" field in the body filled with the question asked to the voice agent.\n\nThe AI Agent will extract the information from the vector database, send it to the model to create the response which will be sent via the response webhook to ElevenLabs which will transform it into voice"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6a19e9fa-50fa-4d51-ba41-d03c999e4649",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-780,
|
||||
-880
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 1420,
|
||||
"height": 360,
|
||||
"content": "# STEP 1\n\n## Create an Agent on ElevenLabs \n- Create an agent on ElevenLabs (eg. test_n8n)\n- Add \"First message\" (eg. Hi, Can I help you?)\n- Add the \"System Prompt\" message... eg:\n'You are the waiter of \"Pizzeria da Michele\" in Verona. If you are asked a question, use the tool \"test_chatbot_elevenlabs\". When you receive the answer from \"test_chatbot_elevenlabs\" answer the user clearly and precisely.'\n- In Tools add a Webhook called eg. \"test_chatbot_elevenlabs\" and add the following description:\n'You are the waiter. Answer the questions asked and store them in the question field.'\n- Add the n8n webhook URL (method POST)\n- Enable \"Body Parameters\" and insert in the description \"Ask the user the question to ask the place.\", then in the \"Properties\" add a data type string called \"question\", value type \"LLM Prompt\" and description \"user question\""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec053ee7-3a4a-4697-a08c-5645810d23f0",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-740,
|
||||
-200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3e71e40c-a5cc-40cf-a159-aeedc97c47d1",
|
||||
"name": "Create collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-440,
|
||||
-340
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "240283fc-50ec-475c-bd24-e6d0a367c10c",
|
||||
"name": "Refresh collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-440,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION/points/delete",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "7d10fda0-c6ab-4bf5-b73e-b93a84937eff",
|
||||
"name": "Get folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-220,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=test-whatsapp"
|
||||
}
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "c5761ad2-e66f-4d65-b653-0e89ea017f17",
|
||||
"name": "Download Files",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
0,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "text/plain"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "1f031a11-8ef3-4392-a7db-9bca00840b8f",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
380,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7f614392-7bc7-408c-8108-f289a81d5cf6",
|
||||
"name": "Token Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
|
||||
"position": [
|
||||
360,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"chunkSize": 300,
|
||||
"chunkOverlap": 30
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "648c5b3d-37a8-4a89-b88c-38e1863f09dc",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 880,
|
||||
"height": 220,
|
||||
"content": "# STEP 2\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a6c50f3c-3c73-464e-9bdc-49de96401c1b",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
240,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7e19ac49-4d90-4258-bd44-7ca4ffa0128a",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
220,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "bfa104a2-1f9c-4200-ae7b-4659894c1e6f",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-460,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 620,
|
||||
"height": 400,
|
||||
"content": "# STEP 3\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a148ffcf-335f-455d-8509-d98c711ed740",
|
||||
"name": "Respond to ElevenLabs",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
380,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5d19f73a-b8e8-4e75-8f67-836180597572",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-300,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "802b76e1-3f3e-490c-9e3b-65dc5b28d906",
|
||||
"name": "Listen",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-700,
|
||||
800
|
||||
],
|
||||
"webhookId": "e9f611eb-a8dd-4520-8d24-9f36deaca528",
|
||||
"parameters": {
|
||||
"path": "test_voice_message_elevenlabs",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "bdc55a38-1d4b-48fe-bbd8-29bf1afd954a",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
-140,
|
||||
1040
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "2d5dd8cb-81eb-41bc-af53-b894e69e530c",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
200,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "92d04432-1dbb-4d79-9edc-42378aee1c53",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-760,
|
||||
1620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1400,
|
||||
"height": 240,
|
||||
"content": "# STEP 5\n\n## Add Widget\n\nAdd the widget to your business website by replacing AGENT_ID with the agent id you created on ElevenLabs\n\n<elevenlabs-convai agent-id=\"AGENT_ID\"></elevenlabs-convai><script src=\"https://elevenlabs.io/convai-widget/index.js\" async type=\"text/javascript\"></script>"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "6738abfe-e626-488d-a00b-81021cb04aaf",
|
||||
"connections": {
|
||||
"Listen": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to ElevenLabs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Token Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Refresh collection": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Refresh collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,638 @@
|
||||
{
|
||||
"id": "ibiHg6umCqvcTF4g",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Voice RAG Chatbot with ElevenLabs and OpenAI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "5898da57-38b0-4d29-af25-fe029cda7c4a",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-180,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.body.question }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "81bbedb6-5a07-4977-a68f-2bdc75b17aba",
|
||||
"name": "Vector Store Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
20,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"name": "company",
|
||||
"description": "Risponde alle domande relative a ciò che ti viene chiesto"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fd021f6c-248d-41f4-a4f9-651e70692327",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-140,
|
||||
1300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "84aca7bb-4812-498f-b319-88831e4ca412",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-140,
|
||||
1460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "82e430db-2ad7-427d-bcf9-6aa226253d18",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-760,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 1400,
|
||||
"height": 240,
|
||||
"content": "# STEP 4\n\n## RAG System\n\nClick on \"test workflow\" on n8n and \"Test AI agent\" on ElevenLabs. If everything is configured correctly, when you ask a question to the agent, the webhook on n8n is activated with the \"question\" field in the body filled with the question asked to the voice agent.\n\nThe AI Agent will extract the information from the vector database, send it to the model to create the response which will be sent via the response webhook to ElevenLabs which will transform it into voice"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6a19e9fa-50fa-4d51-ba41-d03c999e4649",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-780,
|
||||
-880
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 1420,
|
||||
"height": 360,
|
||||
"content": "# STEP 1\n\n## Create an Agent on ElevenLabs \n- Create an agent on ElevenLabs (eg. test_n8n)\n- Add \"First message\" (eg. Hi, Can I help you?)\n- Add the \"System Prompt\" message... eg:\n'You are the waiter of \"Pizzeria da Michele\" in Verona. If you are asked a question, use the tool \"test_chatbot_elevenlabs\". When you receive the answer from \"test_chatbot_elevenlabs\" answer the user clearly and precisely.'\n- In Tools add a Webhook called eg. \"test_chatbot_elevenlabs\" and add the following description:\n'You are the waiter. Answer the questions asked and store them in the question field.'\n- Add the n8n webhook URL (method POST)\n- Enable \"Body Parameters\" and insert in the description \"Ask the user the question to ask the place.\", then in the \"Properties\" add a data type string called \"question\", value type \"LLM Prompt\" and description \"user question\""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec053ee7-3a4a-4697-a08c-5645810d23f0",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-740,
|
||||
-200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3e71e40c-a5cc-40cf-a159-aeedc97c47d1",
|
||||
"name": "Create collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-440,
|
||||
-340
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "240283fc-50ec-475c-bd24-e6d0a367c10c",
|
||||
"name": "Refresh collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-440,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION/points/delete",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "7d10fda0-c6ab-4bf5-b73e-b93a84937eff",
|
||||
"name": "Get folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-220,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=test-whatsapp"
|
||||
}
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "c5761ad2-e66f-4d65-b653-0e89ea017f17",
|
||||
"name": "Download Files",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
0,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "text/plain"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "1f031a11-8ef3-4392-a7db-9bca00840b8f",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
380,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7f614392-7bc7-408c-8108-f289a81d5cf6",
|
||||
"name": "Token Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
|
||||
"position": [
|
||||
360,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"chunkSize": 300,
|
||||
"chunkOverlap": 30
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "648c5b3d-37a8-4a89-b88c-38e1863f09dc",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 880,
|
||||
"height": 220,
|
||||
"content": "# STEP 2\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a6c50f3c-3c73-464e-9bdc-49de96401c1b",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
240,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7e19ac49-4d90-4258-bd44-7ca4ffa0128a",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
220,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "bfa104a2-1f9c-4200-ae7b-4659894c1e6f",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-460,
|
||||
-140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 620,
|
||||
"height": 400,
|
||||
"content": "# STEP 3\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a148ffcf-335f-455d-8509-d98c711ed740",
|
||||
"name": "Respond to ElevenLabs",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
380,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5d19f73a-b8e8-4e75-8f67-836180597572",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-300,
|
||||
1040
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "802b76e1-3f3e-490c-9e3b-65dc5b28d906",
|
||||
"name": "Listen",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-700,
|
||||
800
|
||||
],
|
||||
"webhookId": "e9f611eb-a8dd-4520-8d24-9f36deaca528",
|
||||
"parameters": {
|
||||
"path": "test_voice_message_elevenlabs",
|
||||
"options": {},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "bdc55a38-1d4b-48fe-bbd8-29bf1afd954a",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
-140,
|
||||
1040
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "2d5dd8cb-81eb-41bc-af53-b894e69e530c",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
200,
|
||||
1320
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "92d04432-1dbb-4d79-9edc-42378aee1c53",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-760,
|
||||
1620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1400,
|
||||
"height": 240,
|
||||
"content": "# STEP 5\n\n## Add Widget\n\nAdd the widget to your business website by replacing AGENT_ID with the agent id you created on ElevenLabs\n\n<elevenlabs-convai agent-id=\"AGENT_ID\"></elevenlabs-convai><script src=\"https://elevenlabs.io/convai-widget/index.js\" async type=\"text/javascript\"></script>"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "6738abfe-e626-488d-a00b-81021cb04aaf",
|
||||
"connections": {
|
||||
"Listen": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to ElevenLabs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Token Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Refresh collection": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Refresh collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,488 +0,0 @@
|
||||
{
|
||||
"id": "XSyVFC1tsGSxNwX9",
|
||||
"meta": {
|
||||
"instanceId": "60ad864624415060d2d0a0e71acd8b3b40e4ee2e9ef4b439d9937d3d33537a96"
|
||||
},
|
||||
"name": "Complete Youtube",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "fd74706b-609b-4723-b4a4-067e1b064194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
300,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "=You help youtube creators find trending videos based on a specific niche.\n\nVerify if the user informed a niche before doing anything. If not, then ask him for one by giving him suggestions for him to select from.\n\nAfter you know what type of content the user might produce, use the \"youtube_search\" tool up to 3 times with different search terms based on the user's content type and niche.\n\nThe tool will answer with a list of videos from the last 2 days that had the most amount of relevancy. It returns a list of json's covering each video's id, view count, like count, comment count, description, channel title, tags and channel id. Each video is separated by \"### NEXT VIDEO FOUND: ###\".\n\nYou should then proceed to understand the data received then provide the user with insightful data of what could be trending from the past 2 days. Provide the user links to the trending videos which should be in this structure:\n\nhttps://www.youtube.com/watch?v={video_id}\n\nto reach the channel's link you should use:\n\nhttps://www.youtube.com/channel/{channel_id}\n\nFind patterns in the tags, titles and especially in the related content for the videos found.\n\nYour mission isn't to find the trending videos. It's to provide the user with valuable information of what is trending in that niche in terms of content news. Remember to provide the user with the numbers of views, likes and comments while commenting about any video. So you should not talk about any particular video, focus rather in explaining the overall senario of all that was found.\n\nExample of response:\n\n\"It seems like what is trending in digital marketing right now is talking about mental triggers, since 3 of the most trending videos in the last 2 days were about...\""
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "ced4b937-b590-4727-b1f2-a5e88b96091a",
|
||||
"name": "chat_message_received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
80,
|
||||
60
|
||||
],
|
||||
"webhookId": "ff9622a4-a6ec-4396-b9de-c95bd834c23c",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "35a91359-5007-407d-a750-d6642e595690",
|
||||
"name": "youtube_search",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
540,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"name": "youtube_search",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "N9DveO781xbNf8qs",
|
||||
"cachedResultName": "Youtube Search Workflow"
|
||||
},
|
||||
"description": "Call this tool to search for trending videos based on a query.",
|
||||
"jsonSchemaExample": "{\n\t\"search_term\": \"some_value\"\n}",
|
||||
"specifyInputSchema": true
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "42f41096-531d-4587-833a-6f659ef78dd0",
|
||||
"name": "openai_llm",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
260,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e4bda5b9-abd4-4cd6-8c95-126a01aa6e21",
|
||||
"name": "window_buffer_memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
400,
|
||||
180
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "f6d86c5a-393a-4bcf-bdaf-3b06c79fa51d",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 693.2572054941234,
|
||||
"height": 354.53098948245656,
|
||||
"content": "Main Workflow"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ddbc3f0-e3d7-4ce4-a732-d731c05024d2",
|
||||
"name": "find_video_data1",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
700,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/youtube/v3/videos?",
|
||||
"options": {},
|
||||
"sendQuery": true,
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "key",
|
||||
"value": "={{ $env[\"GOOGLE_API_KEY\"] }}"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"value": "={{ $json.id.videoId }}"
|
||||
},
|
||||
{
|
||||
"name": "part",
|
||||
"value": "contentDetails, snippet, statistics"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "fdb28635-801d-4ce0-8919-11446c6a7a82",
|
||||
"name": "get_videos1",
|
||||
"type": "n8n-nodes-base.youTube",
|
||||
"position": [
|
||||
280,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 3,
|
||||
"filters": {
|
||||
"q": "={{ $json.query.search_term }}",
|
||||
"regionCode": "US",
|
||||
"publishedAfter": "={{ new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString() }}"
|
||||
},
|
||||
"options": {
|
||||
"order": "relevance",
|
||||
"safeSearch": "moderate"
|
||||
},
|
||||
"resource": "video"
|
||||
},
|
||||
"credentials": {
|
||||
"youTubeOAuth2Api": {
|
||||
"id": "dCyrga3t1tlgQQy0",
|
||||
"name": "YouTube account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "60e9e61d-0e5e-4212-8b55-71299aeec4d5",
|
||||
"name": "response1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1100,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "b9b9117b-ea14-482e-a13b-e68b8e6b441d",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ $input.all() }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "254a6740-8b25-4898-9795-4c3f0009471f",
|
||||
"name": "group_data1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1160,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "47c172ad-90c8-4cf6-a9f5-50607e04cc90",
|
||||
"name": "id",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].id }}"
|
||||
},
|
||||
{
|
||||
"id": "9e639efa-0714-4b06-9847-f7b4b2fbef59",
|
||||
"name": "viewCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.viewCount }}"
|
||||
},
|
||||
{
|
||||
"id": "93328f00-91b8-425b-ad0f-a330b2f95242",
|
||||
"name": "likeCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.likeCount }}"
|
||||
},
|
||||
{
|
||||
"id": "015b0fb2-2a98-464c-a21b-51100616f26a",
|
||||
"name": "commentCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.commentCount }}"
|
||||
},
|
||||
{
|
||||
"id": "cf1e1ec3-a138-42b8-8747-d249afa58dd3",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.description }}"
|
||||
},
|
||||
{
|
||||
"id": "c5c9a3a2-b820-4932-a38a-e21102992215",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.title }}"
|
||||
},
|
||||
{
|
||||
"id": "38216ead-1f8d-4f93-b6ad-5ef709a1ad2a",
|
||||
"name": "channelTitle",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.channelTitle }}"
|
||||
},
|
||||
{
|
||||
"id": "ff34194d-3d46-43a8-9127-84708987f536",
|
||||
"name": "tags",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.tags.join(', ') }}"
|
||||
},
|
||||
{
|
||||
"id": "e50b0f7b-3e37-4557-8863-d68d4fa505c8",
|
||||
"name": "channelId",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.channelId }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "124c19a9-cbbd-4010-be37-50523c05f64b",
|
||||
"name": "save_data_to_memory1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1360,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nif (typeof workflowStaticData.lastExecution !== 'object') {\n workflowStaticData.lastExecution = {\n response: \"\"\n };\n}\n\nfunction removeEmojis(text) {\n return text.replace(/[\\u{1F600}-\\u{1F64F}|\\u{1F300}-\\u{1F5FF}|\\u{1F680}-\\u{1F6FF}|\\u{2600}-\\u{26FF}|\\u{2700}-\\u{27BF}]/gu, '');\n}\n\nfunction cleanDescription(description) {\n return description\n .replace(/https?:\\/\\/\\S+/g, '')\n .replace(/www\\.\\S+/g, '')\n .replace(/ +/g, ' ')\n .trim();\n}\n\nconst currentItem = { ...$input.item };\n\nif (currentItem.description) {\n currentItem.description = cleanDescription(currentItem.description);\n}\n\nlet sanitizedItem = JSON.stringify(currentItem)\n .replace(/\\\\r/g, ' ')\n .replace(/https?:\\/\\/\\S+/g, '')\n .replace(/www\\.\\S+/g, '')\n .replace(/\\\\n/g, ' ')\n .replace(/\\n/g, ' ')\n .replace(/\\\\/g, '')\n .replace(/ +/g, ' ')\n .trim();\n\nif (workflowStaticData.lastExecution.response) {\n workflowStaticData.lastExecution.response += ' ### NEXT VIDEO FOUND: ### ';\n}\n\nworkflowStaticData.lastExecution.response += removeEmojis(sanitizedItem);\n\nreturn workflowStaticData.lastExecution;\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "67f92ec4-71c0-49df-a0ea-11d2e3cf0f94",
|
||||
"name": "retrieve_data_from_memory1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
780,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nconst lastExecution = workflowStaticData.lastExecution;\n\nreturn lastExecution;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "685820ba-b089-4cdc-984d-52f134754b5c",
|
||||
"name": "loop_over_items1",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
500,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "3d4d5a4b-d06b-41db-bb78-a64a266d5308",
|
||||
"name": "if_longer_than_3_",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
880,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "08ba3db9-6bcf-47f8-a74d-9e26f28cb08f",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ \n (() => {\n const duration = $json.items[0].contentDetails.duration;\n\n // Helper function to convert ISO 8601 duration to seconds\n const iso8601ToSeconds = iso8601 => {\n const match = iso8601.match(/PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?/);\n const hours = parseInt(match[1] || 0, 10);\n const minutes = parseInt(match[2] || 0, 10);\n const seconds = parseInt(match[3] || 0, 10);\n return hours * 3600 + minutes * 60 + seconds;\n };\n\n // Convert duration to seconds\n const durationInSeconds = iso8601ToSeconds(duration);\n\n // Check if greater than 210 seconds (3 minutes 30 seconds)\n return durationInSeconds > 210;\n })() \n}}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "7c6b8b82-fd6c-4f44-bccf-88c5a76f0319",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 1607,
|
||||
"height": 520,
|
||||
"content": "This part should be abstracted to another workflow and called inside the \"youtube_search\" tool of the main AI Agent."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "cea84238-2b82-4a32-85dd-0c71ad685d47",
|
||||
"connections": {
|
||||
"openai_llm": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"get_videos1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"group_data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "save_data_to_memory1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"youtube_search": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"find_video_data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "if_longer_than_3_",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"loop_over_items1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "retrieve_data_from_memory1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "find_video_data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"if_longer_than_3_": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "group_data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"save_data_to_memory1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"window_buffer_memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"chat_message_received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"retrieve_data_from_memory1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "response1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
488
OpenAI_and_LLMs/AI Youtube Trend Finder Based On Niche.txt
Normal file
488
OpenAI_and_LLMs/AI Youtube Trend Finder Based On Niche.txt
Normal file
@@ -0,0 +1,488 @@
|
||||
{
|
||||
"id": "XSyVFC1tsGSxNwX9",
|
||||
"meta": {
|
||||
"instanceId": "60ad864624415060d2d0a0e71acd8b3b40e4ee2e9ef4b439d9937d3d33537a96"
|
||||
},
|
||||
"name": "Complete Youtube",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "fd74706b-609b-4723-b4a4-067e1b064194",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
300,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "=You help youtube creators find trending videos based on a specific niche.\n\nVerify if the user informed a niche before doing anything. If not, then ask him for one by giving him suggestions for him to select from.\n\nAfter you know what type of content the user might produce, use the \"youtube_search\" tool up to 3 times with different search terms based on the user's content type and niche.\n\nThe tool will answer with a list of videos from the last 2 days that had the most amount of relevancy. It returns a list of json's covering each video's id, view count, like count, comment count, description, channel title, tags and channel id. Each video is separated by \"### NEXT VIDEO FOUND: ###\".\n\nYou should then proceed to understand the data received then provide the user with insightful data of what could be trending from the past 2 days. Provide the user links to the trending videos which should be in this structure:\n\nhttps://www.youtube.com/watch?v={video_id}\n\nto reach the channel's link you should use:\n\nhttps://www.youtube.com/channel/{channel_id}\n\nFind patterns in the tags, titles and especially in the related content for the videos found.\n\nYour mission isn't to find the trending videos. It's to provide the user with valuable information of what is trending in that niche in terms of content news. Remember to provide the user with the numbers of views, likes and comments while commenting about any video. So you should not talk about any particular video, focus rather in explaining the overall senario of all that was found.\n\nExample of response:\n\n\"It seems like what is trending in digital marketing right now is talking about mental triggers, since 3 of the most trending videos in the last 2 days were about...\""
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "ced4b937-b590-4727-b1f2-a5e88b96091a",
|
||||
"name": "chat_message_received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
80,
|
||||
60
|
||||
],
|
||||
"webhookId": "ff9622a4-a6ec-4396-b9de-c95bd834c23c",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "35a91359-5007-407d-a750-d6642e595690",
|
||||
"name": "youtube_search",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
540,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"name": "youtube_search",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "N9DveO781xbNf8qs",
|
||||
"cachedResultName": "Youtube Search Workflow"
|
||||
},
|
||||
"description": "Call this tool to search for trending videos based on a query.",
|
||||
"jsonSchemaExample": "{\n\t\"search_term\": \"some_value\"\n}",
|
||||
"specifyInputSchema": true
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "42f41096-531d-4587-833a-6f659ef78dd0",
|
||||
"name": "openai_llm",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
260,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e4bda5b9-abd4-4cd6-8c95-126a01aa6e21",
|
||||
"name": "window_buffer_memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
400,
|
||||
180
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "f6d86c5a-393a-4bcf-bdaf-3b06c79fa51d",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 693.2572054941234,
|
||||
"height": 354.53098948245656,
|
||||
"content": "Main Workflow"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ddbc3f0-e3d7-4ce4-a732-d731c05024d2",
|
||||
"name": "find_video_data1",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
700,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/youtube/v3/videos?",
|
||||
"options": {},
|
||||
"sendQuery": true,
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "key",
|
||||
"value": "={{ $env[\"GOOGLE_API_KEY\"] }}"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"value": "={{ $json.id.videoId }}"
|
||||
},
|
||||
{
|
||||
"name": "part",
|
||||
"value": "contentDetails, snippet, statistics"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "fdb28635-801d-4ce0-8919-11446c6a7a82",
|
||||
"name": "get_videos1",
|
||||
"type": "n8n-nodes-base.youTube",
|
||||
"position": [
|
||||
280,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 3,
|
||||
"filters": {
|
||||
"q": "={{ $json.query.search_term }}",
|
||||
"regionCode": "US",
|
||||
"publishedAfter": "={{ new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString() }}"
|
||||
},
|
||||
"options": {
|
||||
"order": "relevance",
|
||||
"safeSearch": "moderate"
|
||||
},
|
||||
"resource": "video"
|
||||
},
|
||||
"credentials": {
|
||||
"youTubeOAuth2Api": {
|
||||
"id": "dCyrga3t1tlgQQy0",
|
||||
"name": "YouTube account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "60e9e61d-0e5e-4212-8b55-71299aeec4d5",
|
||||
"name": "response1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1100,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "b9b9117b-ea14-482e-a13b-e68b8e6b441d",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ $input.all() }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "254a6740-8b25-4898-9795-4c3f0009471f",
|
||||
"name": "group_data1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1160,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "47c172ad-90c8-4cf6-a9f5-50607e04cc90",
|
||||
"name": "id",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].id }}"
|
||||
},
|
||||
{
|
||||
"id": "9e639efa-0714-4b06-9847-f7b4b2fbef59",
|
||||
"name": "viewCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.viewCount }}"
|
||||
},
|
||||
{
|
||||
"id": "93328f00-91b8-425b-ad0f-a330b2f95242",
|
||||
"name": "likeCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.likeCount }}"
|
||||
},
|
||||
{
|
||||
"id": "015b0fb2-2a98-464c-a21b-51100616f26a",
|
||||
"name": "commentCount",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].statistics.commentCount }}"
|
||||
},
|
||||
{
|
||||
"id": "cf1e1ec3-a138-42b8-8747-d249afa58dd3",
|
||||
"name": "description",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.description }}"
|
||||
},
|
||||
{
|
||||
"id": "c5c9a3a2-b820-4932-a38a-e21102992215",
|
||||
"name": "title",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.title }}"
|
||||
},
|
||||
{
|
||||
"id": "38216ead-1f8d-4f93-b6ad-5ef709a1ad2a",
|
||||
"name": "channelTitle",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.channelTitle }}"
|
||||
},
|
||||
{
|
||||
"id": "ff34194d-3d46-43a8-9127-84708987f536",
|
||||
"name": "tags",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.tags.join(', ') }}"
|
||||
},
|
||||
{
|
||||
"id": "e50b0f7b-3e37-4557-8863-d68d4fa505c8",
|
||||
"name": "channelId",
|
||||
"type": "string",
|
||||
"value": "={{ $json.items[0].snippet.channelId }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "124c19a9-cbbd-4010-be37-50523c05f64b",
|
||||
"name": "save_data_to_memory1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1360,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nif (typeof workflowStaticData.lastExecution !== 'object') {\n workflowStaticData.lastExecution = {\n response: \"\"\n };\n}\n\nfunction removeEmojis(text) {\n return text.replace(/[\\u{1F600}-\\u{1F64F}|\\u{1F300}-\\u{1F5FF}|\\u{1F680}-\\u{1F6FF}|\\u{2600}-\\u{26FF}|\\u{2700}-\\u{27BF}]/gu, '');\n}\n\nfunction cleanDescription(description) {\n return description\n .replace(/https?:\\/\\/\\S+/g, '')\n .replace(/www\\.\\S+/g, '')\n .replace(/ +/g, ' ')\n .trim();\n}\n\nconst currentItem = { ...$input.item };\n\nif (currentItem.description) {\n currentItem.description = cleanDescription(currentItem.description);\n}\n\nlet sanitizedItem = JSON.stringify(currentItem)\n .replace(/\\\\r/g, ' ')\n .replace(/https?:\\/\\/\\S+/g, '')\n .replace(/www\\.\\S+/g, '')\n .replace(/\\\\n/g, ' ')\n .replace(/\\n/g, ' ')\n .replace(/\\\\/g, '')\n .replace(/ +/g, ' ')\n .trim();\n\nif (workflowStaticData.lastExecution.response) {\n workflowStaticData.lastExecution.response += ' ### NEXT VIDEO FOUND: ### ';\n}\n\nworkflowStaticData.lastExecution.response += removeEmojis(sanitizedItem);\n\nreturn workflowStaticData.lastExecution;\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "67f92ec4-71c0-49df-a0ea-11d2e3cf0f94",
|
||||
"name": "retrieve_data_from_memory1",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
780,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const workflowStaticData = $getWorkflowStaticData('global');\n\nconst lastExecution = workflowStaticData.lastExecution;\n\nreturn lastExecution;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "685820ba-b089-4cdc-984d-52f134754b5c",
|
||||
"name": "loop_over_items1",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
500,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "3d4d5a4b-d06b-41db-bb78-a64a266d5308",
|
||||
"name": "if_longer_than_3_",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
880,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "08ba3db9-6bcf-47f8-a74d-9e26f28cb08f",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ \n (() => {\n const duration = $json.items[0].contentDetails.duration;\n\n // Helper function to convert ISO 8601 duration to seconds\n const iso8601ToSeconds = iso8601 => {\n const match = iso8601.match(/PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?/);\n const hours = parseInt(match[1] || 0, 10);\n const minutes = parseInt(match[2] || 0, 10);\n const seconds = parseInt(match[3] || 0, 10);\n return hours * 3600 + minutes * 60 + seconds;\n };\n\n // Convert duration to seconds\n const durationInSeconds = iso8601ToSeconds(duration);\n\n // Check if greater than 210 seconds (3 minutes 30 seconds)\n return durationInSeconds > 210;\n })() \n}}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "7c6b8b82-fd6c-4f44-bccf-88c5a76f0319",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 1607,
|
||||
"height": 520,
|
||||
"content": "This part should be abstracted to another workflow and called inside the \"youtube_search\" tool of the main AI Agent."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "cea84238-2b82-4a32-85dd-0c71ad685d47",
|
||||
"connections": {
|
||||
"openai_llm": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"get_videos1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"group_data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "save_data_to_memory1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"youtube_search": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"find_video_data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "if_longer_than_3_",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"loop_over_items1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "retrieve_data_from_memory1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "find_video_data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"if_longer_than_3_": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "group_data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"save_data_to_memory1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "loop_over_items1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"window_buffer_memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"chat_message_received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"retrieve_data_from_memory1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "response1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "939bb301-5e12-4d5b-9a56-61a61cca5f0d",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
640,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "372777e8-ce90-4dea-befc-ac1b2eb4729f",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
780,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "7a8f0ad1-1c00-4043-b3e5-c88521140a1a",
|
||||
"name": "SerpAPI",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
920,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"serpApi": {
|
||||
"id": "aJCKjxx6U3K7ydDe",
|
||||
"name": "SerpAPI account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a7624108-e3da-4193-a625-887314216b8b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
360,
|
||||
240
|
||||
],
|
||||
"webhookId": "53c136fe-3e77-4709-a143-fe82746dd8b6",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "6b8b7de8-fe3f-43b5-97ce-a52a9e44eb5e",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
680,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"SerpAPI": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
131
OpenAI_and_LLMs/AI agent chat.txt
Normal file
131
OpenAI_and_LLMs/AI agent chat.txt
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "939bb301-5e12-4d5b-9a56-61a61cca5f0d",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
640,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "372777e8-ce90-4dea-befc-ac1b2eb4729f",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
780,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "7a8f0ad1-1c00-4043-b3e5-c88521140a1a",
|
||||
"name": "SerpAPI",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
920,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"serpApi": {
|
||||
"id": "aJCKjxx6U3K7ydDe",
|
||||
"name": "SerpAPI account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a7624108-e3da-4193-a625-887314216b8b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
360,
|
||||
240
|
||||
],
|
||||
"webhookId": "53c136fe-3e77-4709-a143-fe82746dd8b6",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "6b8b7de8-fe3f-43b5-97ce-a52a9e44eb5e",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
680,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"SerpAPI": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,556 +0,0 @@
|
||||
{
|
||||
"id": "dsKnCFwysROIA4MT",
|
||||
"meta": {
|
||||
"instanceId": "03524270bab2c2dfd5b82778cd1355e56cdda3cf098bf2dfd865e18164c00485"
|
||||
},
|
||||
"name": "Agent with custom HTTP Request",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "e7374976-f3c1-4f60-ae57-9eec65444216",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
763,
|
||||
676
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "97e84a23-9536-43cd-94e9-b8166be8ed32",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
983,
|
||||
896
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4-1106-preview",
|
||||
"options": {
|
||||
"timeout": 300000,
|
||||
"temperature": 0.7,
|
||||
"frequencyPenalty": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "wPFAzp4ZHdLLwvkK",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "63d98361-8978-4042-84e7-53a0e226f946",
|
||||
"name": "HTTP Request",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"onError": "continueRegularOutput",
|
||||
"position": [
|
||||
1360,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ encodeURI($json.query.url) }}",
|
||||
"options": {
|
||||
"response": {
|
||||
"response": {
|
||||
"neverError": true
|
||||
}
|
||||
},
|
||||
"allowUnauthorizedCerts": true
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "17d4b5ae-f5d3-4793-8419-d3c879f7f50d",
|
||||
"name": "Exctract HTML Body",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ $json?.data.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i)[1] }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {},
|
||||
"includeFields": "HTML"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "36c38ee4-724c-4ba2-a59a-ac0bbc912e94",
|
||||
"name": "Is error?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1560,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"boolean": [
|
||||
{
|
||||
"value1": "={{ $json.hasOwnProperty('error') }}",
|
||||
"value2": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4e4d97ce-14a9-4f4f-aa75-f218784d9ed9",
|
||||
"name": "Stringify error message",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "page_content",
|
||||
"stringValue": "={{ $('QUERY_PARAMS').first()?.json?.query?.url == null ? \"INVALID action_input. This should be an HTTP query string like this: \\\"?url=VALIDURL&method=SELECTEDMETHOD\\\". Only a simple string value is accepted. JSON object as an action_input is NOT supported!\" : JSON.stringify($json.error) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {},
|
||||
"includeFields": "HTML"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "8452e5c4-aa29-4a02-9579-8d9da3727bcb",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
760,
|
||||
1200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "063220c2-fa4d-4d5e-9549-7712aaa72921",
|
||||
"name": "Remove extra tags",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1980,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ ($json.HTML || \"HTML BODY CONTENT FOR THIS SEARCH RESULT IS NOT AVAILABLE\").replace(/<script[^>]*>([\\s\\S]*?)<\\/script>|<style[^>]*>([\\s\\S]*?)<\\/style>|<noscript[^>]*>([\\s\\S]*?)<\\/noscript>|<!--[\\s\\S]*?-->|<iframe[^>]*>([\\s\\S]*?)<\\/iframe>|<object[^>]*>([\\s\\S]*?)<\\/object>|<embed[^>]*>([\\s\\S]*?)<\\/embed>|<video[^>]*>([\\s\\S]*?)<\\/video>|<audio[^>]*>([\\s\\S]*?)<\\/audio>|<svg[^>]*>([\\s\\S]*?)<\\/svg>/ig, '')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "036511d7-a4be-4bbf-b4bc-47ddfabfe76f",
|
||||
"name": "Simplify output",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"notes": "remove links and image URLs",
|
||||
"position": [
|
||||
2360,
|
||||
1380
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ $json.HTML.replace(/href\\s*=\\s*\"(.+?)\"/gi, 'href=\"NOURL\"').replace(/src\\s*=\\s*\"(.+?)\"/gi, 'src=\"NOIMG\"')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "5e2b5383-adcf-4de0-a406-4f5d631b5e8a",
|
||||
"name": "Simplify?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
2180,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $('CONFIG').first()?.json?.query?.method }}",
|
||||
"value2": "simplif",
|
||||
"operation": "contains"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a0fc004a-ab0f-4b31-94df-50f5eee69c86",
|
||||
"name": "QUERY_PARAMS",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
960,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "query",
|
||||
"type": "objectValue",
|
||||
"objectValue": "={{ $json.query.substring($json.query.indexOf('?') + 1).split('&').reduce((result, item) => (result[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]), result), {}) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "3b6599d6-ce9a-4861-9b52-07156eb52539",
|
||||
"name": "CONFIG",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1160,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "query.maxlimit",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json?.query?.maxlimit == null ? 70000 : Number($json?.query?.maxlimit) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "14f683be-76f6-4034-9a0e-d785738b135f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
721,
|
||||
1134
|
||||
],
|
||||
"parameters": {
|
||||
"width": 556.25,
|
||||
"height": 235.79999999999995,
|
||||
"content": "### Convert the query string into JSON, apply the limit for a page length"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6deabcb7-a984-48ec-af2a-8c70b3a4e4bf",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"width": 491,
|
||||
"height": 285.7,
|
||||
"content": "## Send an error message:\n1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.\n2. If the query is OK and an error was during the HTTP Request, then send back the original error message."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df1e8d00-0e18-44fa-8f94-8a53c27f7c88",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1200,
|
||||
"height": 472.5,
|
||||
"content": "## Post-processing of the HTML page:\n1. Keep only <BODY> content\n2. Remove inline <SCRIPT> tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.\n3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length\n4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.\n5. Finally, check the page length. If it's too long, send an \"ERROR: PAGE CONTENT TOO LONG\" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6afe96a0-0fba-4ae1-ab8f-f7da56d420b1",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
720,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 616.8597285067872,
|
||||
"height": 483.0226244343891,
|
||||
"content": "## Example ReAct AI Agent\n1. Agent Prompt is default\n2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d5ff2114-1e74-43cf-9f3c-744c241988db",
|
||||
"name": "ReAct AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
983,
|
||||
676
|
||||
],
|
||||
"parameters": {
|
||||
"agent": "reActAgent",
|
||||
"options": {
|
||||
"prefix": "Answer the following questions as best you can. You have access to the following tools:",
|
||||
"suffix": "Begin!\n\n\tQuestion: {input}\n\tThought:{agent_scratchpad}",
|
||||
"suffixChat": "Begin! Reminder to always use the exact characters `Final Answer` when responding.",
|
||||
"humanMessageTemplate": "{input}\n\n{agent_scratchpad}"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cc7aef4a-a1fb-4a69-a670-1f200f9e9541",
|
||||
"name": "Convert to Markdown",
|
||||
"type": "n8n-nodes-base.markdown",
|
||||
"position": [
|
||||
2540,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.HTML }}",
|
||||
"options": {},
|
||||
"destinationKey": "page_content"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "11806e8c-5fc4-4d9d-8144-179356993aa7",
|
||||
"name": "Send Page Content",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2740,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "page_content",
|
||||
"stringValue": "={{ $json.page_content.length < $('CONFIG').first()?.json?.query?.maxlimit ? $json.page_content : \"ERROR: PAGE CONTENT TOO LONG\" }}"
|
||||
},
|
||||
{
|
||||
"name": "page_length",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json.page_content.length }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "a3a6b199-517b-4987-8281-d7997a32f54b",
|
||||
"name": "HTTP_Request_Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1103,
|
||||
896
|
||||
],
|
||||
"parameters": {
|
||||
"name": "HTTP_Request_Tool",
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Call this tool to fetch a webpage content. The input should be a stringified HTTP query parameter like this: \"?url=VALIDURL&method=SELECTEDMETHOD\". \"url\" parameter should contain the valid URL string. \"method\" key can be either \"full\" or \"simplified\". method=full will fetch the whole webpage content in the Markdown format, including page links and image links. method=simplified will return the Markdown content of the page but remove urls and image links from the page content for simplicity. Before calling this tool, think strategically which \"method\" to call. Best of all to use method=simplified. However, if you anticipate that the page request is not final or if you need to extract links from the page, pick method=full.",
|
||||
"responsePropertyName": "page_content"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "9db853c5-3658-47c1-b98a-5858b1c184ec",
|
||||
"connections": {
|
||||
"CONFIG": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HTTP Request",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Is error?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Stringify error message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Exctract HTML Body",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Convert to Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HTTP Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Is error?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"QUERY_PARAMS": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "CONFIG",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Convert to Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HTTP_Request_Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Remove extra tags": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Exctract HTML Body": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Remove extra tags",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Convert to Markdown": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Page Content",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "QUERY_PARAMS",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
556
OpenAI_and_LLMs/AI agent that can scrape webpages.txt
Normal file
556
OpenAI_and_LLMs/AI agent that can scrape webpages.txt
Normal file
@@ -0,0 +1,556 @@
|
||||
{
|
||||
"id": "dsKnCFwysROIA4MT",
|
||||
"meta": {
|
||||
"instanceId": "03524270bab2c2dfd5b82778cd1355e56cdda3cf098bf2dfd865e18164c00485"
|
||||
},
|
||||
"name": "Agent with custom HTTP Request",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "e7374976-f3c1-4f60-ae57-9eec65444216",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
763,
|
||||
676
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "97e84a23-9536-43cd-94e9-b8166be8ed32",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
983,
|
||||
896
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4-1106-preview",
|
||||
"options": {
|
||||
"timeout": 300000,
|
||||
"temperature": 0.7,
|
||||
"frequencyPenalty": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "wPFAzp4ZHdLLwvkK",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "63d98361-8978-4042-84e7-53a0e226f946",
|
||||
"name": "HTTP Request",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"onError": "continueRegularOutput",
|
||||
"position": [
|
||||
1360,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ encodeURI($json.query.url) }}",
|
||||
"options": {
|
||||
"response": {
|
||||
"response": {
|
||||
"neverError": true
|
||||
}
|
||||
},
|
||||
"allowUnauthorizedCerts": true
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "17d4b5ae-f5d3-4793-8419-d3c879f7f50d",
|
||||
"name": "Exctract HTML Body",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ $json?.data.match(/<body[^>]*>([\\s\\S]*?)<\\/body>/i)[1] }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {},
|
||||
"includeFields": "HTML"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "36c38ee4-724c-4ba2-a59a-ac0bbc912e94",
|
||||
"name": "Is error?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1560,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"boolean": [
|
||||
{
|
||||
"value1": "={{ $json.hasOwnProperty('error') }}",
|
||||
"value2": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4e4d97ce-14a9-4f4f-aa75-f218784d9ed9",
|
||||
"name": "Stringify error message",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "page_content",
|
||||
"stringValue": "={{ $('QUERY_PARAMS').first()?.json?.query?.url == null ? \"INVALID action_input. This should be an HTTP query string like this: \\\"?url=VALIDURL&method=SELECTEDMETHOD\\\". Only a simple string value is accepted. JSON object as an action_input is NOT supported!\" : JSON.stringify($json.error) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {},
|
||||
"includeFields": "HTML"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "8452e5c4-aa29-4a02-9579-8d9da3727bcb",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
760,
|
||||
1200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "063220c2-fa4d-4d5e-9549-7712aaa72921",
|
||||
"name": "Remove extra tags",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1980,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ ($json.HTML || \"HTML BODY CONTENT FOR THIS SEARCH RESULT IS NOT AVAILABLE\").replace(/<script[^>]*>([\\s\\S]*?)<\\/script>|<style[^>]*>([\\s\\S]*?)<\\/style>|<noscript[^>]*>([\\s\\S]*?)<\\/noscript>|<!--[\\s\\S]*?-->|<iframe[^>]*>([\\s\\S]*?)<\\/iframe>|<object[^>]*>([\\s\\S]*?)<\\/object>|<embed[^>]*>([\\s\\S]*?)<\\/embed>|<video[^>]*>([\\s\\S]*?)<\\/video>|<audio[^>]*>([\\s\\S]*?)<\\/audio>|<svg[^>]*>([\\s\\S]*?)<\\/svg>/ig, '')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "036511d7-a4be-4bbf-b4bc-47ddfabfe76f",
|
||||
"name": "Simplify output",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"notes": "remove links and image URLs",
|
||||
"position": [
|
||||
2360,
|
||||
1380
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "HTML",
|
||||
"stringValue": "={{ $json.HTML.replace(/href\\s*=\\s*\"(.+?)\"/gi, 'href=\"NOURL\"').replace(/src\\s*=\\s*\"(.+?)\"/gi, 'src=\"NOIMG\"')}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "5e2b5383-adcf-4de0-a406-4f5d631b5e8a",
|
||||
"name": "Simplify?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
2180,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{ $('CONFIG').first()?.json?.query?.method }}",
|
||||
"value2": "simplif",
|
||||
"operation": "contains"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a0fc004a-ab0f-4b31-94df-50f5eee69c86",
|
||||
"name": "QUERY_PARAMS",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
960,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "query",
|
||||
"type": "objectValue",
|
||||
"objectValue": "={{ $json.query.substring($json.query.indexOf('?') + 1).split('&').reduce((result, item) => (result[item.split('=')[0]] = decodeURIComponent(item.split('=')[1]), result), {}) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "3b6599d6-ce9a-4861-9b52-07156eb52539",
|
||||
"name": "CONFIG",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1160,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "query.maxlimit",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json?.query?.maxlimit == null ? 70000 : Number($json?.query?.maxlimit) }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "14f683be-76f6-4034-9a0e-d785738b135f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
721,
|
||||
1134
|
||||
],
|
||||
"parameters": {
|
||||
"width": 556.25,
|
||||
"height": 235.79999999999995,
|
||||
"content": "### Convert the query string into JSON, apply the limit for a page length"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6deabcb7-a984-48ec-af2a-8c70b3a4e4bf",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"width": 491,
|
||||
"height": 285.7,
|
||||
"content": "## Send an error message:\n1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.\n2. If the query is OK and an error was during the HTTP Request, then send back the original error message."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df1e8d00-0e18-44fa-8f94-8a53c27f7c88",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1720,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1200,
|
||||
"height": 472.5,
|
||||
"content": "## Post-processing of the HTML page:\n1. Keep only <BODY> content\n2. Remove inline <SCRIPT> tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.\n3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length\n4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.\n5. Finally, check the page length. If it's too long, send an \"ERROR: PAGE CONTENT TOO LONG\" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6afe96a0-0fba-4ae1-ab8f-f7da56d420b1",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
720,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"width": 616.8597285067872,
|
||||
"height": 483.0226244343891,
|
||||
"content": "## Example ReAct AI Agent\n1. Agent Prompt is default\n2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d5ff2114-1e74-43cf-9f3c-744c241988db",
|
||||
"name": "ReAct AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
983,
|
||||
676
|
||||
],
|
||||
"parameters": {
|
||||
"agent": "reActAgent",
|
||||
"options": {
|
||||
"prefix": "Answer the following questions as best you can. You have access to the following tools:",
|
||||
"suffix": "Begin!\n\n\tQuestion: {input}\n\tThought:{agent_scratchpad}",
|
||||
"suffixChat": "Begin! Reminder to always use the exact characters `Final Answer` when responding.",
|
||||
"humanMessageTemplate": "{input}\n\n{agent_scratchpad}"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cc7aef4a-a1fb-4a69-a670-1f200f9e9541",
|
||||
"name": "Convert to Markdown",
|
||||
"type": "n8n-nodes-base.markdown",
|
||||
"position": [
|
||||
2540,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.HTML }}",
|
||||
"options": {},
|
||||
"destinationKey": "page_content"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "11806e8c-5fc4-4d9d-8144-179356993aa7",
|
||||
"name": "Send Page Content",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2740,
|
||||
1480
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "page_content",
|
||||
"stringValue": "={{ $json.page_content.length < $('CONFIG').first()?.json?.query?.maxlimit ? $json.page_content : \"ERROR: PAGE CONTENT TOO LONG\" }}"
|
||||
},
|
||||
{
|
||||
"name": "page_length",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json.page_content.length }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "selected",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "a3a6b199-517b-4987-8281-d7997a32f54b",
|
||||
"name": "HTTP_Request_Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1103,
|
||||
896
|
||||
],
|
||||
"parameters": {
|
||||
"name": "HTTP_Request_Tool",
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Call this tool to fetch a webpage content. The input should be a stringified HTTP query parameter like this: \"?url=VALIDURL&method=SELECTEDMETHOD\". \"url\" parameter should contain the valid URL string. \"method\" key can be either \"full\" or \"simplified\". method=full will fetch the whole webpage content in the Markdown format, including page links and image links. method=simplified will return the Markdown content of the page but remove urls and image links from the page content for simplicity. Before calling this tool, think strategically which \"method\" to call. Best of all to use method=simplified. However, if you anticipate that the page request is not final or if you need to extract links from the page, pick method=full.",
|
||||
"responsePropertyName": "page_content"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "9db853c5-3658-47c1-b98a-5858b1c184ec",
|
||||
"connections": {
|
||||
"CONFIG": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HTTP Request",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Is error?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Stringify error message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Exctract HTML Body",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Convert to Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HTTP Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Is error?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"QUERY_PARAMS": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "CONFIG",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Simplify output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Convert to Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"HTTP_Request_Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Remove extra tags": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Simplify?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Exctract HTML Body": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Remove extra tags",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Convert to Markdown": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Page Content",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "QUERY_PARAMS",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ReAct AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,277 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "4c52efcf-039b-4550-8a63-3d3d4dde488b",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
740,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "adb528f1-b87b-4bb2-99e1-776fd839522e",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
680,
|
||||
940
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "092cf737-5b53-4fc8-82f5-c775b77ea0bd",
|
||||
"name": "Hacker News",
|
||||
"type": "n8n-nodes-base.hackerNews",
|
||||
"position": [
|
||||
900,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 50,
|
||||
"resource": "all",
|
||||
"additionalFields": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a0805137-630c-4065-826e-88afa000660f",
|
||||
"name": "Clean up data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1120,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "title",
|
||||
"stringValue": "={{ $json._highlightResult.title.value }}"
|
||||
},
|
||||
{
|
||||
"name": "points",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json.points }}"
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"stringValue": "={{ $json.url }}"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"stringValue": "={{ $json.created_at }}"
|
||||
},
|
||||
{
|
||||
"name": "author",
|
||||
"stringValue": "={{ $json.author }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "none",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "e1b255f4-e970-42d6-9870-4e302bf2da83",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
960,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"maxIterations": 10
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "91e3391e-909e-4d63-9649-ff62781dbba9",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
960,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VQtv7frm7eLiEDnd",
|
||||
"name": "OpenAi account 7"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd1f0028-635e-48eb-ac38-4c6fb25ed63e",
|
||||
"name": "Stringify",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1340,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return {\n 'response': JSON.stringify($input.all().map(x => x.json))\n}"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "7df241eb-67d3-4724-8b32-4b53561ed55f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 150,
|
||||
"height": 293,
|
||||
"content": "### Replace me\nwith any other service, e.g. fetching your own data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "270845df-7c2d-4035-9ac0-e41d418b3026",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
738.125
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 406.875,
|
||||
"content": "### Sub-workflow: Custom tool\nThis can be called by the agent above. This example fetches the top 50 posts ever on Hacker News"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d796a86-45d1-4fc4-8245-893525505d1f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool\nTry it out by clicking 'Chat' and entering 'What is the 5th most popular post ever on Hacker News?'"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "38ff64b5-6f47-4d2d-9051-caab418bb0e8",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
440,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 185.9375,
|
||||
"height": 218,
|
||||
"content": "## Try me out\n\nClick the 'Chat' button and enter:\n\n_What is the 5th most popular post ever on Hacker News?_"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3532e461-bd74-48f7-93e1-96d608c88688",
|
||||
"name": "Custom tool to call the wf below",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"name": "hn_tool",
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Returns a list of the most popular posts ever on Hacker News, in json format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Hacker News": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Clean up data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Clean up data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Stringify",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Hacker News",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Custom tool to call the wf below": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "4c52efcf-039b-4550-8a63-3d3d4dde488b",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
740,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "adb528f1-b87b-4bb2-99e1-776fd839522e",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
680,
|
||||
940
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "092cf737-5b53-4fc8-82f5-c775b77ea0bd",
|
||||
"name": "Hacker News",
|
||||
"type": "n8n-nodes-base.hackerNews",
|
||||
"position": [
|
||||
900,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"limit": 50,
|
||||
"resource": "all",
|
||||
"additionalFields": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a0805137-630c-4065-826e-88afa000660f",
|
||||
"name": "Clean up data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1120,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "title",
|
||||
"stringValue": "={{ $json._highlightResult.title.value }}"
|
||||
},
|
||||
{
|
||||
"name": "points",
|
||||
"type": "numberValue",
|
||||
"numberValue": "={{ $json.points }}"
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"stringValue": "={{ $json.url }}"
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"stringValue": "={{ $json.created_at }}"
|
||||
},
|
||||
{
|
||||
"name": "author",
|
||||
"stringValue": "={{ $json.author }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"include": "none",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "e1b255f4-e970-42d6-9870-4e302bf2da83",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
960,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"maxIterations": 10
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "91e3391e-909e-4d63-9649-ff62781dbba9",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
960,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VQtv7frm7eLiEDnd",
|
||||
"name": "OpenAi account 7"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cd1f0028-635e-48eb-ac38-4c6fb25ed63e",
|
||||
"name": "Stringify",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1340,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return {\n 'response': JSON.stringify($input.all().map(x => x.json))\n}"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "7df241eb-67d3-4724-8b32-4b53561ed55f",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 150,
|
||||
"height": 293,
|
||||
"content": "### Replace me\nwith any other service, e.g. fetching your own data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "270845df-7c2d-4035-9ac0-e41d418b3026",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
738.125
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 406.875,
|
||||
"content": "### Sub-workflow: Custom tool\nThis can be called by the agent above. This example fetches the top 50 posts ever on Hacker News"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d796a86-45d1-4fc4-8245-893525505d1f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool\nTry it out by clicking 'Chat' and entering 'What is the 5th most popular post ever on Hacker News?'"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "38ff64b5-6f47-4d2d-9051-caab418bb0e8",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
440,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"width": 185.9375,
|
||||
"height": 218,
|
||||
"content": "## Try me out\n\nClick the 'Chat' button and enter:\n\n_What is the 5th most popular post ever on Hacker News?_"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3532e461-bd74-48f7-93e1-96d608c88688",
|
||||
"name": "Custom tool to call the wf below",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"name": "hn_tool",
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Returns a list of the most popular posts ever on Hacker News, in json format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Hacker News": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Clean up data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Clean up data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Stringify",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Hacker News",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Custom tool to call the wf below": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "3a3bcb2d-cb94-40d8-8b9e-322ea9d27f6e",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1000,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 185,
|
||||
"content": "### The conversation history(last 20 messages) is stored in a buffer memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e279af43-b003-4499-b221-58716e735379",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
740,
|
||||
340
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4f8bf03-a43e-4a1f-a592-cd0f8408f552",
|
||||
"name": "Chat OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
840,
|
||||
653
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "66b60f68-bae8-4958-ac81-03883f563ab3",
|
||||
"name": "Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
|
||||
"position": [
|
||||
1480,
|
||||
693
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "70f6b43b-9290-4fbc-992f-0895d4578c9f",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1340,
|
||||
633
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 185,
|
||||
"content": "### Tools which agent can use to accomplish the task"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8696269f-6556-41f1-bbe4-5597e4e46e02",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"width": 422,
|
||||
"height": 211,
|
||||
"content": "### Conversational agent will utilise available tools to answer the prompt. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6814967b-4567-4cdd-bf09-6b1b5ed0c68e",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
1100,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ce4358ac-c2cc-45ba-b950-247f8360b36c",
|
||||
"name": "SerpAPI",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
1380,
|
||||
693
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "de80add8-c37d-4d46-80ec-b43234e21150",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1040,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.input }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"SerpAPI": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
195
OpenAI_and_LLMs/AI chatbot that can search the web.txt
Normal file
195
OpenAI_and_LLMs/AI chatbot that can search the web.txt
Normal file
@@ -0,0 +1,195 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "3a3bcb2d-cb94-40d8-8b9e-322ea9d27f6e",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1000,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 185,
|
||||
"content": "### The conversation history(last 20 messages) is stored in a buffer memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e279af43-b003-4499-b221-58716e735379",
|
||||
"name": "On new manual Chat Message",
|
||||
"type": "@n8n/n8n-nodes-langchain.manualChatTrigger",
|
||||
"position": [
|
||||
740,
|
||||
340
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4f8bf03-a43e-4a1f-a592-cd0f8408f552",
|
||||
"name": "Chat OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
840,
|
||||
653
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "66b60f68-bae8-4958-ac81-03883f563ab3",
|
||||
"name": "Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWikipedia",
|
||||
"position": [
|
||||
1480,
|
||||
693
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "70f6b43b-9290-4fbc-992f-0895d4578c9f",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1340,
|
||||
633
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300,
|
||||
"height": 185,
|
||||
"content": "### Tools which agent can use to accomplish the task"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8696269f-6556-41f1-bbe4-5597e4e46e02",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"width": 422,
|
||||
"height": 211,
|
||||
"content": "### Conversational agent will utilise available tools to answer the prompt. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6814967b-4567-4cdd-bf09-6b1b5ed0c68e",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
1100,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ce4358ac-c2cc-45ba-b950-247f8360b36c",
|
||||
"name": "SerpAPI",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
1380,
|
||||
693
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "de80add8-c37d-4d46-80ec-b43234e21150",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
1040,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.input }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"SerpAPI": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new manual Chat Message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,747 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757",
|
||||
"templateId": "2324",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "71b06728-7f59-49e3-9365-3281189a6659",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
920,
|
||||
340
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b37019e3-c7ab-4119-986d-c27d082a036e",
|
||||
"name": "Input",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1340,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "fcc97354-b9f6-4459-a004-46e87902c77c",
|
||||
"name": "company_input",
|
||||
"type": "string",
|
||||
"value": "={{ $json.input }}"
|
||||
},
|
||||
{
|
||||
"id": "e5415c49-5204-45b1-a0e9-814157127b12",
|
||||
"name": "row_number",
|
||||
"type": "number",
|
||||
"value": "={{ $json.row_number }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "7d5d53ac-6d3c-4b24-97c7-deb6b76749e5",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
2020,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FMTQypGcsAwaRQdC",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "24e2f3b0-8b90-49a9-bde6-0fb0c2baf52a",
|
||||
"name": "Get website content",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2580,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"name": "get_website_content",
|
||||
"source": "parameter",
|
||||
"description": "This tool will return the text from the given URL. ",
|
||||
"workflowJson": "{\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757\"\n },\n \"nodes\": [\n {\n \"parameters\": {},\n \"id\": \"475eaf3c-7e11-457e-8b72-4d3e683e2f80\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1,\n \"position\": [\n 260,\n 340\n ]\n },\n {\n \"parameters\": {\n \"url\": \"={{ $json.query.url }}\",\n \"options\": {}\n },\n \"id\": \"321fbc74-d749-4f9b-954e-7cad37601ddf\",\n \"name\": \"Visit Website\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"typeVersion\": 4.2,\n \"position\": [\n 440,\n 340\n ]\n },\n {\n \"parameters\": {\n \"operation\": \"extractHtmlContent\",\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"body\",\n \"cssSelector\": \"html\",\n \"skipSelectors\": \"head\"\n }\n ]\n },\n \"options\": {\n \"cleanUpText\": true\n }\n },\n \"id\": \"6e51732a-4999-4805-838b-f692e9965197\",\n \"name\": \"HTML\",\n \"type\": \"n8n-nodes-base.html\",\n \"typeVersion\": 1.2,\n \"position\": [\n 620,\n 340\n ]\n }\n ],\n \"connections\": {\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Visit Website\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Visit Website\": {\n \"main\": [\n [\n {\n \"node\": \"HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"Execute Workflow Trigger\": [\n {\n \"query\": {\n \"url\": \"https://www.lemlist.com\"\n }\n }\n ]\n }\n}",
|
||||
"jsonSchemaExample": "{\n\t\"url\": \"https://www.lemlist.com\"\n}",
|
||||
"specifyInputSchema": true,
|
||||
"responsePropertyName": "body"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "ff7ab74c-dfc6-43ce-8c57-6edf935b4915",
|
||||
"name": "SerpAPI - Search Google",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
2300,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"serpApi": {
|
||||
"id": "ECK6FimAloRJOZMG",
|
||||
"name": "SerpAPI account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4fe311f2-4983-4380-b4ed-a827a406fce5",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
2880,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"case_study_link\": {\n\t\t\t\"type\":[\"string\", \"null\"]\n\t\t},\n \t\t\"domain\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n \"linkedinUrl\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n \t\"market\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n\t\t\"cheapest_plan\": {\n\t\t\t\"type\": [\"number\", \"null\"]\n\t\t},\n\t\"has_enterprise_plan\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"has_API\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"has_free_trial\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"integrations\": {\n\t\t\t\"type\": [\"array\",\"null\"],\n \"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "89ed0723-4dbe-428d-b1a9-ebdf515e42bb",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
1600,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "34ea3862-e8e5-4bf2-a9aa-2ad084376bb5",
|
||||
"name": "AI Researcher Output Data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2960,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4109ca11-1bb8-4f5c-8bec-a962f44b0746",
|
||||
"name": "domain",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.domain }}"
|
||||
},
|
||||
{
|
||||
"id": "7f492768-375e-48fa-866b-644b2b5cbd68",
|
||||
"name": "linkedinUrl",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.linkedinUrl }}"
|
||||
},
|
||||
{
|
||||
"id": "e30b0d07-68db-45a1-9593-fd6ce24a1d50",
|
||||
"name": "market",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.market }}"
|
||||
},
|
||||
{
|
||||
"id": "0c03a51e-2c07-4583-85c6-d3d2ee81c5d1",
|
||||
"name": "cheapest_plan",
|
||||
"type": "number",
|
||||
"value": "={{ $json.output.cheapest_plan }}"
|
||||
},
|
||||
{
|
||||
"id": "0c9622d0-8446-4663-9a94-964b5df851f1",
|
||||
"name": "has_enterprise_plan",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_enterprise_plan }}"
|
||||
},
|
||||
{
|
||||
"id": "564cf6ea-457f-4762-bc19-6900b7d5743c",
|
||||
"name": "has_API",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_API }}"
|
||||
},
|
||||
{
|
||||
"id": "7fd39897-65c3-45d6-9563-8254f55ecef0",
|
||||
"name": "has_free_trial",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_free_trial }}"
|
||||
},
|
||||
{
|
||||
"id": "26477939-d407-4cae-92b2-9a9dc0f53a64",
|
||||
"name": "integrations",
|
||||
"type": "array",
|
||||
"value": "={{ $json.output.integrations }}"
|
||||
},
|
||||
{
|
||||
"id": "f0cc61d1-6b6b-4142-8627-4a4c721b19a1",
|
||||
"name": "case_study_link",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.case_study_link }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "ff1cb26d-6138-4ee1-9f28-4ecc80c1c8ae",
|
||||
"name": "Google Sheets - Update Row with data",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
3600,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"domain": "={{ $json.domain }}",
|
||||
"market": "={{ $json.market }}",
|
||||
"row_number": "={{ $json.row_number }}",
|
||||
"linkedinUrl": "={{ $json.linkedinUrl }}",
|
||||
"integrations": "={{ $json.integrations }}",
|
||||
"cheapest_plan": "={{ $json.cheapest_plan }}",
|
||||
"has_free_trial": "={{ $json.has_free_trial }}",
|
||||
"enrichment_status": "done",
|
||||
"has_entreprise_plan": "={{ $json.has_enterprise_plan }}",
|
||||
"last_case_study_link": "={{ $json.case_study_link }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "input",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"required": false,
|
||||
"displayName": "input",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "domain",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "domain",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "linkedinUrl",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "linkedinUrl",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "has_free_trial",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "has_free_trial",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "cheapest_plan",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "cheapest_plan",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "has_entreprise_plan",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "has_entreprise_plan",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "last_case_study_link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "last_case_study_link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "market",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "market",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "integrations",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "integrations",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "enrichment_status",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "enrichment_status",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "row_number",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": true,
|
||||
"required": false,
|
||||
"displayName": "row_number",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [
|
||||
"row_number"
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"operation": "update",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Enrich companies using AI agents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GC2OQl3Jvy543LT2",
|
||||
"name": "Google Sheets account - perso"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.3
|
||||
},
|
||||
{
|
||||
"id": "6611f852-b4d6-4a07-9428-db206ef57cc3",
|
||||
"name": "Merge data",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
3240,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "mergeByPosition"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "2a19516b-33a1-4987-9b5f-242a084621e0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"width": 409.0131656322444,
|
||||
"height": 658.0614601225933,
|
||||
"content": "## Read Me\n\nThis workflow allows you to do account research with the web using AI.\n\nThe advanced AI module has 2 capabilities: \n- Research Google using SerpAPI\n- Visit and get website content using a sub-workflow\n\n\nFrom an unstructured input like a domain or a company name. \n\nIt will return the following properties: \n- domain\n- company Linkedin Url\n- cheapest plan\n- has free trial\n- has entreprise plan\n- has API\n- market (B2B or B2C)\n\n\nThe strength of n8n here is that you can adapt this workflow to research whatever information you need.\n\nYou just have to precise it in the prompt and to precise the output format in the \"Strutured Output Parser\" module.\n\n[Click here to find more detailed instructions with video guide.](https://lempire.notion.site/AI-Web-research-with-n8n-a25aae3258d0423481a08bd102f16906)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "67d485c9-3289-4bb3-9523-cd24c0b1aa05",
|
||||
"name": "Get rows to enrich",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1140,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"returnAllMatches": "returnAllMatches"
|
||||
},
|
||||
"filtersUI": {
|
||||
"values": [
|
||||
{
|
||||
"lookupColumn": "enrichment_status"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Enrich companies using AI agents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GC2OQl3Jvy543LT2",
|
||||
"name": "Google Sheets account - perso"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.3
|
||||
},
|
||||
{
|
||||
"id": "eb0c95e7-2211-48d1-abaf-07cd0c76d3a6",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1540,
|
||||
227.25301102878547
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 333.8263184006576,
|
||||
"content": "### Process rows 1 by 1\nThis module will allow us to process rows 1 by 1"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8bf0deae-dda7-4e27-9ac7-978db14cca19",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2740,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 236.01118609685022,
|
||||
"content": "Precise here the format in which you need the data to be "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dc4f1550-1e3c-4175-a2b3-10153dc2fd77",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2180,
|
||||
200.2582716310755
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 279.8787004666023,
|
||||
"content": "### Ask AI what are the information you are looking for about the company"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "70fc73a0-303b-46e1-822d-cebdbccf8e32",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2220,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"height": 248.91749449109562,
|
||||
"content": "Get your free API key here https://serpapi.com/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0c1dafa9-28fe-4ef4-b80e-d4034e16f6c0",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
920,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"field": "hours",
|
||||
"hoursInterval": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "8b5ebee9-f519-4621-bf2a-12891794f2c5",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"width": 266.12865147126786,
|
||||
"height": 627.5654650079845,
|
||||
"content": "Run the workflow manually or activate it to run it every 2 hours"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d7db2452-ba3d-4adb-bd8b-d17a92d1bce5",
|
||||
"name": "AI company researcher",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
2200,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=This is the company I want you to research info about:\n{{ $json.company_input }}\n\nReturn me:\n- the linkedin URL of the company\n- the domain of the company. in this format ([domain].[tld])\n- market: if they are B2B or B2C. Only reply by \"B2B\" or \"B2B\"\n- the lowest paid plan the company is offering. If you are not sure, reply null.\n- the latest case study URL published on the website (find case study hub using google, and return the first case study link)\n- tell me if the company offer an API\n- tell me if the company has an enterprise plan\n- tell me if the company has a free trial mentionned in their homepage. reply false if you don't find strong evidence.\n- return an array with up to 5 tools the company is integrated with",
|
||||
"options": {
|
||||
"maxIterations": 10
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "f7896dbd-5c15-44e9-96ca-c695a66562cc",
|
||||
"name": "Search Google with ScrapingBee",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2300,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"name": "search_google",
|
||||
"source": "parameter",
|
||||
"description": "Call this tool to get results from a google search.",
|
||||
"workflowJson": "{\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757\"\n },\n \"nodes\": [\n {\n \"parameters\": {},\n \"id\": \"fbb17d8d-e2dc-46ae-aba4-8c27cc9d8766\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1,\n \"position\": [\n 20,\n 460\n ]\n },\n {\n \"parameters\": {\n \"url\": \"https://app.scrapingbee.com/api/v1/store/google\",\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpQueryAuth\",\n \"sendQuery\": true,\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"search\",\n \"value\": \"={{ $json.query.google_search_query }}\"\n },\n {\n \"name\": \"language\",\n \"value\": \"en\"\n },\n {\n \"name\": \"nb_results\",\n \"value\": \"5\"\n }\n ]\n },\n \"options\": {}\n },\n \"id\": \"b938a2bd-030e-46d7-adee-4e3c85cfc1b3\",\n \"name\": \"Search Google\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"typeVersion\": 4.2,\n \"position\": [\n 300,\n 460\n ],\n \"credentials\": {\n \"httpQueryAuth\": {\n \"id\": \"Pb2CIMT0tN838QPy\",\n \"name\": \"ScrapingBee\"\n }\n }\n },\n {\n \"parameters\": {\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"096fee70-444e-4948-816c-752b20786062\",\n \"name\": \"response\",\n \"value\": \"={{ $json.organic_results }}\",\n \"type\": \"array\"\n }\n ]\n },\n \"options\": {}\n },\n \"id\": \"c5db1fb6-d875-47d2-97db-287777583f22\",\n \"name\": \"Response\",\n \"type\": \"n8n-nodes-base.set\",\n \"typeVersion\": 3.3,\n \"position\": [\n 520,\n 460\n ]\n }\n ],\n \"connections\": {\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Search Google\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search Google\": {\n \"main\": [\n [\n {\n \"node\": \"Response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"Execute Workflow Trigger\": [\n {\n \"query\": {\n \"google_search_query\": \"site:lemlist.com pricing\"\n }\n }\n ]\n }\n}",
|
||||
"jsonSchemaExample": "{\n\t\"google_search_query\": \"site:lemlist.com pricing\"\n}",
|
||||
"specifyInputSchema": true
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "7a89c803-8145-49c2-aafe-ec2aff0b2fbc",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2220,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"height": 340.14969579315925,
|
||||
"content": "Instead of SERP API module, you can also use this custom module for ScrapingBee. It is more cost-efficient.\n\nGet your free API key here https://www.scrapingbee.com/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "79eff129-790b-46da-bef3-899eb6db3ced",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1100,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"width": 194.6864335083109,
|
||||
"height": 525.6560478822986,
|
||||
"content": "In this workflow, I use Google Sheets to store the results. \n\nYou can use my template to get started faster:\n\n1. [Click on this link to get the template](https://docs.google.com/spreadsheets/d/1vR6s2nlTwu01v3GP7wvSRWS5W49FJIh20ZF7AUkmMDo/edit?usp=sharing)\n2. Make a copy of the Sheets\n3. Add the URL to this node and the node **\"Google Sheets - Update Row with data\"**\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Input": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets - Update Row with data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
null,
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get rows to enrich",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get rows to enrich": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Input",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get website content": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI company researcher": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Researcher Output Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"SerpAPI - Search Google": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Researcher Output Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get rows to enrich",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets - Update Row with data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
747
OpenAI_and_LLMs/AI web researcher for sales.txt
Normal file
747
OpenAI_and_LLMs/AI web researcher for sales.txt
Normal file
@@ -0,0 +1,747 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757",
|
||||
"templateId": "2324",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "71b06728-7f59-49e3-9365-3281189a6659",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
920,
|
||||
340
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b37019e3-c7ab-4119-986d-c27d082a036e",
|
||||
"name": "Input",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1340,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "fcc97354-b9f6-4459-a004-46e87902c77c",
|
||||
"name": "company_input",
|
||||
"type": "string",
|
||||
"value": "={{ $json.input }}"
|
||||
},
|
||||
{
|
||||
"id": "e5415c49-5204-45b1-a0e9-814157127b12",
|
||||
"name": "row_number",
|
||||
"type": "number",
|
||||
"value": "={{ $json.row_number }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "7d5d53ac-6d3c-4b24-97c7-deb6b76749e5",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
2020,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FMTQypGcsAwaRQdC",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "24e2f3b0-8b90-49a9-bde6-0fb0c2baf52a",
|
||||
"name": "Get website content",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2580,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"name": "get_website_content",
|
||||
"source": "parameter",
|
||||
"description": "This tool will return the text from the given URL. ",
|
||||
"workflowJson": "{\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757\"\n },\n \"nodes\": [\n {\n \"parameters\": {},\n \"id\": \"475eaf3c-7e11-457e-8b72-4d3e683e2f80\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1,\n \"position\": [\n 260,\n 340\n ]\n },\n {\n \"parameters\": {\n \"url\": \"={{ $json.query.url }}\",\n \"options\": {}\n },\n \"id\": \"321fbc74-d749-4f9b-954e-7cad37601ddf\",\n \"name\": \"Visit Website\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"typeVersion\": 4.2,\n \"position\": [\n 440,\n 340\n ]\n },\n {\n \"parameters\": {\n \"operation\": \"extractHtmlContent\",\n \"extractionValues\": {\n \"values\": [\n {\n \"key\": \"body\",\n \"cssSelector\": \"html\",\n \"skipSelectors\": \"head\"\n }\n ]\n },\n \"options\": {\n \"cleanUpText\": true\n }\n },\n \"id\": \"6e51732a-4999-4805-838b-f692e9965197\",\n \"name\": \"HTML\",\n \"type\": \"n8n-nodes-base.html\",\n \"typeVersion\": 1.2,\n \"position\": [\n 620,\n 340\n ]\n }\n ],\n \"connections\": {\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Visit Website\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Visit Website\": {\n \"main\": [\n [\n {\n \"node\": \"HTML\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"Execute Workflow Trigger\": [\n {\n \"query\": {\n \"url\": \"https://www.lemlist.com\"\n }\n }\n ]\n }\n}",
|
||||
"jsonSchemaExample": "{\n\t\"url\": \"https://www.lemlist.com\"\n}",
|
||||
"specifyInputSchema": true,
|
||||
"responsePropertyName": "body"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "ff7ab74c-dfc6-43ce-8c57-6edf935b4915",
|
||||
"name": "SerpAPI - Search Google",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolSerpApi",
|
||||
"position": [
|
||||
2300,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"serpApi": {
|
||||
"id": "ECK6FimAloRJOZMG",
|
||||
"name": "SerpAPI account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4fe311f2-4983-4380-b4ed-a827a406fce5",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
2880,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"case_study_link\": {\n\t\t\t\"type\":[\"string\", \"null\"]\n\t\t},\n \t\t\"domain\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n \"linkedinUrl\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n \t\"market\": {\n\t\t\t\"type\": [\"string\", \"null\"]\n\t\t},\n\t\t\"cheapest_plan\": {\n\t\t\t\"type\": [\"number\", \"null\"]\n\t\t},\n\t\"has_enterprise_plan\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"has_API\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"has_free_trial\": {\n\t\t\t\"type\": [\"boolean\", \"null\"]\n\t\t},\n\t\"integrations\": {\n\t\t\t\"type\": [\"array\",\"null\"],\n \"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "89ed0723-4dbe-428d-b1a9-ebdf515e42bb",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
1600,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "34ea3862-e8e5-4bf2-a9aa-2ad084376bb5",
|
||||
"name": "AI Researcher Output Data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2960,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "4109ca11-1bb8-4f5c-8bec-a962f44b0746",
|
||||
"name": "domain",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.domain }}"
|
||||
},
|
||||
{
|
||||
"id": "7f492768-375e-48fa-866b-644b2b5cbd68",
|
||||
"name": "linkedinUrl",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.linkedinUrl }}"
|
||||
},
|
||||
{
|
||||
"id": "e30b0d07-68db-45a1-9593-fd6ce24a1d50",
|
||||
"name": "market",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.market }}"
|
||||
},
|
||||
{
|
||||
"id": "0c03a51e-2c07-4583-85c6-d3d2ee81c5d1",
|
||||
"name": "cheapest_plan",
|
||||
"type": "number",
|
||||
"value": "={{ $json.output.cheapest_plan }}"
|
||||
},
|
||||
{
|
||||
"id": "0c9622d0-8446-4663-9a94-964b5df851f1",
|
||||
"name": "has_enterprise_plan",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_enterprise_plan }}"
|
||||
},
|
||||
{
|
||||
"id": "564cf6ea-457f-4762-bc19-6900b7d5743c",
|
||||
"name": "has_API",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_API }}"
|
||||
},
|
||||
{
|
||||
"id": "7fd39897-65c3-45d6-9563-8254f55ecef0",
|
||||
"name": "has_free_trial",
|
||||
"type": "boolean",
|
||||
"value": "={{ $json.output.has_free_trial }}"
|
||||
},
|
||||
{
|
||||
"id": "26477939-d407-4cae-92b2-9a9dc0f53a64",
|
||||
"name": "integrations",
|
||||
"type": "array",
|
||||
"value": "={{ $json.output.integrations }}"
|
||||
},
|
||||
{
|
||||
"id": "f0cc61d1-6b6b-4142-8627-4a4c721b19a1",
|
||||
"name": "case_study_link",
|
||||
"type": "string",
|
||||
"value": "={{ $json.output.case_study_link }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "ff1cb26d-6138-4ee1-9f28-4ecc80c1c8ae",
|
||||
"name": "Google Sheets - Update Row with data",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
3600,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"domain": "={{ $json.domain }}",
|
||||
"market": "={{ $json.market }}",
|
||||
"row_number": "={{ $json.row_number }}",
|
||||
"linkedinUrl": "={{ $json.linkedinUrl }}",
|
||||
"integrations": "={{ $json.integrations }}",
|
||||
"cheapest_plan": "={{ $json.cheapest_plan }}",
|
||||
"has_free_trial": "={{ $json.has_free_trial }}",
|
||||
"enrichment_status": "done",
|
||||
"has_entreprise_plan": "={{ $json.has_enterprise_plan }}",
|
||||
"last_case_study_link": "={{ $json.case_study_link }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "input",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"required": false,
|
||||
"displayName": "input",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "domain",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "domain",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "linkedinUrl",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "linkedinUrl",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "has_free_trial",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "has_free_trial",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "cheapest_plan",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "cheapest_plan",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "has_entreprise_plan",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "has_entreprise_plan",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "last_case_study_link",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "last_case_study_link",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "market",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "market",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "integrations",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "integrations",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "enrichment_status",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "enrichment_status",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "row_number",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"readOnly": true,
|
||||
"required": false,
|
||||
"displayName": "row_number",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [
|
||||
"row_number"
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"operation": "update",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Enrich companies using AI agents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GC2OQl3Jvy543LT2",
|
||||
"name": "Google Sheets account - perso"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.3
|
||||
},
|
||||
{
|
||||
"id": "6611f852-b4d6-4a07-9428-db206ef57cc3",
|
||||
"name": "Merge data",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
3240,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combinationMode": "mergeByPosition"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "2a19516b-33a1-4987-9b5f-242a084621e0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"width": 409.0131656322444,
|
||||
"height": 658.0614601225933,
|
||||
"content": "## Read Me\n\nThis workflow allows you to do account research with the web using AI.\n\nThe advanced AI module has 2 capabilities: \n- Research Google using SerpAPI\n- Visit and get website content using a sub-workflow\n\n\nFrom an unstructured input like a domain or a company name. \n\nIt will return the following properties: \n- domain\n- company Linkedin Url\n- cheapest plan\n- has free trial\n- has entreprise plan\n- has API\n- market (B2B or B2C)\n\n\nThe strength of n8n here is that you can adapt this workflow to research whatever information you need.\n\nYou just have to precise it in the prompt and to precise the output format in the \"Strutured Output Parser\" module.\n\n[Click here to find more detailed instructions with video guide.](https://lempire.notion.site/AI-Web-research-with-n8n-a25aae3258d0423481a08bd102f16906)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "67d485c9-3289-4bb3-9523-cd24c0b1aa05",
|
||||
"name": "Get rows to enrich",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1140,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"returnAllMatches": "returnAllMatches"
|
||||
},
|
||||
"filtersUI": {
|
||||
"values": [
|
||||
{
|
||||
"lookupColumn": "enrichment_status"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/19U7gAgkUEz6mbFcnygf1zKDdGvY6OAdUqq3bZQWgjxE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Enrich companies using AI agents"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "GC2OQl3Jvy543LT2",
|
||||
"name": "Google Sheets account - perso"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.3
|
||||
},
|
||||
{
|
||||
"id": "eb0c95e7-2211-48d1-abaf-07cd0c76d3a6",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1540,
|
||||
227.25301102878547
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 333.8263184006576,
|
||||
"content": "### Process rows 1 by 1\nThis module will allow us to process rows 1 by 1"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8bf0deae-dda7-4e27-9ac7-978db14cca19",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2740,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 236.01118609685022,
|
||||
"content": "Precise here the format in which you need the data to be "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dc4f1550-1e3c-4175-a2b3-10153dc2fd77",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2180,
|
||||
200.2582716310755
|
||||
],
|
||||
"parameters": {
|
||||
"width": 300.49399096535876,
|
||||
"height": 279.8787004666023,
|
||||
"content": "### Ask AI what are the information you are looking for about the company"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "70fc73a0-303b-46e1-822d-cebdbccf8e32",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2220,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"height": 248.91749449109562,
|
||||
"content": "Get your free API key here https://serpapi.com/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0c1dafa9-28fe-4ef4-b80e-d4034e16f6c0",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
920,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"field": "hours",
|
||||
"hoursInterval": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "8b5ebee9-f519-4621-bf2a-12891794f2c5",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
820,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"width": 266.12865147126786,
|
||||
"height": 627.5654650079845,
|
||||
"content": "Run the workflow manually or activate it to run it every 2 hours"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d7db2452-ba3d-4adb-bd8b-d17a92d1bce5",
|
||||
"name": "AI company researcher",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
2200,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=This is the company I want you to research info about:\n{{ $json.company_input }}\n\nReturn me:\n- the linkedin URL of the company\n- the domain of the company. in this format ([domain].[tld])\n- market: if they are B2B or B2C. Only reply by \"B2B\" or \"B2B\"\n- the lowest paid plan the company is offering. If you are not sure, reply null.\n- the latest case study URL published on the website (find case study hub using google, and return the first case study link)\n- tell me if the company offer an API\n- tell me if the company has an enterprise plan\n- tell me if the company has a free trial mentionned in their homepage. reply false if you don't find strong evidence.\n- return an array with up to 5 tools the company is integrated with",
|
||||
"options": {
|
||||
"maxIterations": 10
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "f7896dbd-5c15-44e9-96ca-c695a66562cc",
|
||||
"name": "Search Google with ScrapingBee",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
2300,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"name": "search_google",
|
||||
"source": "parameter",
|
||||
"description": "Call this tool to get results from a google search.",
|
||||
"workflowJson": "{\n \"meta\": {\n \"templateCredsSetupCompleted\": true,\n \"instanceId\": \"2b1cc1a8b0a2fb9caab11ab2d5eb3712f9973066051b2e898cf4041a1f2a7757\"\n },\n \"nodes\": [\n {\n \"parameters\": {},\n \"id\": \"fbb17d8d-e2dc-46ae-aba4-8c27cc9d8766\",\n \"name\": \"Execute Workflow Trigger\",\n \"type\": \"n8n-nodes-base.executeWorkflowTrigger\",\n \"typeVersion\": 1,\n \"position\": [\n 20,\n 460\n ]\n },\n {\n \"parameters\": {\n \"url\": \"https://app.scrapingbee.com/api/v1/store/google\",\n \"authentication\": \"genericCredentialType\",\n \"genericAuthType\": \"httpQueryAuth\",\n \"sendQuery\": true,\n \"queryParameters\": {\n \"parameters\": [\n {\n \"name\": \"search\",\n \"value\": \"={{ $json.query.google_search_query }}\"\n },\n {\n \"name\": \"language\",\n \"value\": \"en\"\n },\n {\n \"name\": \"nb_results\",\n \"value\": \"5\"\n }\n ]\n },\n \"options\": {}\n },\n \"id\": \"b938a2bd-030e-46d7-adee-4e3c85cfc1b3\",\n \"name\": \"Search Google\",\n \"type\": \"n8n-nodes-base.httpRequest\",\n \"typeVersion\": 4.2,\n \"position\": [\n 300,\n 460\n ],\n \"credentials\": {\n \"httpQueryAuth\": {\n \"id\": \"Pb2CIMT0tN838QPy\",\n \"name\": \"ScrapingBee\"\n }\n }\n },\n {\n \"parameters\": {\n \"assignments\": {\n \"assignments\": [\n {\n \"id\": \"096fee70-444e-4948-816c-752b20786062\",\n \"name\": \"response\",\n \"value\": \"={{ $json.organic_results }}\",\n \"type\": \"array\"\n }\n ]\n },\n \"options\": {}\n },\n \"id\": \"c5db1fb6-d875-47d2-97db-287777583f22\",\n \"name\": \"Response\",\n \"type\": \"n8n-nodes-base.set\",\n \"typeVersion\": 3.3,\n \"position\": [\n 520,\n 460\n ]\n }\n ],\n \"connections\": {\n \"Execute Workflow Trigger\": {\n \"main\": [\n [\n {\n \"node\": \"Search Google\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n },\n \"Search Google\": {\n \"main\": [\n [\n {\n \"node\": \"Response\",\n \"type\": \"main\",\n \"index\": 0\n }\n ]\n ]\n }\n },\n \"pinData\": {\n \"Execute Workflow Trigger\": [\n {\n \"query\": {\n \"google_search_query\": \"site:lemlist.com pricing\"\n }\n }\n ]\n }\n}",
|
||||
"jsonSchemaExample": "{\n\t\"google_search_query\": \"site:lemlist.com pricing\"\n}",
|
||||
"specifyInputSchema": true
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "7a89c803-8145-49c2-aafe-ec2aff0b2fbc",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2220,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"height": 340.14969579315925,
|
||||
"content": "Instead of SERP API module, you can also use this custom module for ScrapingBee. It is more cost-efficient.\n\nGet your free API key here https://www.scrapingbee.com/"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "79eff129-790b-46da-bef3-899eb6db3ced",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1100,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"width": 194.6864335083109,
|
||||
"height": 525.6560478822986,
|
||||
"content": "In this workflow, I use Google Sheets to store the results. \n\nYou can use my template to get started faster:\n\n1. [Click on this link to get the template](https://docs.google.com/spreadsheets/d/1vR6s2nlTwu01v3GP7wvSRWS5W49FJIh20ZF7AUkmMDo/edit?usp=sharing)\n2. Make a copy of the Sheets\n3. Add the URL to this node and the node **\"Google Sheets - Update Row with data\"**\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Input": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets - Update Row with data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
null,
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get rows to enrich",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get rows to enrich": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Input",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get website content": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI company researcher": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Researcher Output Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"SerpAPI - Search Google": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI company researcher",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Researcher Output Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge data",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get rows to enrich",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets - Update Row with data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,733 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "e4f78845dfed9ddcfba1945ae00d12e9a7d76eab052afd19299228ce02349d86"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "23291d25-3e1a-4b0d-9b1d-d066e8c04a1f",
|
||||
"name": "Customer Lead AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-640,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=**System Prompt:**\n\nYou are an AI assistant designed to process new leads and generate appropriate responses. Your role includes analyzing lead notes, categorizing them, and generating an email from the system to inform the relevant contact about the inquiry. Do not send the email as if it is directly from the customer; instead, draft it as a notification from the system summarizing the inquiry.\n\n### **Process Flow**\n\n1. **Analyzing Lead Notes:**\n - Extract key details such as the customer name, organization, contact information, and their specific request. \n - Determine if the inquiry relates to products, services, or solutions offered by the company.\n\n2. **Finding the Appropriate Contact(s):**\n - Search the contact database to find the responsible person(s) for the relevant product, service, or solution. \n - If one person is responsible, provide their email. \n - If multiple people are responsible, list all emails separated by commas.\n\n3. **Generating an Email Notification:**\n - Draft a professional email as a notification from the system.\n - Summarize the customer’s inquiry.\n - Include all relevant details to assist the recipient in addressing the inquiry.\n\n4. **Handling Invalid Leads:**\n - If the inquiry is unrelated to products, services, or solutions (e.g., job inquiries or general product inquiries), classify it as invalid and return: \n `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n### **Output Requirements**\n\n1. **For Relevant Leads:**\n - **Email Address(es):** Provide the appropriate email(s). \n - **Email Message Body:** Generate an email notification from the system summarizing the inquiry.\n\n2. **For Invalid Leads:**\n - Return: `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n\n### **Email Template for Relevant Leads**\n\n**Email Address(es):** [Relevant Email IDs]\n\n**Email Message Body:**\n\n_Subject: New Inquiry from Customer Regarding [Product/Service/Solution]_ \n\nDear [Recipient(s)], \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** [Customer Name] \n**Organization:** [Organization Name] \n**Contact Information:** [Contact Details] \n\n**Inquiry Summary:** \n[Summarized description of the customer's request, e.g., “The customer is seeking to upgrade their restroom facilities with touchless soap dispensers and tissue holders installed behind mirrors. They have requested a site visit to assess the location and provide a proposal.”] \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \n[Your System Name] \n\n\n### **Example Output**\n\n**Input Lead Notes:**\n*\"Dear Syncbricks, We are looking to Develop Workflow Automation Soluition for our company, can you let us know the details what do you offer in tems of this.\"*\n\n**Output:**\n\n- **Email Address(es):** employee@syncbricks.com\n\n- **Email Message Body:** \n\n_Subject: Workflow Automation Platform Integration_ \n\nDear -Emploiyee Name (s) --, \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** Amjid Ali \n**Organization:** Syncbricks LLC\n**Contact Information:** 123456789 \n\n**Inquiry Summary:** \nThe customer is asking for workflow automation for their company \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \nSyncbricks LLC\n\n---\nHere are the Lead Details\nLead Name : {{ $json.data.lead_name }}\nCompany : {{ $json.data.company_name }}\nSource : {{ $json.data.source }}\nNotes : {{ $json.data.notes }}\nCity : {{ $json.data.city }}\nCountry : {{ $json.data.country }}\nMobile : {{ $json.data.mobile_no }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "1831dc36-910b-4a72-a90e-b411f105a8c3",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-800,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "hTl3a2XqteCwExYY",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "79713c56-2f7c-4872-90e4-331715f54048",
|
||||
"name": "Abbriviations",
|
||||
"type": "n8n-nodes-base.googleSheetsTool",
|
||||
"position": [
|
||||
-640,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit#gid=0",
|
||||
"cachedResultName": "abbrivaitions"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit?usp=drivesdk",
|
||||
"cachedResultName": "Abbriviations List"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "L3lApjbQfMm36LLX",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "73b1e3c9-4703-4f87-8399-e7a9bf368d4c",
|
||||
"name": "Lead Body",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-1640,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "82a674a2-4d12-45f2-b276-cc95cf7b2e93",
|
||||
"name": "body",
|
||||
"type": "object",
|
||||
"value": "={{ $json.body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "5f25d846-c639-49e5-bea2-160000bfb104",
|
||||
"name": "Source Website and Status Open",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-1920,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "2b184de2-a64e-44e3-8f25-645539681533",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.source }}",
|
||||
"rightValue": "Website"
|
||||
},
|
||||
{
|
||||
"id": "9632cf65-11a1-483c-95c8-94bfe84fb243",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.status }}",
|
||||
"rightValue": "Open"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "12ba65c9-0890-4862-9704-98492eb8f637",
|
||||
"name": "Microsoft Outlook",
|
||||
"type": "n8n-nodes-base.microsoftOutlook",
|
||||
"position": [
|
||||
1180,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"subject": "={{ $('Fields for Outlook').item.json.subject }}",
|
||||
"bodyContent": "={{ $json.html }}\n<a href=\"https://erpnext.syncbricks.com/app/lead/{{ $('Webhook').item.json.body.name }}\" target=\"_blank\" rel=\"noopener noreferrer\">Here is Lead {{ $('Source Website and Status Open').item.json.body.name }} </a>\n",
|
||||
"toRecipients": "= {{ $('Fields for Outlook').item.json.email_addresses }}",
|
||||
"additionalFields": {
|
||||
"bodyContentType": "html"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"microsoftOutlookOAuth2Api": {
|
||||
"id": "9gy3uvf3pmBdpEsq",
|
||||
"name": "Microsoft Outlook Al Ansari"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "b1410997-3705-4234-918e-a14e4ccc6b70",
|
||||
"name": "Email Body Text Generated by AI",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
700,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "cdce31fb-2ec9-45ce-a4ac-a6ff9c811dc3",
|
||||
"name": "email_body",
|
||||
"type": "string",
|
||||
"value": "={{ $json.email_body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "b10684b9-9f72-42b3-a9f9-c54e711ceb59",
|
||||
"name": "Fields for Outlook",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
360,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Input text from the `output` field\nconst textOutput = $json?.output || '';\n\n// Function to extract values from the text\nfunction extractFields(text) {\n const fields = {};\n\n // Regular expressions to extract each field\n const emailMatch = text.match(/\\*\\*Email Address\\(es\\):\\*\\*\\s*([^\\n]+)/);\n const subjectMatch = text.match(/_Subject:\\s*([^_]+)/);\n const emailBodyMatch = text.match(/Dear[\\s\\S]+/);\n\n // Assign extracted values to the fields\n fields.email_addresses = emailMatch ? emailMatch[1].trim() : null;\n fields.subject = subjectMatch ? subjectMatch[1].trim() : null;\n fields.email_body = emailBodyMatch ? emailBodyMatch[0].trim() : null;\n\n return fields;\n}\n\n// Extract fields from the output\nconst extractedFields = extractFields(textOutput);\n\n// Return the fields as JSON\nreturn {\n json: extractedFields\n};\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "e2c10569-fde2-425c-8b20-fdb32a6e2bd5",
|
||||
"name": "Email Body for Outlook",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
860,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Input email body\nconst emailBody = $json.email_body || '';\n\n// Function to convert plain text email body into HTML\nfunction formatEmailBodyAsHtml(body) {\n // Replace markdown-like sections with corresponding HTML\n let htmlBody = body\n .replace(/\\*\\*Customer Name:\\*\\* (.+)/, '<p><strong>Customer Name:</strong> $1</p>')\n .replace(/\\*\\*Organization:\\*\\* (.+)/, '<p><strong>Organization:</strong> $1</p>')\n .replace(/\\*\\*Contact Information:\\*\\* (.+)/, '<p><strong>Contact Information:</strong> $1</p>')\n .replace(/\\*\\*Inquiry Summary:\\*\\*\\s*([\\s\\S]+?)(?=\\n\\n\\*\\*Action Required:)/, '<p><strong>Inquiry Summary:</strong> $1</p>')\n .replace(/\\*\\*Action Required:\\*\\*\\s*([\\s\\S]+)/, '<p><strong>Action Required:</strong> $1</p>');\n\n // Wrap each paragraph in `<p>` tags for better readability\n htmlBody = htmlBody\n .replace(/Dear (.+?),/, '<p>Dear <strong>$1</strong>,</p>')\n .replace(/Thank you,\\s+(.+)/, '<p>Thank you,<br><strong>$1</strong></p>');\n\n return htmlBody;\n}\n\n// Convert the email body into HTML\nconst formattedHtmlBody = formatEmailBodyAsHtml(emailBody);\n\n// Return the formatted HTML\nreturn {\n html: formattedHtmlBody\n};\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "3297550b-ed78-4528-ad65-facdc879590a",
|
||||
"name": "Inquiry has Notes",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-1080,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bc81994a-2ad8-4af7-8c58-2c7e58a0fd2e",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.data.notes }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "e2544a27-8b6d-4bb0-84f1-00c3a5e66978",
|
||||
"name": "Inquiry is Valid?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
40,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ddd5e8a2-277f-4db6-b38d-28a7b91a2f66",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.output }}",
|
||||
"rightValue": "**Invalid Lead - Not related to products, services, or solutions.**"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "39cc73e7-ceb3-4e8e-a5bc-55648595f784",
|
||||
"name": "Company Profile",
|
||||
"type": "n8n-nodes-base.googleDocsTool",
|
||||
"position": [
|
||||
-540,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "get",
|
||||
"documentURL": "you-must-provide-the-doc-id"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "RdTuYvYpBqEKhIQ3",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "8ee24c59-1acb-4d76-a136-74e69d694a49",
|
||||
"name": "Company Policies",
|
||||
"type": "n8n-nodes-base.googleDocsTool",
|
||||
"position": [
|
||||
-420,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "get",
|
||||
"documentURL": "you-must-provide-the-doc-id"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "RdTuYvYpBqEKhIQ3",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "a5db3aa7-8a77-4553-9c13-a96c51f32745",
|
||||
"name": "Company Contact Database",
|
||||
"type": "n8n-nodes-base.googleSheetsTool",
|
||||
"position": [
|
||||
-300,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultUrl": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=Telephone Directory"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "L3lApjbQfMm36LLX",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "f3e73266-faa4-4e6d-8c60-92669d64233b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2000,
|
||||
257.53836663807056
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 297.84037615575886,
|
||||
"height": 643.0692298205195,
|
||||
"content": "### Filter the Lead\nI have done only for theose which are open and where the source is Website. You can remove this if you want to have all leads."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0056e35c-4901-406d-9a95-f6da26808841",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-60,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 302.58963031819115,
|
||||
"height": 660,
|
||||
"content": "### Output from AI Agent\nIf the INquiry is invalid, not related to the products and services offered, it will invalidate that you can optionnally link the invalid output to email or anything. Options are limitless"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5e0e9561-0fb8-4225-aa59-58e25abc8ca1",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-880,
|
||||
280.0000000000002
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 764.2159851725196,
|
||||
"height": 648.5051458745236,
|
||||
"content": "### Customer Experience Agent (AI)\nNow this Node is an AI Agent who is speicalized to understand the Lead Source and the Inquiry sent by Cusomter. The Agent will look at company information, which has detials of producuts and services defined in Google Docs, and the Contacts Sheet where a column must be added mentioning that who is the person dealing in which products, solutions and services. Once the inquiry is about speicifc product solution and service it will look from the sheet and then will decide to whom the email has to be sent. Details is defined in the Agent.\nMake sure to drag fields from http request node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5a3ca9c9-07c2-4c74-ba8c-6b14f487fc4d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2420,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 398,
|
||||
"height": 642,
|
||||
"content": "### Once the Lead is generatd in ERP\n\nConsider creating creating an inquiry web form in ERPNext and let the Website Visitor fill that Inquiry form, as soon as the iqnuiry form is filled this workflow will start.\n\nMake sure to create a webhook in ERPNext. Follow Below steps in ERPNext.\n\nGo to Wehbooks \nDoctype : Lead\nTrigger : on_insert\n\nPaste this webhook there, as test first and finally production"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cf930f52-d06b-40c1-91f5-fa1c3dfee09a",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
618.1625654107004,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 388.6432532629275,
|
||||
"height": 662,
|
||||
"content": "### Email Body\nGet only Email body from Previous Node and then Convert this to HTML Format so that it looks professional. \n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1023b2b-3e0d-486f-9050-8ff98ff060b5",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1440,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 248.905549047384,
|
||||
"height": 654.6630436071407,
|
||||
"content": "### Get Details of Lead from ERPNext. For us most important is Notes"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "732046b2-967a-4e0c-85e4-ae04e8c0f9cf",
|
||||
"name": "Sticky Note13",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1680,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 222.5278407657604,
|
||||
"height": 651.0941643427163,
|
||||
"content": "### Get Lead ID\nThis will extract the Lead Name in ERPNext. Ensure to send doc.name from the webhook in ERPnext\n\nIt will then send this to next node to get full details of this lead."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b80448ee-5a15-4569-99e4-c3e616a5600d",
|
||||
"name": "Sticky Note14",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1035.2592266730085,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 399.43186296400074,
|
||||
"height": 662,
|
||||
"content": "### Send Email\n\nNow drag and drop the fields from Previous Nodes. Email Addresses Subject and Body.\n\nRemember all fields are selected by AI Agent, whom to send email, what to send and so on. \n\nYou can alternatively inform your employees by whatsapp for quick action."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3d190d34-f6e0-47bc-9216-d312d1d6ee38",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2920,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 475.27306699862953,
|
||||
"height": 636.1483291619771,
|
||||
"content": "## Developed by Amjid Ali\n\nThank you for using this workflow template. It has taken me countless hours of hard work, research, and dedication to develop, and I sincerely hope it adds value to your work.\n\nIf you find this template helpful, I kindly ask you to consider supporting my efforts. Your support will help me continue improving and creating more valuable resources.\n\nYou can contribute via PayPal here:\n\nhttp://paypal.me/pmptraining\n\nFor Full Course about ERPNext or Automation using AI follow below link\n\nhttp://lms.syncbricks.com\n\nAdditionally, when sharing this template, I would greatly appreciate it if you include my original information to ensure proper credit is given.\n\nThank you for your generosity and support!\nEmail : amjid@amjidali.com\nhttps://linkedin.com/in/amjidali\nhttps://syncbricks.com\nhttps://youtube.com/@syncbricks"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cfd7effc-92aa-43c6-9fc5-054b53de74a2",
|
||||
"name": "Sticky Note16",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1160,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 248.905549047384,
|
||||
"height": 654.6630436071407,
|
||||
"content": "### Inquiry with Notes\nIf inquiry is having notes then only it will forward to next node."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5b0992c-e360-4323-82cb-c7ddec45deb5",
|
||||
"name": "Get Lead Data from ERPNext",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-1360,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://erpnext.syncbricks.com/api/resource/Lead/{{ $('Source Website and Status Open').item.json.body.name }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "erpNextApi"
|
||||
},
|
||||
"credentials": {
|
||||
"erpNextApi": {
|
||||
"id": "PInpnsxvPkvaiW0z",
|
||||
"name": "ERPNext account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "87508043-baf5-4fa6-aa38-0f06881dc267",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 302.58963031819115,
|
||||
"height": 660,
|
||||
"content": "### Prepare for Email\nThis node will get approprate Fields for Email \nEmail Addresses:\nSubject : \nEmail Body : "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2b4c1e91-c64b-43cb-aba2-c6f8f5a17c79",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-2300,
|
||||
640
|
||||
],
|
||||
"webhookId": "a39ea4e2-99b7-4ae1-baff-9fb370333e2a",
|
||||
"parameters": {
|
||||
"path": "new-lead-generated-in-erpnext",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Source Website and Status Open",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Lead Body": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Lead Data from ERPNext",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Abbriviations": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Profile": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Policies": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Inquiry has Notes": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Inquiry is Valid?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Fields for Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Fields for Outlook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Body Text Generated by AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Customer Lead AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Inquiry is Valid?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Body for Outlook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Contact Database": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Lead Data from ERPNext": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Inquiry has Notes",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Source Website and Status Open": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Lead Body",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Body Text Generated by AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Body for Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,733 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "e4f78845dfed9ddcfba1945ae00d12e9a7d76eab052afd19299228ce02349d86"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "23291d25-3e1a-4b0d-9b1d-d066e8c04a1f",
|
||||
"name": "Customer Lead AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-640,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=**System Prompt:**\n\nYou are an AI assistant designed to process new leads and generate appropriate responses. Your role includes analyzing lead notes, categorizing them, and generating an email from the system to inform the relevant contact about the inquiry. Do not send the email as if it is directly from the customer; instead, draft it as a notification from the system summarizing the inquiry.\n\n### **Process Flow**\n\n1. **Analyzing Lead Notes:**\n - Extract key details such as the customer name, organization, contact information, and their specific request. \n - Determine if the inquiry relates to products, services, or solutions offered by the company.\n\n2. **Finding the Appropriate Contact(s):**\n - Search the contact database to find the responsible person(s) for the relevant product, service, or solution. \n - If one person is responsible, provide their email. \n - If multiple people are responsible, list all emails separated by commas.\n\n3. **Generating an Email Notification:**\n - Draft a professional email as a notification from the system.\n - Summarize the customer’s inquiry.\n - Include all relevant details to assist the recipient in addressing the inquiry.\n\n4. **Handling Invalid Leads:**\n - If the inquiry is unrelated to products, services, or solutions (e.g., job inquiries or general product inquiries), classify it as invalid and return: \n `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n### **Output Requirements**\n\n1. **For Relevant Leads:**\n - **Email Address(es):** Provide the appropriate email(s). \n - **Email Message Body:** Generate an email notification from the system summarizing the inquiry.\n\n2. **For Invalid Leads:**\n - Return: `\"Invalid Lead - Not related to products, services, or solutions.\"`\n\n\n### **Email Template for Relevant Leads**\n\n**Email Address(es):** [Relevant Email IDs]\n\n**Email Message Body:**\n\n_Subject: New Inquiry from Customer Regarding [Product/Service/Solution]_ \n\nDear [Recipient(s)], \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** [Customer Name] \n**Organization:** [Organization Name] \n**Contact Information:** [Contact Details] \n\n**Inquiry Summary:** \n[Summarized description of the customer's request, e.g., “The customer is seeking to upgrade their restroom facilities with touchless soap dispensers and tissue holders installed behind mirrors. They have requested a site visit to assess the location and provide a proposal.”] \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \n[Your System Name] \n\n\n### **Example Output**\n\n**Input Lead Notes:**\n*\"Dear Syncbricks, We are looking to Develop Workflow Automation Soluition for our company, can you let us know the details what do you offer in tems of this.\"*\n\n**Output:**\n\n- **Email Address(es):** employee@syncbricks.com\n\n- **Email Message Body:** \n\n_Subject: Workflow Automation Platform Integration_ \n\nDear -Emploiyee Name (s) --, \n\nWe have received a new inquiry from a customer through our system. Below are the details: \n\n**Customer Name:** Amjid Ali \n**Organization:** Syncbricks LLC\n**Contact Information:** 123456789 \n\n**Inquiry Summary:** \nThe customer is asking for workflow automation for their company \n\n**Action Required:** \nPlease prioritize this inquiry and reach out to the customer promptly to address their requirements. \n\nThank you, \nSyncbricks LLC\n\n---\nHere are the Lead Details\nLead Name : {{ $json.data.lead_name }}\nCompany : {{ $json.data.company_name }}\nSource : {{ $json.data.source }}\nNotes : {{ $json.data.notes }}\nCity : {{ $json.data.city }}\nCountry : {{ $json.data.country }}\nMobile : {{ $json.data.mobile_no }}",
|
||||
"options": {},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "1831dc36-910b-4a72-a90e-b411f105a8c3",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-800,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "hTl3a2XqteCwExYY",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "79713c56-2f7c-4872-90e4-331715f54048",
|
||||
"name": "Abbriviations",
|
||||
"type": "n8n-nodes-base.googleSheetsTool",
|
||||
"position": [
|
||||
-640,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit#gid=0",
|
||||
"cachedResultName": "abbrivaitions"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gtdrAe-jjQH9gQdXA9PJ5y3dSAN4i6k_Rs5sDyALIfU/edit?usp=drivesdk",
|
||||
"cachedResultName": "Abbriviations List"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "L3lApjbQfMm36LLX",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "73b1e3c9-4703-4f87-8399-e7a9bf368d4c",
|
||||
"name": "Lead Body",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-1640,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "82a674a2-4d12-45f2-b276-cc95cf7b2e93",
|
||||
"name": "body",
|
||||
"type": "object",
|
||||
"value": "={{ $json.body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "5f25d846-c639-49e5-bea2-160000bfb104",
|
||||
"name": "Source Website and Status Open",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-1920,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "2b184de2-a64e-44e3-8f25-645539681533",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.source }}",
|
||||
"rightValue": "Website"
|
||||
},
|
||||
{
|
||||
"id": "9632cf65-11a1-483c-95c8-94bfe84fb243",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.body.status }}",
|
||||
"rightValue": "Open"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "12ba65c9-0890-4862-9704-98492eb8f637",
|
||||
"name": "Microsoft Outlook",
|
||||
"type": "n8n-nodes-base.microsoftOutlook",
|
||||
"position": [
|
||||
1180,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"subject": "={{ $('Fields for Outlook').item.json.subject }}",
|
||||
"bodyContent": "={{ $json.html }}\n<a href=\"https://erpnext.syncbricks.com/app/lead/{{ $('Webhook').item.json.body.name }}\" target=\"_blank\" rel=\"noopener noreferrer\">Here is Lead {{ $('Source Website and Status Open').item.json.body.name }} </a>\n",
|
||||
"toRecipients": "= {{ $('Fields for Outlook').item.json.email_addresses }}",
|
||||
"additionalFields": {
|
||||
"bodyContentType": "html"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"microsoftOutlookOAuth2Api": {
|
||||
"id": "9gy3uvf3pmBdpEsq",
|
||||
"name": "Microsoft Outlook Al Ansari"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "b1410997-3705-4234-918e-a14e4ccc6b70",
|
||||
"name": "Email Body Text Generated by AI",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
700,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "cdce31fb-2ec9-45ce-a4ac-a6ff9c811dc3",
|
||||
"name": "email_body",
|
||||
"type": "string",
|
||||
"value": "={{ $json.email_body }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "b10684b9-9f72-42b3-a9f9-c54e711ceb59",
|
||||
"name": "Fields for Outlook",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
360,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Input text from the `output` field\nconst textOutput = $json?.output || '';\n\n// Function to extract values from the text\nfunction extractFields(text) {\n const fields = {};\n\n // Regular expressions to extract each field\n const emailMatch = text.match(/\\*\\*Email Address\\(es\\):\\*\\*\\s*([^\\n]+)/);\n const subjectMatch = text.match(/_Subject:\\s*([^_]+)/);\n const emailBodyMatch = text.match(/Dear[\\s\\S]+/);\n\n // Assign extracted values to the fields\n fields.email_addresses = emailMatch ? emailMatch[1].trim() : null;\n fields.subject = subjectMatch ? subjectMatch[1].trim() : null;\n fields.email_body = emailBodyMatch ? emailBodyMatch[0].trim() : null;\n\n return fields;\n}\n\n// Extract fields from the output\nconst extractedFields = extractFields(textOutput);\n\n// Return the fields as JSON\nreturn {\n json: extractedFields\n};\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "e2c10569-fde2-425c-8b20-fdb32a6e2bd5",
|
||||
"name": "Email Body for Outlook",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
860,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Input email body\nconst emailBody = $json.email_body || '';\n\n// Function to convert plain text email body into HTML\nfunction formatEmailBodyAsHtml(body) {\n // Replace markdown-like sections with corresponding HTML\n let htmlBody = body\n .replace(/\\*\\*Customer Name:\\*\\* (.+)/, '<p><strong>Customer Name:</strong> $1</p>')\n .replace(/\\*\\*Organization:\\*\\* (.+)/, '<p><strong>Organization:</strong> $1</p>')\n .replace(/\\*\\*Contact Information:\\*\\* (.+)/, '<p><strong>Contact Information:</strong> $1</p>')\n .replace(/\\*\\*Inquiry Summary:\\*\\*\\s*([\\s\\S]+?)(?=\\n\\n\\*\\*Action Required:)/, '<p><strong>Inquiry Summary:</strong> $1</p>')\n .replace(/\\*\\*Action Required:\\*\\*\\s*([\\s\\S]+)/, '<p><strong>Action Required:</strong> $1</p>');\n\n // Wrap each paragraph in `<p>` tags for better readability\n htmlBody = htmlBody\n .replace(/Dear (.+?),/, '<p>Dear <strong>$1</strong>,</p>')\n .replace(/Thank you,\\s+(.+)/, '<p>Thank you,<br><strong>$1</strong></p>');\n\n return htmlBody;\n}\n\n// Convert the email body into HTML\nconst formattedHtmlBody = formatEmailBodyAsHtml(emailBody);\n\n// Return the formatted HTML\nreturn {\n html: formattedHtmlBody\n};\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "3297550b-ed78-4528-ad65-facdc879590a",
|
||||
"name": "Inquiry has Notes",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-1080,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "bc81994a-2ad8-4af7-8c58-2c7e58a0fd2e",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.data.notes }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "e2544a27-8b6d-4bb0-84f1-00c3a5e66978",
|
||||
"name": "Inquiry is Valid?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
40,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "ddd5e8a2-277f-4db6-b38d-28a7b91a2f66",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "notEquals"
|
||||
},
|
||||
"leftValue": "={{ $json.output }}",
|
||||
"rightValue": "**Invalid Lead - Not related to products, services, or solutions.**"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "39cc73e7-ceb3-4e8e-a5bc-55648595f784",
|
||||
"name": "Company Profile",
|
||||
"type": "n8n-nodes-base.googleDocsTool",
|
||||
"position": [
|
||||
-540,
|
||||
800
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "get",
|
||||
"documentURL": "you-must-provide-the-doc-id"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "RdTuYvYpBqEKhIQ3",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "8ee24c59-1acb-4d76-a136-74e69d694a49",
|
||||
"name": "Company Policies",
|
||||
"type": "n8n-nodes-base.googleDocsTool",
|
||||
"position": [
|
||||
-420,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "get",
|
||||
"documentURL": "you-must-provide-the-doc-id"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "RdTuYvYpBqEKhIQ3",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "a5db3aa7-8a77-4553-9c13-a96c51f32745",
|
||||
"name": "Company Contact Database",
|
||||
"type": "n8n-nodes-base.googleSheetsTool",
|
||||
"position": [
|
||||
-300,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "",
|
||||
"cachedResultUrl": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=Telephone Directory"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "L3lApjbQfMm36LLX",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "f3e73266-faa4-4e6d-8c60-92669d64233b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2000,
|
||||
257.53836663807056
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 297.84037615575886,
|
||||
"height": 643.0692298205195,
|
||||
"content": "### Filter the Lead\nI have done only for theose which are open and where the source is Website. You can remove this if you want to have all leads."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0056e35c-4901-406d-9a95-f6da26808841",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-60,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 302.58963031819115,
|
||||
"height": 660,
|
||||
"content": "### Output from AI Agent\nIf the INquiry is invalid, not related to the products and services offered, it will invalidate that you can optionnally link the invalid output to email or anything. Options are limitless"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5e0e9561-0fb8-4225-aa59-58e25abc8ca1",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-880,
|
||||
280.0000000000002
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 764.2159851725196,
|
||||
"height": 648.5051458745236,
|
||||
"content": "### Customer Experience Agent (AI)\nNow this Node is an AI Agent who is speicalized to understand the Lead Source and the Inquiry sent by Cusomter. The Agent will look at company information, which has detials of producuts and services defined in Google Docs, and the Contacts Sheet where a column must be added mentioning that who is the person dealing in which products, solutions and services. Once the inquiry is about speicifc product solution and service it will look from the sheet and then will decide to whom the email has to be sent. Details is defined in the Agent.\nMake sure to drag fields from http request node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5a3ca9c9-07c2-4c74-ba8c-6b14f487fc4d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2420,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 398,
|
||||
"height": 642,
|
||||
"content": "### Once the Lead is generatd in ERP\n\nConsider creating creating an inquiry web form in ERPNext and let the Website Visitor fill that Inquiry form, as soon as the iqnuiry form is filled this workflow will start.\n\nMake sure to create a webhook in ERPNext. Follow Below steps in ERPNext.\n\nGo to Wehbooks \nDoctype : Lead\nTrigger : on_insert\n\nPaste this webhook there, as test first and finally production"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cf930f52-d06b-40c1-91f5-fa1c3dfee09a",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
618.1625654107004,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 388.6432532629275,
|
||||
"height": 662,
|
||||
"content": "### Email Body\nGet only Email body from Previous Node and then Convert this to HTML Format so that it looks professional. \n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1023b2b-3e0d-486f-9050-8ff98ff060b5",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1440,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 248.905549047384,
|
||||
"height": 654.6630436071407,
|
||||
"content": "### Get Details of Lead from ERPNext. For us most important is Notes"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "732046b2-967a-4e0c-85e4-ae04e8c0f9cf",
|
||||
"name": "Sticky Note13",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1680,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 222.5278407657604,
|
||||
"height": 651.0941643427163,
|
||||
"content": "### Get Lead ID\nThis will extract the Lead Name in ERPNext. Ensure to send doc.name from the webhook in ERPnext\n\nIt will then send this to next node to get full details of this lead."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b80448ee-5a15-4569-99e4-c3e616a5600d",
|
||||
"name": "Sticky Note14",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1035.2592266730085,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 399.43186296400074,
|
||||
"height": 662,
|
||||
"content": "### Send Email\n\nNow drag and drop the fields from Previous Nodes. Email Addresses Subject and Body.\n\nRemember all fields are selected by AI Agent, whom to send email, what to send and so on. \n\nYou can alternatively inform your employees by whatsapp for quick action."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3d190d34-f6e0-47bc-9216-d312d1d6ee38",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2920,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 475.27306699862953,
|
||||
"height": 636.1483291619771,
|
||||
"content": "## Developed by Amjid Ali\n\nThank you for using this workflow template. It has taken me countless hours of hard work, research, and dedication to develop, and I sincerely hope it adds value to your work.\n\nIf you find this template helpful, I kindly ask you to consider supporting my efforts. Your support will help me continue improving and creating more valuable resources.\n\nYou can contribute via PayPal here:\n\nhttp://paypal.me/pmptraining\n\nFor Full Course about ERPNext or Automation using AI follow below link\n\nhttp://lms.syncbricks.com\n\nAdditionally, when sharing this template, I would greatly appreciate it if you include my original information to ensure proper credit is given.\n\nThank you for your generosity and support!\nEmail : amjid@amjidali.com\nhttps://linkedin.com/in/amjidali\nhttps://syncbricks.com\nhttps://youtube.com/@syncbricks"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cfd7effc-92aa-43c6-9fc5-054b53de74a2",
|
||||
"name": "Sticky Note16",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1160,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 248.905549047384,
|
||||
"height": 654.6630436071407,
|
||||
"content": "### Inquiry with Notes\nIf inquiry is having notes then only it will forward to next node."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5b0992c-e360-4323-82cb-c7ddec45deb5",
|
||||
"name": "Get Lead Data from ERPNext",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-1360,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://erpnext.syncbricks.com/api/resource/Lead/{{ $('Source Website and Status Open').item.json.body.name }}",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "erpNextApi"
|
||||
},
|
||||
"credentials": {
|
||||
"erpNextApi": {
|
||||
"id": "PInpnsxvPkvaiW0z",
|
||||
"name": "ERPNext account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "87508043-baf5-4fa6-aa38-0f06881dc267",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 3,
|
||||
"width": 302.58963031819115,
|
||||
"height": 660,
|
||||
"content": "### Prepare for Email\nThis node will get approprate Fields for Email \nEmail Addresses:\nSubject : \nEmail Body : "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2b4c1e91-c64b-43cb-aba2-c6f8f5a17c79",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-2300,
|
||||
640
|
||||
],
|
||||
"webhookId": "a39ea4e2-99b7-4ae1-baff-9fb370333e2a",
|
||||
"parameters": {
|
||||
"path": "new-lead-generated-in-erpnext",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Source Website and Status Open",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Lead Body": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Lead Data from ERPNext",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Abbriviations": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Profile": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Policies": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Inquiry has Notes": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Inquiry is Valid?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Fields for Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Fields for Outlook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Body Text Generated by AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Customer Lead AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Inquiry is Valid?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Body for Outlook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Microsoft Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Contact Database": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Customer Lead AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Lead Data from ERPNext": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Inquiry has Notes",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Source Website and Status Open": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Lead Body",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Body Text Generated by AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Body for Outlook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}AI-Driven Lead Management and Inquiry Automation with ERPNext & n8n
|
||||
File diff suppressed because it is too large
Load Diff
1034
OpenAI_and_LLMs/AI-Generated Summary Block for WordPress Posts.txt
Normal file
1034
OpenAI_and_LLMs/AI-Generated Summary Block for WordPress Posts.txt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,851 +0,0 @@
|
||||
{
|
||||
"id": "q8IFGLeOCGSfoWZu",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Email AI Auto-responder. Summerize and send email",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "59885699-0f6c-4522-acff-9e28b2a07b82",
|
||||
"name": "Email Trigger (IMAP)",
|
||||
"type": "n8n-nodes-base.emailReadImap",
|
||||
"position": [
|
||||
-440,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"imap": {
|
||||
"id": "k31W9oGddl9pMDy4",
|
||||
"name": "IMAP info@n3witalia.com"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "b268ab9d-b2e3-46e6-b7ae-70aff0b5484d",
|
||||
"name": "Markdown",
|
||||
"type": "n8n-nodes-base.markdown",
|
||||
"position": [
|
||||
-220,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.textHtml }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "13c2d151-6f59-4e1f-a174-02d4d0bcaefd",
|
||||
"name": "DeepSeek R1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-20,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "deepseek/deepseek-r1:free",
|
||||
"cachedResultName": "deepseek/deepseek-r1:free"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "XJTqRiKFJpFs5MuX",
|
||||
"name": "OpenRouter account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "8149e40d-64e6-4fb9-aebc-2a2483961f07",
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
500,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.text }}",
|
||||
"options": {},
|
||||
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
|
||||
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
|
||||
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": {
|
||||
"id": "hRjP3XbDiIQqvi7x",
|
||||
"name": "SMTP info@n3witalia.com"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "633f0ce9-04ff-4653-8bbc-7457ba0d18bd",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-320,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "retrieve-as-tool",
|
||||
"options": {},
|
||||
"toolName": "company_knowladge_base",
|
||||
"toolDescription": "Extracts information regarding the request made.",
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
},
|
||||
"includeDocumentMetadata": false
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "20daf5d3-dc9c-4fad-9f2f-98d86bc1660c",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-340,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "67699bca-4096-4259-bbd4-51a879539aca",
|
||||
"name": "Email Classifier",
|
||||
"type": "@n8n/n8n-nodes-langchain.textClassifier",
|
||||
"position": [
|
||||
360,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"fallback": "other",
|
||||
"multiClass": false,
|
||||
"enableAutoFixing": true,
|
||||
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.\n"
|
||||
},
|
||||
"inputText": "=You must classify the following email::\n\n{{ $json.response.text }}",
|
||||
"categories": {
|
||||
"categories": [
|
||||
{
|
||||
"category": "Company info request",
|
||||
"description": "Company info request"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9f7742e9-87d5-40b9-9129-0777d8a37933",
|
||||
"name": "Email Summarization Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
|
||||
"position": [
|
||||
0,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"binaryDataKey": "={{ $json.data }}",
|
||||
"summarizationMethodAndPrompts": {
|
||||
"values": {
|
||||
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
|
||||
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operationMode": "nodeInputBinary"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "e2d404c0-2aad-407d-b75e-5ef0c5105c0e",
|
||||
"name": "Write email",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-440,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
|
||||
"options": {
|
||||
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "3786c2de-c5cb-4233-826e-7265f2bccbdb",
|
||||
"name": "Review email",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
40,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Review at the following email:\n\n{{ $json.output }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary.\n\nNon superare le 100 parole."
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "baf60eba-5e7b-467f-b27e-1388a91622d0",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-500,
|
||||
-980
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "77e6160f-20a7-4a75-9fef-bc875b953a16",
|
||||
"name": "Create collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-200,
|
||||
-1120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "ab7764d1-531c-4281-8b89-015fb3f5e780",
|
||||
"name": "Refresh collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-200,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION/points/delete",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "cd3eaa81-0f94-484b-b0c2-ecf0ca4541dc",
|
||||
"name": "Get folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
20,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=test-whatsapp"
|
||||
}
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b39ecd2d-4d5b-4885-86a9-2cfe9f6074ef",
|
||||
"name": "Download Files",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
240,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "text/plain"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "8171b8f2-998d-4d72-ac28-524daae4a2d7",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
620,
|
||||
-660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec6737ad-3fbe-4864-9df8-44f82d6f2c5c",
|
||||
"name": "Token Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
|
||||
"position": [
|
||||
600,
|
||||
-500
|
||||
],
|
||||
"parameters": {
|
||||
"chunkSize": 300,
|
||||
"chunkOverlap": 30
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "57b6a4f3-e935-4058-bfdf-309d606c0ca9",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
-1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 880,
|
||||
"height": 220,
|
||||
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "21e2326a-138d-46f3-a849-a80aa7917da9",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
480,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0818fb6a-2adf-4725-90a4-11cdd7d14036",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
500,
|
||||
-620
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "8949d938-2743-45d6-b2ad-ce4ac139e0a3",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-220,
|
||||
-920
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 620,
|
||||
"height": 400,
|
||||
"content": "# STEP 2\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36d384be-3e11-43b1-b8c3-f63df600a6a6",
|
||||
"name": "Do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
820,
|
||||
0
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "386c27cb-6e69-4d96-a8ab-8cfd43e6b171",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-520,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "0bd17bef-e205-464e-9b36-dcda75254e06",
|
||||
"name": "DeepSeek",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
40,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "deepseek/deepseek-r1:free",
|
||||
"cachedResultName": "deepseek/deepseek-r1:free"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "XJTqRiKFJpFs5MuX",
|
||||
"name": "OpenRouter account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "3e68a65f-af29-432f-8159-4a599e8a0866",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-540,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1620,
|
||||
"height": 240,
|
||||
"content": "# STEP 3 - MAIN FLOW\n\n- Transform the email into Markdown format for optimal reading by the LLM model\n- Email Summarization through DeepSeek R1 (any model can be used)\n- I classify the email in such a way as to continue only with emails regarding general information about the company. In this way I can respond independently through the information obtained from the vector database\n- I create a chain where I entrust the review of the email to a high-performance model designed for this purpose\n- I send the response email\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3b6ae6aa-75a8-4038-bbc2-248ab533b3ab",
|
||||
"name": "OpenAI 4-o-mini",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
360,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Email Trigger (IMAP)": [
|
||||
{
|
||||
"json": {
|
||||
"to": "info@n3witalia.com",
|
||||
"date": "Wed, 5 Feb 2025 13:38:51 +0100",
|
||||
"from": "n3w Italia <info@n3w.it>",
|
||||
"subject": "Richiesta di informazioni aziendali",
|
||||
"metadata": {
|
||||
"x-gm-gg": "ASbGncsq6D/oyHjmnpbG4gCUuC0rZNUR8WW4c+LmGMSdGJ1lHkRnKn7b3ngCdndp8NB\tkyDG3unga3kPebzAv1LO7DS6rDMHTWb8F7kZoLijJUGlAy6wqmfX/n4z2DH1uSxp7EsnIP9K9",
|
||||
"arc-seal": "i=1; s=arc-2022; d=mailchannels.net; t=1738759167; a=rsa-sha256;\tcv=none;\tb=Fdjl0FQlp2JxGTUy9B6U3UVZDgw2xRK0M9ge2H7QXFuX8Jhy2/eDktsWwyDOuAnebq+pZB\tZmt9/ZWM+VqpfvPc9j4+cpX1HnXkRnyV9HMp0KK1Srpkuc7iimLDX1puMEQP08mC8fBI9n\tYW9JAMVmy55D2xtcOgqQPe6HUsAM8vFfk0y7dv7aV/MMc4tW+lyBddf4BHedDPabmHtog9\tlI9qQB8f5o78KJoJHi9jUfoibHrw7ePCi/XNi1KzfLhkkcvaEhOIg82JgyaTOVuLX4TTpy\t713VrUVQKemdE8AJBgxrUyI8AM/XZDRxF92tDNRD5k+rFxVwZnNg1KzovEUFiw==",
|
||||
"received": "from postfix-inbound-v2-3.inbound.mailchannels.net (inbound-egress-7.mailchannels.net [23.83.220.5])\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)\t(No client certificate requested)\tby pdx1-sub0-mail-mx201.dreamhost.com (Postfix) with ESMTPS id 4Yp0DP2WKvz6n5V\tfor <info@n3witalia.com>; Wed, 5 Feb 2025 04:39:33 -0800 (PST)",
|
||||
"message-id": "<CACo-EPti-vvs3198N-KKhAMnm70ppkmGJPkUz3Y483wxAv_z3g@mail.gmail.com>",
|
||||
"x-received": "by 2002:a05:6820:4ccb:b0:5fa:7e37:e42e with SMTP id 006d021491bc7-5fc479d7b7dmr1800193eaf.3.1738759166233; Wed, 05 Feb 2025 04:39:26 -0800 (PST)",
|
||||
"return-path": "<info@n3w.it>",
|
||||
"content-type": "multipart/alternative; boundary=\"000000000000742c2a062d646a8f\"",
|
||||
"delivered-to": "x21967472@pdx1-sub0-mail-mx201.dreamhost.com",
|
||||
"mime-version": "1.0",
|
||||
"received-spf": "none (dmarc-service-75b56dd9b6-qz8tf: n3w.it does not provide an SPF record) client-ip=209.85.161.50; envelope-from=info@n3w.it; helo=mail-oo1-f50.google.com;",
|
||||
"x-message-id": "YDPlyzG1R2Ky6usgMxqEJvf1",
|
||||
"x-gm-features": "AWEUYZl838uJdYn-9fUMGZvOqArNBONSW_VOkpWSkn1OYyR-HUtJL8UAJf2I33g",
|
||||
"x-original-to": "info@n3witalia.com",
|
||||
"dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=n3w-it.20230601.gappssmtp.com; s=20230601; t=1738759166; x=1739363966; darn=n3witalia.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=eH1Dg2CwoWEuiif+VkxoPH8PcgiveMtY7urkbJAXXAEnpmkknbrSX7fLQ/pdfnV2YF RaDEVEFBYeYde7pra1NhNmQXQfamV6dxTZSoNOVj0DtdOuSZVYC4BQMMQiIk7emERgdx keDGBtYe2SifOK9QDK4deKKFPaswC7vATsPmBIAnN0MDahaOlsDPbm6aFSR39aK0qEpx MTylUSCNFx52cTYegrpzMGCRTrCxcHwvpq0gGZo1ol0mlq5WC4sa260qsVEQq566N1wh ICipbEhLdoX0nryrR67fJ+mq05kfg39gv++0p1aZl3/ahTdLTijPJswPs4phiTUj6fUH Z3Fg==",
|
||||
"x-gm-message-state": "AOJu0YwNwfJ1yYtAsu71S9Oy+BVSQqPDS1EJCni+CLWs7aDwxkFYjxsP\tX0A935B/tHpnOhgJuR8W5FwuKnXSFMZ/xP8TFQz8zBVGw7DYInyaC0lKAxPSbBsLDIFyVj2LYki\tR4sfj6a9YJDaWKE/HYPwbidCOfOV/mZvqJ2ESL5uJgSL0W4FrMJKmondc",
|
||||
"x-google-smtp-source": "AGHT+IFsZ2bQKEg+M9ddjCSDXjf2Okz49s6pteuNGyJAkFpjMLwhH4mshXYItB/GVj4r8fUIiAiACRT+QDfae1MMj48=",
|
||||
"arc-message-signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net;\ts=arc-2022; t=1738759167;\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\t to:to:cc:mime-version:mime-version:content-type:content-type:\t dkim-signature; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=;\tb=xytHIe/PVvcfCsSYAhcVE9VlTvmbJcVbkpq0oKRt4H0M1VOfZZlsg5ILysJvwLAzrRO7SZ\tDUrh4bw57jqMpcE+Sk5AAcbgBMc6x1G+Wf/2nqnjy0hRCyqtajuUwtFOS3kDM7TKvFOU+/\tMFChI5mg97hb/0loj8DWQ+J24bu4a6YixGDglupW3JYJoDsPWje2oA+mYyiI5tsnRXFEwe\tpku9KlXkPburbm/ASqKbbi1Y9bEOa2vlRwLL3fFontmC+3kgogunW2fjf4YJlFlSaAj/Xb\tZXQiytNgKOJtkBQMvb0AmYMLgBbYdOBVzUkOUTQCP3Wzbuu0zslvl7cS3HkFIg==",
|
||||
"authentication-results": "inbound.mailchannels.net; spf=none smtp.mailfrom=info@n3w.it; dkim=temperror header.d=n3w-it.20230601.gappssmtp.com; dmarc=none; arc=none",
|
||||
"x-google-dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759166; x=1739363966; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=h+GPFjY1knf3xPd+R62zD7JNhs37K+F1qx+6EA3codzYY+yTXSJyTuETXOGVW5r2VK GOcntvGBdeijxte5RLmN6ZwLjvzePLlJLQVOnY8FICowUbwClQbDW1vXvucD+WaGpnBg O95TH/8jKWRBU34EZ9kAY5EqtauKSt675WyhVCmmT864BPbVV335d0t9RgJwV86rM9zy /miMTqpWeDJxDcX4thRlIk19GDc2Wh+5bqFD9kacOAur46RWdwqWaU7T8+5bQmbrKUg5 hqeO8ZDefVV6AyOjSnuLItHcHhlk1PaQ9uOumkRnFQfLUjS08bvLEnJyMA1YrEdo7mCi tD2Q==",
|
||||
"arc-authentication-results": "i=1;\tinbound-rspamd-8684fd6f95-jsctp;\tnone"
|
||||
},
|
||||
"textHtml": "<div dir=\"ltr\">mi chiamo Davide e sto scrivendo per richiedere alcune informazioni riguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni per [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo, richiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato se poteste fornirmi alcuni dettagli utili.<br><br>In particolare, avrei bisogno di sapere:<br><br>Gli orari di apertura del vostro negozio, inclusi eventuali giorni di chiusura o orari ridotti durante i festivi.<br><br>Se offrite servizi di assistenza tecnica per dispositivi elettronici e, in caso affermativo, quali tipologie di dispositivi supportate (es. smartphone, computer, tablet).<br><br>Se disponete di un catalogo prodotti aggiornato o un sito web dove posso consultare lâofferta disponibile.<br><br>Se effettuate consegne a domicilio o se è possibile prenotare prodotti online per il ritiro in negozio.<br><br>Se offrite sconti o promozioni per studenti, aziende o clienti abituali.<br><br>Se organizzate eventi o workshop legati alla tecnologia, come corsi di formazione o presentazioni di nuovi prodotti.<br><br>Inoltre, sarei interessato a sapere se il vostro negozio aderisce a programmi di riciclo di dispositivi elettronici o se offrite servizi di smaltimento ecologico per apparecchiature obsolete.<br><br>Se possibile, gradirei ricevere anche informazioni sui metodi di pagamento accettati (es. carte di credito, PayPal, finanziamenti) e se è possibile richiedere un preventivo personalizzato per acquisti di grandi dimensioni.<br><br>Resto a disposizione per eventuali chiarimenti o per fornire ulteriori dettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato alla mia richiesta e attendo con interesse una vostra risposta.<br><br>Cordiali saluti,</div>\r\n",
|
||||
"textPlain": "mi chiamo Davide e sto scrivendo per richiedere alcune informazioni\r\nriguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni\r\nper [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo,\r\nrichiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato\r\nse poteste fornirmi alcuni dettagli utili.\r\n\r\nIn particolare, avrei bisogno di sapere:\r\n\r\nGli orari di apertura del vostro negozio, inclusi eventuali giorni di\r\nchiusura o orari ridotti durante i festivi.\r\n\r\nSe offrite servizi di assistenza tecnica per dispositivi elettronici e, in\r\ncaso affermativo, quali tipologie di dispositivi supportate (es.\r\nsmartphone, computer, tablet).\r\n\r\nSe disponete di un catalogo prodotti aggiornato o un sito web dove posso\r\nconsultare lâofferta disponibile.\r\n\r\nSe effettuate consegne a domicilio o se è possibile prenotare prodotti\r\nonline per il ritiro in negozio.\r\n\r\nSe offrite sconti o promozioni per studenti, aziende o clienti abituali.\r\n\r\nSe organizzate eventi o workshop legati alla tecnologia, come corsi di\r\nformazione o presentazioni di nuovi prodotti.\r\n\r\nInoltre, sarei interessato a sapere se il vostro negozio aderisce a\r\nprogrammi di riciclo di dispositivi elettronici o se offrite servizi di\r\nsmaltimento ecologico per apparecchiature obsolete.\r\n\r\nSe possibile, gradirei ricevere anche informazioni sui metodi di pagamento\r\naccettati (es. carte di credito, PayPal, finanziamenti) e se è possibile\r\nrichiedere un preventivo personalizzato per acquisti di grandi dimensioni.\r\n\r\nResto a disposizione per eventuali chiarimenti o per fornire ulteriori\r\ndettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato\r\nalla mia richiesta e attendo con interesse una vostra risposta.\r\n\r\nCordiali saluti,\r\n"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Email Summarization Chain": [
|
||||
{
|
||||
"json": {
|
||||
"response": {
|
||||
"text": "Davide contatta il negozio di tecnologia per richiedere informazioni in merito a: orari di apertura (compresi festivi e chiusure), assistenza tecnica (specificando dispositivi supportati come smartphone, computer, tablet), disponibilità di catalogo aggiornato/sito web, opzioni di consegna a domicilio o ritiro in negozio, sconti per studenti/aziende/clienti abituali, eventi/workshop tematici, programmi di riciclo/smaltimento ecologico, metodi di pagamento accettati (carte, PayPal, finanziamenti) e preventivi personalizzati per acquisti consistenti. Si rende disponibile per ulteriori chiarimenti e ringrazia per la risposta. (99 parole)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "eee08614-3096-477a-b462-859782a74188",
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"DeepSeek": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Review email",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Markdown": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Summarization Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"DeepSeek R1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Email Summarization Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Write email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Review email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Review email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Token Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI 4-o-mini": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Email Classifier",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Classifier": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Refresh collection": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Trigger (IMAP)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Summarization Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Classifier",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Refresh collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,851 @@
|
||||
{
|
||||
"id": "q8IFGLeOCGSfoWZu",
|
||||
"meta": {
|
||||
"instanceId": "a4bfc93e975ca233ac45ed7c9227d84cf5a2329310525917adaf3312e10d5462",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Email AI Auto-responder. Summerize and send email",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "59885699-0f6c-4522-acff-9e28b2a07b82",
|
||||
"name": "Email Trigger (IMAP)",
|
||||
"type": "n8n-nodes-base.emailReadImap",
|
||||
"position": [
|
||||
-440,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"imap": {
|
||||
"id": "k31W9oGddl9pMDy4",
|
||||
"name": "IMAP info@n3witalia.com"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "b268ab9d-b2e3-46e6-b7ae-70aff0b5484d",
|
||||
"name": "Markdown",
|
||||
"type": "n8n-nodes-base.markdown",
|
||||
"position": [
|
||||
-220,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.textHtml }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "13c2d151-6f59-4e1f-a174-02d4d0bcaefd",
|
||||
"name": "DeepSeek R1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-20,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "deepseek/deepseek-r1:free",
|
||||
"cachedResultName": "deepseek/deepseek-r1:free"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "XJTqRiKFJpFs5MuX",
|
||||
"name": "OpenRouter account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "8149e40d-64e6-4fb9-aebc-2a2483961f07",
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
500,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"html": "={{ $json.text }}",
|
||||
"options": {},
|
||||
"subject": "=Re: {{ $('Email Trigger (IMAP)').item.json.subject }}",
|
||||
"toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
|
||||
"fromEmail": "={{ $('Email Trigger (IMAP)').item.json.to }}"
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": {
|
||||
"id": "hRjP3XbDiIQqvi7x",
|
||||
"name": "SMTP info@n3witalia.com"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "633f0ce9-04ff-4653-8bbc-7457ba0d18bd",
|
||||
"name": "Qdrant Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
-320,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "retrieve-as-tool",
|
||||
"options": {},
|
||||
"toolName": "company_knowladge_base",
|
||||
"toolDescription": "Extracts information regarding the request made.",
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
},
|
||||
"includeDocumentMetadata": false
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "20daf5d3-dc9c-4fad-9f2f-98d86bc1660c",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
-340,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "67699bca-4096-4259-bbd4-51a879539aca",
|
||||
"name": "Email Classifier",
|
||||
"type": "@n8n/n8n-nodes-langchain.textClassifier",
|
||||
"position": [
|
||||
360,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"fallback": "other",
|
||||
"multiClass": false,
|
||||
"enableAutoFixing": true,
|
||||
"systemPromptTemplate": "Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json.\n"
|
||||
},
|
||||
"inputText": "=You must classify the following email::\n\n{{ $json.response.text }}",
|
||||
"categories": {
|
||||
"categories": [
|
||||
{
|
||||
"category": "Company info request",
|
||||
"description": "Company info request"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9f7742e9-87d5-40b9-9129-0777d8a37933",
|
||||
"name": "Email Summarization Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
|
||||
"position": [
|
||||
0,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"binaryDataKey": "={{ $json.data }}",
|
||||
"summarizationMethodAndPrompts": {
|
||||
"values": {
|
||||
"prompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
|
||||
"combineMapPrompt": "=Write a concise summary of the following in max 100 words:\n\n\"{{ $json.data }}\"\n"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operationMode": "nodeInputBinary"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "e2d404c0-2aad-407d-b75e-5ef0c5105c0e",
|
||||
"name": "Write email",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-440,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Write the text to reply to the following email:\n\n{{ $json.response.text }}",
|
||||
"options": {
|
||||
"systemMessage": "You are an expert at answering emails. You need to answer them professionally based on the information you have. This is a business email. Be concise and never exceed 100 words."
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "3786c2de-c5cb-4233-826e-7265f2bccbdb",
|
||||
"name": "Review email",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
40,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Review at the following email:\n\n{{ $json.output }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=If you are an expert in reviewing emails before sending them. You need to review and structure them in such a way that you can send them. It must be in HTML format and you can insert (if you think it is appropriate) only HTML characters such as <br>, <b>, <i>, <p> where necessary.\n\nNon superare le 100 parole."
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "baf60eba-5e7b-467f-b27e-1388a91622d0",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-500,
|
||||
-980
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "77e6160f-20a7-4a75-9fef-bc875b953a16",
|
||||
"name": "Create collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-200,
|
||||
-1120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "ab7764d1-531c-4281-8b89-015fb3f5e780",
|
||||
"name": "Refresh collection",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
-200,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://QDRANTURL/collections/COLLECTION/points/delete",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "{\n \"filter\": {}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"httpHeaderAuth": {
|
||||
"id": "qhny6r5ql9wwotpn",
|
||||
"name": "Qdrant API (Hetzner)"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "cd3eaa81-0f94-484b-b0c2-ecf0ca4541dc",
|
||||
"name": "Get folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
20,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=test-whatsapp"
|
||||
}
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b39ecd2d-4d5b-4885-86a9-2cfe9f6074ef",
|
||||
"name": "Download Files",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
240,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "text/plain"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "HEy5EuZkgPZVEa9w",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "8171b8f2-998d-4d72-ac28-524daae4a2d7",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
620,
|
||||
-660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec6737ad-3fbe-4864-9df8-44f82d6f2c5c",
|
||||
"name": "Token Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
|
||||
"position": [
|
||||
600,
|
||||
-500
|
||||
],
|
||||
"parameters": {
|
||||
"chunkSize": 300,
|
||||
"chunkOverlap": 30
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "57b6a4f3-e935-4058-bfdf-309d606c0ca9",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
-1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 880,
|
||||
"height": 220,
|
||||
"content": "# STEP 1\n\n## Create Qdrant Collection\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "21e2326a-138d-46f3-a849-a80aa7917da9",
|
||||
"name": "Qdrant Vector Store1",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
|
||||
"position": [
|
||||
480,
|
||||
-860
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"qdrantCollection": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "=COLLECTION"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"qdrantApi": {
|
||||
"id": "iyQ6MQiVaF3VMBmt",
|
||||
"name": "QdrantApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0818fb6a-2adf-4725-90a4-11cdd7d14036",
|
||||
"name": "Embeddings OpenAI1",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
500,
|
||||
-620
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "8949d938-2743-45d6-b2ad-ce4ac139e0a3",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-220,
|
||||
-920
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 620,
|
||||
"height": 400,
|
||||
"content": "# STEP 2\n\n\n\n\n\n\n\n\n\n\n\n\n## Documents vectorization with Qdrant and Google Drive\nChange:\n- QDRANTURL\n- COLLECTION"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36d384be-3e11-43b1-b8c3-f63df600a6a6",
|
||||
"name": "Do nothing",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"position": [
|
||||
820,
|
||||
0
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "386c27cb-6e69-4d96-a8ab-8cfd43e6b171",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-520,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "0bd17bef-e205-464e-9b36-dcda75254e06",
|
||||
"name": "DeepSeek",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
40,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "deepseek/deepseek-r1:free",
|
||||
"cachedResultName": "deepseek/deepseek-r1:free"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "XJTqRiKFJpFs5MuX",
|
||||
"name": "OpenRouter account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "3e68a65f-af29-432f-8159-4a599e8a0866",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-540,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1620,
|
||||
"height": 240,
|
||||
"content": "# STEP 3 - MAIN FLOW\n\n- Transform the email into Markdown format for optimal reading by the LLM model\n- Email Summarization through DeepSeek R1 (any model can be used)\n- I classify the email in such a way as to continue only with emails regarding general information about the company. In this way I can respond independently through the information obtained from the vector database\n- I create a chain where I entrust the review of the email to a high-performance model designed for this purpose\n- I send the response email\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3b6ae6aa-75a8-4038-bbc2-248ab533b3ab",
|
||||
"name": "OpenAI 4-o-mini",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
360,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "CDX6QM4gLYanh0P4",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"Email Trigger (IMAP)": [
|
||||
{
|
||||
"json": {
|
||||
"to": "info@n3witalia.com",
|
||||
"date": "Wed, 5 Feb 2025 13:38:51 +0100",
|
||||
"from": "n3w Italia <info@n3w.it>",
|
||||
"subject": "Richiesta di informazioni aziendali",
|
||||
"metadata": {
|
||||
"x-gm-gg": "ASbGncsq6D/oyHjmnpbG4gCUuC0rZNUR8WW4c+LmGMSdGJ1lHkRnKn7b3ngCdndp8NB\tkyDG3unga3kPebzAv1LO7DS6rDMHTWb8F7kZoLijJUGlAy6wqmfX/n4z2DH1uSxp7EsnIP9K9",
|
||||
"arc-seal": "i=1; s=arc-2022; d=mailchannels.net; t=1738759167; a=rsa-sha256;\tcv=none;\tb=Fdjl0FQlp2JxGTUy9B6U3UVZDgw2xRK0M9ge2H7QXFuX8Jhy2/eDktsWwyDOuAnebq+pZB\tZmt9/ZWM+VqpfvPc9j4+cpX1HnXkRnyV9HMp0KK1Srpkuc7iimLDX1puMEQP08mC8fBI9n\tYW9JAMVmy55D2xtcOgqQPe6HUsAM8vFfk0y7dv7aV/MMc4tW+lyBddf4BHedDPabmHtog9\tlI9qQB8f5o78KJoJHi9jUfoibHrw7ePCi/XNi1KzfLhkkcvaEhOIg82JgyaTOVuLX4TTpy\t713VrUVQKemdE8AJBgxrUyI8AM/XZDRxF92tDNRD5k+rFxVwZnNg1KzovEUFiw==",
|
||||
"received": "from postfix-inbound-v2-3.inbound.mailchannels.net (inbound-egress-7.mailchannels.net [23.83.220.5])\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)\t(No client certificate requested)\tby pdx1-sub0-mail-mx201.dreamhost.com (Postfix) with ESMTPS id 4Yp0DP2WKvz6n5V\tfor <info@n3witalia.com>; Wed, 5 Feb 2025 04:39:33 -0800 (PST)",
|
||||
"message-id": "<CACo-EPti-vvs3198N-KKhAMnm70ppkmGJPkUz3Y483wxAv_z3g@mail.gmail.com>",
|
||||
"x-received": "by 2002:a05:6820:4ccb:b0:5fa:7e37:e42e with SMTP id 006d021491bc7-5fc479d7b7dmr1800193eaf.3.1738759166233; Wed, 05 Feb 2025 04:39:26 -0800 (PST)",
|
||||
"return-path": "<info@n3w.it>",
|
||||
"content-type": "multipart/alternative; boundary=\"000000000000742c2a062d646a8f\"",
|
||||
"delivered-to": "x21967472@pdx1-sub0-mail-mx201.dreamhost.com",
|
||||
"mime-version": "1.0",
|
||||
"received-spf": "none (dmarc-service-75b56dd9b6-qz8tf: n3w.it does not provide an SPF record) client-ip=209.85.161.50; envelope-from=info@n3w.it; helo=mail-oo1-f50.google.com;",
|
||||
"x-message-id": "YDPlyzG1R2Ky6usgMxqEJvf1",
|
||||
"x-gm-features": "AWEUYZl838uJdYn-9fUMGZvOqArNBONSW_VOkpWSkn1OYyR-HUtJL8UAJf2I33g",
|
||||
"x-original-to": "info@n3witalia.com",
|
||||
"dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=n3w-it.20230601.gappssmtp.com; s=20230601; t=1738759166; x=1739363966; darn=n3witalia.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=eH1Dg2CwoWEuiif+VkxoPH8PcgiveMtY7urkbJAXXAEnpmkknbrSX7fLQ/pdfnV2YF RaDEVEFBYeYde7pra1NhNmQXQfamV6dxTZSoNOVj0DtdOuSZVYC4BQMMQiIk7emERgdx keDGBtYe2SifOK9QDK4deKKFPaswC7vATsPmBIAnN0MDahaOlsDPbm6aFSR39aK0qEpx MTylUSCNFx52cTYegrpzMGCRTrCxcHwvpq0gGZo1ol0mlq5WC4sa260qsVEQq566N1wh ICipbEhLdoX0nryrR67fJ+mq05kfg39gv++0p1aZl3/ahTdLTijPJswPs4phiTUj6fUH Z3Fg==",
|
||||
"x-gm-message-state": "AOJu0YwNwfJ1yYtAsu71S9Oy+BVSQqPDS1EJCni+CLWs7aDwxkFYjxsP\tX0A935B/tHpnOhgJuR8W5FwuKnXSFMZ/xP8TFQz8zBVGw7DYInyaC0lKAxPSbBsLDIFyVj2LYki\tR4sfj6a9YJDaWKE/HYPwbidCOfOV/mZvqJ2ESL5uJgSL0W4FrMJKmondc",
|
||||
"x-google-smtp-source": "AGHT+IFsZ2bQKEg+M9ddjCSDXjf2Okz49s6pteuNGyJAkFpjMLwhH4mshXYItB/GVj4r8fUIiAiACRT+QDfae1MMj48=",
|
||||
"arc-message-signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net;\ts=arc-2022; t=1738759167;\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\t to:to:cc:mime-version:mime-version:content-type:content-type:\t dkim-signature; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=;\tb=xytHIe/PVvcfCsSYAhcVE9VlTvmbJcVbkpq0oKRt4H0M1VOfZZlsg5ILysJvwLAzrRO7SZ\tDUrh4bw57jqMpcE+Sk5AAcbgBMc6x1G+Wf/2nqnjy0hRCyqtajuUwtFOS3kDM7TKvFOU+/\tMFChI5mg97hb/0loj8DWQ+J24bu4a6YixGDglupW3JYJoDsPWje2oA+mYyiI5tsnRXFEwe\tpku9KlXkPburbm/ASqKbbi1Y9bEOa2vlRwLL3fFontmC+3kgogunW2fjf4YJlFlSaAj/Xb\tZXQiytNgKOJtkBQMvb0AmYMLgBbYdOBVzUkOUTQCP3Wzbuu0zslvl7cS3HkFIg==",
|
||||
"authentication-results": "inbound.mailchannels.net; spf=none smtp.mailfrom=info@n3w.it; dkim=temperror header.d=n3w-it.20230601.gappssmtp.com; dmarc=none; arc=none",
|
||||
"x-google-dkim-signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759166; x=1739363966; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2N6Y8wbn3yS/TpkJr2ZQZ3rEEFMq1gc4mSHvPNXonAg=; b=h+GPFjY1knf3xPd+R62zD7JNhs37K+F1qx+6EA3codzYY+yTXSJyTuETXOGVW5r2VK GOcntvGBdeijxte5RLmN6ZwLjvzePLlJLQVOnY8FICowUbwClQbDW1vXvucD+WaGpnBg O95TH/8jKWRBU34EZ9kAY5EqtauKSt675WyhVCmmT864BPbVV335d0t9RgJwV86rM9zy /miMTqpWeDJxDcX4thRlIk19GDc2Wh+5bqFD9kacOAur46RWdwqWaU7T8+5bQmbrKUg5 hqeO8ZDefVV6AyOjSnuLItHcHhlk1PaQ9uOumkRnFQfLUjS08bvLEnJyMA1YrEdo7mCi tD2Q==",
|
||||
"arc-authentication-results": "i=1;\tinbound-rspamd-8684fd6f95-jsctp;\tnone"
|
||||
},
|
||||
"textHtml": "<div dir=\"ltr\">mi chiamo Davide e sto scrivendo per richiedere alcune informazioni riguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni per [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo, richiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato se poteste fornirmi alcuni dettagli utili.<br><br>In particolare, avrei bisogno di sapere:<br><br>Gli orari di apertura del vostro negozio, inclusi eventuali giorni di chiusura o orari ridotti durante i festivi.<br><br>Se offrite servizi di assistenza tecnica per dispositivi elettronici e, in caso affermativo, quali tipologie di dispositivi supportate (es. smartphone, computer, tablet).<br><br>Se disponete di un catalogo prodotti aggiornato o un sito web dove posso consultare lâofferta disponibile.<br><br>Se effettuate consegne a domicilio o se è possibile prenotare prodotti online per il ritiro in negozio.<br><br>Se offrite sconti o promozioni per studenti, aziende o clienti abituali.<br><br>Se organizzate eventi o workshop legati alla tecnologia, come corsi di formazione o presentazioni di nuovi prodotti.<br><br>Inoltre, sarei interessato a sapere se il vostro negozio aderisce a programmi di riciclo di dispositivi elettronici o se offrite servizi di smaltimento ecologico per apparecchiature obsolete.<br><br>Se possibile, gradirei ricevere anche informazioni sui metodi di pagamento accettati (es. carte di credito, PayPal, finanziamenti) e se è possibile richiedere un preventivo personalizzato per acquisti di grandi dimensioni.<br><br>Resto a disposizione per eventuali chiarimenti o per fornire ulteriori dettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato alla mia richiesta e attendo con interesse una vostra risposta.<br><br>Cordiali saluti,</div>\r\n",
|
||||
"textPlain": "mi chiamo Davide e sto scrivendo per richiedere alcune informazioni\r\nriguardanti il vostro negozio di tecnologia. Sto valutando diverse opzioni\r\nper [motivo della richiesta, ad esempio: acquistare un nuovo dispositivo,\r\nrichiedere assistenza tecnica, o esplorare servizi aziendali] e sarei grato\r\nse poteste fornirmi alcuni dettagli utili.\r\n\r\nIn particolare, avrei bisogno di sapere:\r\n\r\nGli orari di apertura del vostro negozio, inclusi eventuali giorni di\r\nchiusura o orari ridotti durante i festivi.\r\n\r\nSe offrite servizi di assistenza tecnica per dispositivi elettronici e, in\r\ncaso affermativo, quali tipologie di dispositivi supportate (es.\r\nsmartphone, computer, tablet).\r\n\r\nSe disponete di un catalogo prodotti aggiornato o un sito web dove posso\r\nconsultare lâofferta disponibile.\r\n\r\nSe effettuate consegne a domicilio o se è possibile prenotare prodotti\r\nonline per il ritiro in negozio.\r\n\r\nSe offrite sconti o promozioni per studenti, aziende o clienti abituali.\r\n\r\nSe organizzate eventi o workshop legati alla tecnologia, come corsi di\r\nformazione o presentazioni di nuovi prodotti.\r\n\r\nInoltre, sarei interessato a sapere se il vostro negozio aderisce a\r\nprogrammi di riciclo di dispositivi elettronici o se offrite servizi di\r\nsmaltimento ecologico per apparecchiature obsolete.\r\n\r\nSe possibile, gradirei ricevere anche informazioni sui metodi di pagamento\r\naccettati (es. carte di credito, PayPal, finanziamenti) e se è possibile\r\nrichiedere un preventivo personalizzato per acquisti di grandi dimensioni.\r\n\r\nResto a disposizione per eventuali chiarimenti o per fornire ulteriori\r\ndettagli sulle mie esigenze. Vi ringrazio in anticipo per il tempo dedicato\r\nalla mia richiesta e attendo con interesse una vostra risposta.\r\n\r\nCordiali saluti,\r\n"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Email Summarization Chain": [
|
||||
{
|
||||
"json": {
|
||||
"response": {
|
||||
"text": "Davide contatta il negozio di tecnologia per richiedere informazioni in merito a: orari di apertura (compresi festivi e chiusure), assistenza tecnica (specificando dispositivi supportati come smartphone, computer, tablet), disponibilità di catalogo aggiornato/sito web, opzioni di consegna a domicilio o ritiro in negozio, sconti per studenti/aziende/clienti abituali, eventi/workshop tematici, programmi di riciclo/smaltimento ecologico, metodi di pagamento accettati (carte, PayPal, finanziamenti) e preventivi personalizzati per acquisti consistenti. Si rende disponibile per ulteriori chiarimenti e ringrazia per la risposta. (99 parole)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "eee08614-3096-477a-b462-859782a74188",
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"DeepSeek": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Review email",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Markdown": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Summarization Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"DeepSeek R1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Email Summarization Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Write email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Review email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Review email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Token Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI 4-o-mini": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Email Classifier",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Classifier": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Do nothing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI1": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Refresh collection": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Qdrant Vector Store1",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Qdrant Vector Store": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Write email",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Trigger (IMAP)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Markdown",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Summarization Chain": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Email Classifier",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Refresh collection",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,521 +0,0 @@
|
||||
{
|
||||
"id": "fqaNojXWrspqjfkY",
|
||||
"meta": {
|
||||
"instanceId": "69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d"
|
||||
},
|
||||
"name": "RAG Workflow For Stock Earnings Report Analysis",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "1a621f76-9636-430d-94dd-d5e7dcd5afdc",
|
||||
"name": "Pinecone Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
380,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "company-earnings",
|
||||
"cachedResultName": "company-earnings"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"pineconeApi": {
|
||||
"id": "bQTNry52ypGLqt47",
|
||||
"name": "PineconeApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5936e45-0f58-48e9-9ab4-cc69f2ef6578",
|
||||
"name": "Embeddings Google Gemini",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
|
||||
"position": [
|
||||
300,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"modelName": "models/text-embedding-004"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e98dbc8e-6b4a-415d-a044-85e590fcb105",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
520,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ae77f5f4-3704-4b66-9c3f-27d6bd3f68c3",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
560,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d939c9db-0edc-4205-b8e5-fb34b0076510",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
-120,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "4f8421b4-1a11-4ac3-a9ca-1d725a8ec98e",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-360,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c9e2ec39-c34d-4d8e-b772-d1c1cd823d9e",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-40,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Give me a report on Google's last 3 quarter earnings. Format it in markdown. Focus on the differences and trends. Spot any outliers.",
|
||||
"options": {
|
||||
"systemMessage": "You are a highly skilled financial analyst specializing in analyzing Google's (Alphabet Inc.) financial performance. You have access to two powerful tools:\n\n1. **Vector Store Tool:** This tool allows you to retrieve relevant information from the past three quarters of Google's earnings reports (PDF documents). The documents have been processed and stored as embeddings in a vector database, enabling semantic search. Use this tool to find specific information related to revenue, expenses, profits, losses, growth, key metrics, management commentary, and any other relevant financial data.\n2. **Google Docs Tool:** This tool allows you to create, edit, and format Google Docs. Use this tool to save your findings into a Google Doc.\n\nYour task is to answer user queries related to Google's financial performance based on the last three quarters' earnings reports. When a user asks a question:\n\n1. **Understand the User's Intent:** Carefully analyze the user's query to determine what specific financial information they are seeking. Identify keywords, timeframes (e.g., \"previous quarter\"), and the type of analysis requested (e.g., trend analysis, comparison, explanation).\n2. **Retrieve Relevant Information:** Use the Vector Store Tool to search for and retrieve the most relevant text passages from the earnings reports that address the user's query. Retrieve multiple, diverse chunks to ensure comprehensive coverage.\n3. **Synthesize and Analyze:** Analyze the information from the retrieved text chunks. Identify key trends, patterns, and insights related to the user's query.\n4. **Generate Report in Google Docs:** Use the Google Docs Tool to create a new Google Doc (or append to an existing one, if specified by the user). Structure the report with clear headings, bullet points, and concise paragraphs. Include the following in your report as appropriate:\n * **Executive Summary:** A brief overview of the key findings.\n * **Revenue Analysis:** Report on revenue figures, growth rates, and key revenue drivers.\n * **Expense Analysis:** Report on major expense categories and their impact on profitability.\n * **Profitability Analysis:** Discuss net income, profit margins, and earnings per share (EPS).\n * **Key Metrics:** Include other relevant financial metrics mentioned in the reports (e.g., operating income, cash flow, segment performance).\n * **Management Commentary:** Summarize any relevant insights or explanations provided by Google's management in the earnings calls or reports.\n * **Trend Analysis:** Compare the current quarter's performance to the previous two quarters, highlighting significant changes or trends.\n * **Visualizations:** If possible, use the Google Docs tool to insert basic charts or tables to visually represent the data. (You might need to guide the user on how to do this if the tool has limitations.)\n5. **Cite Sources:** Clearly indicate the source of your information (e.g., \"Q2 2023 Earnings Report\") for each data point or analysis.\n6. **Maintain a Professional Tone:** Write in a clear, concise, and objective tone, as expected of a financial analyst. Avoid speculation or making unsubstantiated claims.\n\nYour ultimate goal is to provide the user with a well-structured, informative, and accurate financial report based on the data available in the last three quarters of Google's earnings reports.\nSave the report in as a Google Doc using the available tool!"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "40534b4d-3061-4054-8c0a-b08fe32deaf7",
|
||||
"name": "Vector Store Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
360,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"name": "company_financial_earnings_data_tool",
|
||||
"description": "Retrieve information about the last 3 quarters of Google Earnings"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c584d5f6-1fac-420f-a28d-71f51b555e67",
|
||||
"name": "Google Gemini Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
620,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-2.0-flash-exp"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4f993d0-c80a-4f26-bc51-fe7df1012606",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-160,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tQLWnWRzD8aebYvp",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "4aa3726e-a105-4bfe-b1df-06c3c9ece18a",
|
||||
"name": "Pinecone Vector Store (Retrieval)",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
260,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "company-earnings",
|
||||
"cachedResultName": "company-earnings"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"pineconeApi": {
|
||||
"id": "bQTNry52ypGLqt47",
|
||||
"name": "PineconeApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e08dd92a-a7a1-4204-bef9-54611a2dee92",
|
||||
"name": "Save Report to Google Docs",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
460,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "={{ $json.output }}",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "1aOUl-mnCaI4__tULmBZSvWlOQhTHdD-RUPesP7_sFT4"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "nnE7RqZglLn8XarL",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "1984765a-3148-4bcf-9d20-fe29291fda6d",
|
||||
"name": "Embeddings Google Gemini (retrieval)",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
|
||||
"position": [
|
||||
240,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"modelName": "models/text-embedding-004"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9b0bff2e-06f4-4c89-b9dc-c54cfb79577c",
|
||||
"name": "List Of Files To Load (Google Sheets)",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
-380,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": 1476836405,
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs/edit#gid=1476836405",
|
||||
"cachedResultName": "GOOG"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs/edit?usp=drivesdk",
|
||||
"cachedResultName": "Watchlist"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "sRJmS2k8zdqVjtJL",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "b0d58ce5-9ac0-4f0f-ac7c-d6cb27551d82",
|
||||
"name": "Download File From Google Drive",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
160,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $('List Of Files To Load (Google Sheets)').item.json['File URL'] }}"
|
||||
},
|
||||
"options": {
|
||||
"fileName": "={{ $('List Of Files To Load (Google Sheets)').item.json['10Q'] }}"
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "uixLsi5TmrfwXPeB",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "28817b3d-fb54-4dc2-83bc-3ac27320712b",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1100,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 500,
|
||||
"height": 740,
|
||||
"content": "## Set up steps\n1. Google Cloud Project & Vertex AI API:\n\t* Create a Google Cloud project.\n\t* Enable the Vertex AI API for your project.\n2. Google AI API key:\n\t* Obtain a Google AI API key from Google AI Studio.\n3. Pinecone account and API key:\n\t* Create a free account on the Pinecone website.\n\t* Obtain your API key from your Pinecone dashboard.\n\t* Create an index named company-earnings in your Pinecone project.\n4. Google Drive - download and save financial documents:\n\t* Go to a company you want to analize and download their quarterly earnings PDFs\n\t* Save the PDFs in Google Drive\n\t* Create a Google Sheet that stores a list of file URLs pointing to the PDFs you downloaded and saved to Google Drive\n5. Configure credentials in your n8n environment for:\n\t* Google Sheets OAuth2\n\t* Google Drive OAuth2\n\t* Google Docs OAuth2\n\t* Google Gemini(PaLM) Api (using your Google AI API key)\n\t* Pinecone API (using your Pinecone API key)\n6. Import and configure the workflow:\n\t* Import this workflow into your n8n instance.\n\t* Update the List Of Files To Load (Google Sheets) node to point to your Google Sheet.\n\t* Update the Download File From Google Drive to point to the column where the file URLs are\n\t* Update the Save Report to Google Docs node to point to your Google Doc where you want the report saved."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eecb1c25-c019-44e4-b254-a919f80faee7",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
-260
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Loading data to Pinecone vector store"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8371f7f8-29a7-4711-b635-d5538f3441b8",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-40,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## AI Agent Report Generation using RAG"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"AI Agent": [
|
||||
{
|
||||
"json": {
|
||||
"output": "# Google (Alphabet Inc.) Financial Report: Last 3 Quarters\n\n## Executive Summary\nGoogle has demonstrated solid revenue growth across the last three quarters, although there are notable fluctuations in operating income, net income, and other income/expense categories. While revenue from both Google Services and Cloud shows consistent year-over-year growth, the operating margins have shown variability. \n\n## Revenue Analysis\n- **Quarter 1:**\n - **Revenue:** $80.5 billion, a 15% year-over-year increase.\n - **Google Services Revenue:** Up $8.4 billion (14%).\n - **Google Cloud Revenue:** Up $2.1 billion (28%).\n\n- **Quarter 2:**\n - **Revenue:** $84.7 billion, a 14% year-over-year increase.\n - **Google Services Revenue:** Up $7.6 billion (12%).\n - **Google Cloud Revenue:** Up $2.3 billion (29%).\n\n- **Quarter 3:**\n - **Revenue:** $88.3 billion, a 15% year-over-year increase.\n - **Google Services Revenue:** Up $8.5 billion (13%).\n - **Google Cloud Revenue:** Up $2.9 billion (35%).\n\n### Key Trends\n- Consistent revenue growth across all three quarters.\n- Strong growth in Google Cloud, indicating it is a significant area of expansion.\n\n## Expense Analysis\n- **Cost of Revenue:**\n - **Quarter 1:** $33.7 billion (up 10% year-over-year).\n - Reason for increase: Higher total acquisition costs, content acquisition costs, and depreciation.\n\n- **Operating Income:**\n - **Quarter 1:** $17.415 billion (25% operating margin).\n - **Quarter 2:** $21.838 billion (29% operating margin).\n - **Quarter 3:** $21.343 billion (28% operating margin).\n\n### Observations\n- Operating margins have fluctuated, while overall costs have continued to rise.\n \n## Profitability Analysis\n- **Net Income:**\n - **Quarter 1:** $15.051 billion.\n - **Quarter 2:** $18.368 billion.\n - **Quarter 3:** $19.689 billion.\n \n- **Diluted EPS:**\n - **Quarter 1:** $1.17.\n - **Quarter 2:** $1.44.\n - **Quarter 3:** $1.55.\n\n### Summary\nWhile net income has increased, the fluctuations in other income and expense metrics have affected profitability.\n\n## Key Metrics\n- **Operating Margins:**\n - Q1: 25%\n - Q2: 29%\n - Q3: 28%\n\n- **Other Income (Expense), Net:**\n - Q1: $790 million.\n - Q2: $65 million.\n - Q3: -$146 million. (Downturn to a negative number)\n\n## Management Commentary\nManagement has pointed out that increased revenue performance in Google Cloud is encouraging, especially given the challenges in the overall economic environment.\n\n## Trend Analysis\n- **Comparative Performance:**\n - Revenue trends show consistency, ranging from 14%-15% growth year-over-year.\n - Operating income showed a decreasing trend from Q1 ($17.415 billion) to Q2 ($21.838 billion) and slightly decreased again in Q3 ($21.343 billion).\n \n### Noteworthy Observations\n- **Outliers:**\n - Significant volatility in other income/expense net, transitioning from $790 million in Q1 to a loss of $146 million in Q3.\n \n- **Operating Margins:** \n - Variability seen in margins from Q1 (25%) to Q2 (29%) and back down to Q3 (28%) shows a trend of volatility.\n\n## Conclusion\nGoogle has maintained a strong financial position characterized by solid revenue growth. However, the apparent volatility in other income/expense and operating margins warrants closer scrutiny, as it could impact future profitability. The continuous growth in Google Cloud is a positive indicator and suggests strong potential for the coming quarters.\n\n---\n\nThis report provides a comprehensive overview of Google's financial performance over the past three quarters, highlighting key metrics, trends, and outliers. If you require further details or specific analysis, please let me know!"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "30c9a6f0-8ace-40c3-8ca7-a79fd91c12a7",
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save Report to Google Docs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
[],
|
||||
[
|
||||
{
|
||||
"node": "Download File From Google Drive",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinecone Vector Store": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings Google Gemini": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download File From Google Drive": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinecone Vector Store (Retrieval)": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings Google Gemini (retrieval)": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store (Retrieval)",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"List Of Files To Load (Google Sheets)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,521 @@
|
||||
{
|
||||
"id": "fqaNojXWrspqjfkY",
|
||||
"meta": {
|
||||
"instanceId": "69133932b9ba8e1ef14816d0b63297bb44feb97c19f759b5d153ff6b0c59e18d"
|
||||
},
|
||||
"name": "RAG Workflow For Stock Earnings Report Analysis",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "1a621f76-9636-430d-94dd-d5e7dcd5afdc",
|
||||
"name": "Pinecone Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
380,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "company-earnings",
|
||||
"cachedResultName": "company-earnings"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"pineconeApi": {
|
||||
"id": "bQTNry52ypGLqt47",
|
||||
"name": "PineconeApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e5936e45-0f58-48e9-9ab4-cc69f2ef6578",
|
||||
"name": "Embeddings Google Gemini",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
|
||||
"position": [
|
||||
300,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"modelName": "models/text-embedding-004"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e98dbc8e-6b4a-415d-a044-85e590fcb105",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
520,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ae77f5f4-3704-4b66-9c3f-27d6bd3f68c3",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
560,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d939c9db-0edc-4205-b8e5-fb34b0076510",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
-120,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "4f8421b4-1a11-4ac3-a9ca-1d725a8ec98e",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-360,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c9e2ec39-c34d-4d8e-b772-d1c1cd823d9e",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-40,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Give me a report on Google's last 3 quarter earnings. Format it in markdown. Focus on the differences and trends. Spot any outliers.",
|
||||
"options": {
|
||||
"systemMessage": "You are a highly skilled financial analyst specializing in analyzing Google's (Alphabet Inc.) financial performance. You have access to two powerful tools:\n\n1. **Vector Store Tool:** This tool allows you to retrieve relevant information from the past three quarters of Google's earnings reports (PDF documents). The documents have been processed and stored as embeddings in a vector database, enabling semantic search. Use this tool to find specific information related to revenue, expenses, profits, losses, growth, key metrics, management commentary, and any other relevant financial data.\n2. **Google Docs Tool:** This tool allows you to create, edit, and format Google Docs. Use this tool to save your findings into a Google Doc.\n\nYour task is to answer user queries related to Google's financial performance based on the last three quarters' earnings reports. When a user asks a question:\n\n1. **Understand the User's Intent:** Carefully analyze the user's query to determine what specific financial information they are seeking. Identify keywords, timeframes (e.g., \"previous quarter\"), and the type of analysis requested (e.g., trend analysis, comparison, explanation).\n2. **Retrieve Relevant Information:** Use the Vector Store Tool to search for and retrieve the most relevant text passages from the earnings reports that address the user's query. Retrieve multiple, diverse chunks to ensure comprehensive coverage.\n3. **Synthesize and Analyze:** Analyze the information from the retrieved text chunks. Identify key trends, patterns, and insights related to the user's query.\n4. **Generate Report in Google Docs:** Use the Google Docs Tool to create a new Google Doc (or append to an existing one, if specified by the user). Structure the report with clear headings, bullet points, and concise paragraphs. Include the following in your report as appropriate:\n * **Executive Summary:** A brief overview of the key findings.\n * **Revenue Analysis:** Report on revenue figures, growth rates, and key revenue drivers.\n * **Expense Analysis:** Report on major expense categories and their impact on profitability.\n * **Profitability Analysis:** Discuss net income, profit margins, and earnings per share (EPS).\n * **Key Metrics:** Include other relevant financial metrics mentioned in the reports (e.g., operating income, cash flow, segment performance).\n * **Management Commentary:** Summarize any relevant insights or explanations provided by Google's management in the earnings calls or reports.\n * **Trend Analysis:** Compare the current quarter's performance to the previous two quarters, highlighting significant changes or trends.\n * **Visualizations:** If possible, use the Google Docs tool to insert basic charts or tables to visually represent the data. (You might need to guide the user on how to do this if the tool has limitations.)\n5. **Cite Sources:** Clearly indicate the source of your information (e.g., \"Q2 2023 Earnings Report\") for each data point or analysis.\n6. **Maintain a Professional Tone:** Write in a clear, concise, and objective tone, as expected of a financial analyst. Avoid speculation or making unsubstantiated claims.\n\nYour ultimate goal is to provide the user with a well-structured, informative, and accurate financial report based on the data available in the last three quarters of Google's earnings reports.\nSave the report in as a Google Doc using the available tool!"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "40534b4d-3061-4054-8c0a-b08fe32deaf7",
|
||||
"name": "Vector Store Tool",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
|
||||
"position": [
|
||||
360,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"name": "company_financial_earnings_data_tool",
|
||||
"description": "Retrieve information about the last 3 quarters of Google Earnings"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c584d5f6-1fac-420f-a28d-71f51b555e67",
|
||||
"name": "Google Gemini Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
620,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-2.0-flash-exp"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f4f993d0-c80a-4f26-bc51-fe7df1012606",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-160,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tQLWnWRzD8aebYvp",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "4aa3726e-a105-4bfe-b1df-06c3c9ece18a",
|
||||
"name": "Pinecone Vector Store (Retrieval)",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
260,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "company-earnings",
|
||||
"cachedResultName": "company-earnings"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"pineconeApi": {
|
||||
"id": "bQTNry52ypGLqt47",
|
||||
"name": "PineconeApi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e08dd92a-a7a1-4204-bef9-54611a2dee92",
|
||||
"name": "Save Report to Google Docs",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
460,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "={{ $json.output }}",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "1aOUl-mnCaI4__tULmBZSvWlOQhTHdD-RUPesP7_sFT4"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "nnE7RqZglLn8XarL",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "1984765a-3148-4bcf-9d20-fe29291fda6d",
|
||||
"name": "Embeddings Google Gemini (retrieval)",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
|
||||
"position": [
|
||||
240,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"modelName": "models/text-embedding-004"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "jLOqyTR4yTT1nYKi",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9b0bff2e-06f4-4c89-b9dc-c54cfb79577c",
|
||||
"name": "List Of Files To Load (Google Sheets)",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
-380,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": 1476836405,
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs/edit#gid=1476836405",
|
||||
"cachedResultName": "GOOG"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ckP-ZgAMs2l2sFUpLAXx-gWNOQrHXoAs48Vo271X3rs/edit?usp=drivesdk",
|
||||
"cachedResultName": "Watchlist"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "sRJmS2k8zdqVjtJL",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "b0d58ce5-9ac0-4f0f-ac7c-d6cb27551d82",
|
||||
"name": "Download File From Google Drive",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
160,
|
||||
-60
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $('List Of Files To Load (Google Sheets)').item.json['File URL'] }}"
|
||||
},
|
||||
"options": {
|
||||
"fileName": "={{ $('List Of Files To Load (Google Sheets)').item.json['10Q'] }}"
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "uixLsi5TmrfwXPeB",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "28817b3d-fb54-4dc2-83bc-3ac27320712b",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1100,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 500,
|
||||
"height": 740,
|
||||
"content": "## Set up steps\n1. Google Cloud Project & Vertex AI API:\n\t* Create a Google Cloud project.\n\t* Enable the Vertex AI API for your project.\n2. Google AI API key:\n\t* Obtain a Google AI API key from Google AI Studio.\n3. Pinecone account and API key:\n\t* Create a free account on the Pinecone website.\n\t* Obtain your API key from your Pinecone dashboard.\n\t* Create an index named company-earnings in your Pinecone project.\n4. Google Drive - download and save financial documents:\n\t* Go to a company you want to analize and download their quarterly earnings PDFs\n\t* Save the PDFs in Google Drive\n\t* Create a Google Sheet that stores a list of file URLs pointing to the PDFs you downloaded and saved to Google Drive\n5. Configure credentials in your n8n environment for:\n\t* Google Sheets OAuth2\n\t* Google Drive OAuth2\n\t* Google Docs OAuth2\n\t* Google Gemini(PaLM) Api (using your Google AI API key)\n\t* Pinecone API (using your Pinecone API key)\n6. Import and configure the workflow:\n\t* Import this workflow into your n8n instance.\n\t* Update the List Of Files To Load (Google Sheets) node to point to your Google Sheet.\n\t* Update the Download File From Google Drive to point to the column where the file URLs are\n\t* Update the Save Report to Google Docs node to point to your Google Doc where you want the report saved."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eecb1c25-c019-44e4-b254-a919f80faee7",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
-260
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## Loading data to Pinecone vector store"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8371f7f8-29a7-4711-b635-d5538f3441b8",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-40,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"content": "## AI Agent Report Generation using RAG"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {
|
||||
"AI Agent": [
|
||||
{
|
||||
"json": {
|
||||
"output": "# Google (Alphabet Inc.) Financial Report: Last 3 Quarters\n\n## Executive Summary\nGoogle has demonstrated solid revenue growth across the last three quarters, although there are notable fluctuations in operating income, net income, and other income/expense categories. While revenue from both Google Services and Cloud shows consistent year-over-year growth, the operating margins have shown variability. \n\n## Revenue Analysis\n- **Quarter 1:**\n - **Revenue:** $80.5 billion, a 15% year-over-year increase.\n - **Google Services Revenue:** Up $8.4 billion (14%).\n - **Google Cloud Revenue:** Up $2.1 billion (28%).\n\n- **Quarter 2:**\n - **Revenue:** $84.7 billion, a 14% year-over-year increase.\n - **Google Services Revenue:** Up $7.6 billion (12%).\n - **Google Cloud Revenue:** Up $2.3 billion (29%).\n\n- **Quarter 3:**\n - **Revenue:** $88.3 billion, a 15% year-over-year increase.\n - **Google Services Revenue:** Up $8.5 billion (13%).\n - **Google Cloud Revenue:** Up $2.9 billion (35%).\n\n### Key Trends\n- Consistent revenue growth across all three quarters.\n- Strong growth in Google Cloud, indicating it is a significant area of expansion.\n\n## Expense Analysis\n- **Cost of Revenue:**\n - **Quarter 1:** $33.7 billion (up 10% year-over-year).\n - Reason for increase: Higher total acquisition costs, content acquisition costs, and depreciation.\n\n- **Operating Income:**\n - **Quarter 1:** $17.415 billion (25% operating margin).\n - **Quarter 2:** $21.838 billion (29% operating margin).\n - **Quarter 3:** $21.343 billion (28% operating margin).\n\n### Observations\n- Operating margins have fluctuated, while overall costs have continued to rise.\n \n## Profitability Analysis\n- **Net Income:**\n - **Quarter 1:** $15.051 billion.\n - **Quarter 2:** $18.368 billion.\n - **Quarter 3:** $19.689 billion.\n \n- **Diluted EPS:**\n - **Quarter 1:** $1.17.\n - **Quarter 2:** $1.44.\n - **Quarter 3:** $1.55.\n\n### Summary\nWhile net income has increased, the fluctuations in other income and expense metrics have affected profitability.\n\n## Key Metrics\n- **Operating Margins:**\n - Q1: 25%\n - Q2: 29%\n - Q3: 28%\n\n- **Other Income (Expense), Net:**\n - Q1: $790 million.\n - Q2: $65 million.\n - Q3: -$146 million. (Downturn to a negative number)\n\n## Management Commentary\nManagement has pointed out that increased revenue performance in Google Cloud is encouraging, especially given the challenges in the overall economic environment.\n\n## Trend Analysis\n- **Comparative Performance:**\n - Revenue trends show consistency, ranging from 14%-15% growth year-over-year.\n - Operating income showed a decreasing trend from Q1 ($17.415 billion) to Q2 ($21.838 billion) and slightly decreased again in Q3 ($21.343 billion).\n \n### Noteworthy Observations\n- **Outliers:**\n - Significant volatility in other income/expense net, transitioning from $790 million in Q1 to a loss of $146 million in Q3.\n \n- **Operating Margins:** \n - Variability seen in margins from Q1 (25%) to Q2 (29%) and back down to Q3 (28%) shows a trend of volatility.\n\n## Conclusion\nGoogle has maintained a strong financial position characterized by solid revenue growth. However, the apparent volatility in other income/expense and operating margins warrants closer scrutiny, as it could impact future profitability. The continuous growth in Google Cloud is a positive indicator and suggests strong potential for the coming quarters.\n\n---\n\nThis report provides a comprehensive overview of Google's financial performance over the past three quarters, highlighting key metrics, trends, and outliers. If you require further details or specific analysis, please let me know!"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "30c9a6f0-8ace-40c3-8ca7-a79fd91c12a7",
|
||||
"connections": {
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save Report to Google Docs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
[],
|
||||
[
|
||||
{
|
||||
"node": "Download File From Google Drive",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Tool": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinecone Vector Store": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings Google Gemini": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download File From Google Drive": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Pinecone Vector Store (Retrieval)": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Tool",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings Google Gemini (retrieval)": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Pinecone Vector Store (Retrieval)",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"List Of Files To Load (Google Sheets)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1115
OpenAI_and_LLMs/AI-Powered Social Media Amplifier.txt
Normal file
1115
OpenAI_and_LLMs/AI-Powered Social Media Amplifier.txt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1087
OpenAI_and_LLMs/AI-powered WooCommerce Support-Agent.txt
Normal file
1087
OpenAI_and_LLMs/AI-powered WooCommerce Support-Agent.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,174 +0,0 @@
|
||||
{
|
||||
"id": "mjCQV12PbF6fw8hR",
|
||||
"meta": {
|
||||
"instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff"
|
||||
},
|
||||
"name": "LangChain - Example - Workflow Retriever",
|
||||
"tags": [
|
||||
{
|
||||
"id": "snf16n0p2UrGP838",
|
||||
"name": "LangChain - Example",
|
||||
"createdAt": "2023-09-25T16:21:55.962Z",
|
||||
"updatedAt": "2023-09-25T16:21:55.962Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "efdc3050-6c68-4419-9f12-f37d6fefb276",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
460,
|
||||
200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e0edb9ab-c59f-4d34-983d-861bb2df4f01",
|
||||
"name": "Workflow Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"workflowId": "QacfBRBnf1xOyckC"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ba47dd13-67d0-499a-b9a2-16928099efce",
|
||||
"name": "Retrieval QA Chain2",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
900,
|
||||
200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f6d16571-0573-4860-aed9-611f93b050ad",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
800,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4fd00751-3db0-489b-8c7f-4ee0fb32fb51",
|
||||
"name": "Example Prompt",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
680,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "input",
|
||||
"stringValue": "What notes can you find for Jay Gatsby and what is his email address?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "732b6277-cb4d-4586-ab95-778ac9473fe5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"width": 363,
|
||||
"height": 211.90203341144422,
|
||||
"content": "### Q&A on data returned from a workflow"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f09583a3-78e3-4888-8251-2148ffb7ab18",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"width": 262.67019427016413,
|
||||
"height": 255.8330939602389,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nReplace \"Workflow ID\" with the ID the Subworkflow got saved as"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "48d3bdae-4cec-4b18-b92a-89215def0c68",
|
||||
"connections": {
|
||||
"Example Prompt": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Workflow Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Example Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"id": "mjCQV12PbF6fw8hR",
|
||||
"meta": {
|
||||
"instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff"
|
||||
},
|
||||
"name": "LangChain - Example - Workflow Retriever",
|
||||
"tags": [
|
||||
{
|
||||
"id": "snf16n0p2UrGP838",
|
||||
"name": "LangChain - Example",
|
||||
"createdAt": "2023-09-25T16:21:55.962Z",
|
||||
"updatedAt": "2023-09-25T16:21:55.962Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "efdc3050-6c68-4419-9f12-f37d6fefb276",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
460,
|
||||
200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e0edb9ab-c59f-4d34-983d-861bb2df4f01",
|
||||
"name": "Workflow Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"workflowId": "QacfBRBnf1xOyckC"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ba47dd13-67d0-499a-b9a2-16928099efce",
|
||||
"name": "Retrieval QA Chain2",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
900,
|
||||
200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f6d16571-0573-4860-aed9-611f93b050ad",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
800,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4fd00751-3db0-489b-8c7f-4ee0fb32fb51",
|
||||
"name": "Example Prompt",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
680,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "input",
|
||||
"stringValue": "What notes can you find for Jay Gatsby and what is his email address?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "732b6277-cb4d-4586-ab95-778ac9473fe5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
860,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"width": 363,
|
||||
"height": 211.90203341144422,
|
||||
"content": "### Q&A on data returned from a workflow"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f09583a3-78e3-4888-8251-2148ffb7ab18",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"width": 262.67019427016413,
|
||||
"height": 255.8330939602389,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nReplace \"Workflow ID\" with the ID the Subworkflow got saved as"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "48d3bdae-4cec-4b18-b92a-89215def0c68",
|
||||
"connections": {
|
||||
"Example Prompt": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Workflow Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Retrieval QA Chain2",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Example Prompt",
|
||||
"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
@@ -1,762 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "bec5c6c1-52d4-4665-b814-56a6bb82ea6b",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
800,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"temperature": 0
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d3e057d1-df44-4ac3-ac46-fc2b04e3de78",
|
||||
"name": "Get Meeting ConferenceRecords",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
20,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://meet.googleapis.com/v2/conferenceRecords",
|
||||
"options": {},
|
||||
"sendQuery": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "filter",
|
||||
"value": "=space.meeting_code={{ $json.conferenceData.conferenceId }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "googleOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"googleOAuth2Api": {
|
||||
"id": "kgVOfvlBIWTWXthG",
|
||||
"name": "Google Meets Oauth2 API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "831668fd-04ab-4144-bec0-c733902f2a13",
|
||||
"name": "Get Meeting Transcript Location",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
200,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://meet.googleapis.com/v2/{{ $json.conferenceRecords[0].name }}/transcripts",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "googleOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"googleOAuth2Api": {
|
||||
"id": "kgVOfvlBIWTWXthG",
|
||||
"name": "Google Meets Oauth2 API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "0a1c3386-1456-4abd-a67c-4f2084efb1f1",
|
||||
"name": "Get Transcript File",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
380,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $json.docsDestination.document }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "application/pdf"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "yOwz41gMQclOadgu",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "40d1e969-3a04-4fb0-98c3-59865f317e07",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-480,
|
||||
540
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d277cc0-9f51-43a2-9d17-17d535b4dd53",
|
||||
"name": "PDF Loader",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
660,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "08b2d0ce-0f59-45d8-b010-53910a1bc746",
|
||||
"name": "Get Calendar Event",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
-280,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"eventId": "abc123",
|
||||
"options": {},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"operation": "get"
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "35a68444-15da-4b6e-a3c8-d296971b0fc0",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"summary\": { \"type\": \"string\" },\n \"highlights\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"attendee\": { \"type\": \"string\" },\n \"message\": { \"type\": \"string\" }\n }\n }\n },\n \"next_steps\": {\n \"type\": \"array\",\n \"items:\": {\n \"type\": \"string\"\n }\n },\n \"meetings_created\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"event_title\": { \"type\": \"string\" },\n \"event_invite_url\": { \"type\" : \"string\" }\n }\n }\n }\n }\n}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "e73ab051-1763-4130-bf44-f1461886e5f4",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
640,
|
||||
1200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c940c9e1-8236-45b8-bdb2-39a326004680",
|
||||
"name": "Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "3c12dc11-0ff3-4c6a-9d67-1454d7b0d16d",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ JSON.stringify($('Create Calendar Event1').item.json) }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "daa3e96f-bcc1-4f99-a050-c09189041ce5",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
800,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "7263764b-8409-4cea-8db3-3278dd7ef9d8",
|
||||
"name": "=route",
|
||||
"type": "string",
|
||||
"value": "={{ $json.route }}"
|
||||
},
|
||||
{
|
||||
"id": "55c3b207-2e98-4137-8413-f72cbff17986",
|
||||
"name": "query",
|
||||
"type": "object",
|
||||
"value": "={{ $json.query.parseJson() }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "4e492c9f-6be3-4b7c-a8f7-e18dd94cd158",
|
||||
"name": "Fallback Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
960,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "{\n \"response\": {\n \"ok\": false,\n \"error\": \"The requested tool was not found or the service may be unavailable. Do not retry.\"\n }\n}\n"
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "7af68b6d-75ef-4332-8193-eb810179ec90",
|
||||
"name": "Actions Router",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
960,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "meetings.create",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.route }}",
|
||||
"rightValue": "meetings.create"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"fallbackOutput": "extra"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "8cc6b737-2867-4fca-93d1-8973f14a9f00",
|
||||
"name": "Get Attendees",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1440,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "521823f4-cee1-4f69-82e7-cea9be0dbc41",
|
||||
"name": "attendees",
|
||||
"type": "array",
|
||||
"value": "={{ $('Actions Router').item.json.query.attendees }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "1b3bb8f7-3775-48be-8b73-5c9f0db37ebf",
|
||||
"name": "Attendees List",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1444,
|
||||
1212
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "attendees"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c285a0fa-4b0b-4775-83bb-5acb597dd9a8",
|
||||
"name": "Add Attendee to Invite",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
1620,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"eventId": "={{ $('Create Calendar Event1').item.json.id }}",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"operation": "update",
|
||||
"updateFields": {
|
||||
"attendees": [
|
||||
"={{ $json.name }} <{{ $json.email }}>"
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "006c2b05-4526-4e7d-b303-0cd72b36b9e8",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1180,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 756.2929032891963,
|
||||
"height": 445.79624302689535,
|
||||
"content": "## 4. This Tool Creates Calendar Events\nThis tool, given event details and a list of attendees, will create a new Google calendar event and add the attendees to it."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "512dfd7d-ba06-48e5-b97f-3dfbbfb0023f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-56.39068896608171,
|
||||
391.01655789481134
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 586.8663941671947,
|
||||
"height": 405.6964113279832,
|
||||
"content": "## 1. Retrieve Meeting Transcript\n[Read more about working with HTTP node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nThere's no built-in support for Google Meets transcript API however, we can solve this problem with the HTTP node. Note you may also need to setup a separate Google OAuth API Credential to obtain the required scopes."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "91c5b898-b491-4359-90b4-2b7458cc03c8",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
323.25204909069373
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 681.4281346810014,
|
||||
"height": 588.2833041602365,
|
||||
"content": "## 2. Let AI Agent Carry Out Follow-Up Actions\n[Read more about working with AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)\n\nThe big difference between Basic LLM chains and AI Agents is that AI agents are given the automony to perform actions. Provided the right tool exists, AI Agents can send emails, book flights and even order pizza! Here we're leaving it up to our agent to book any follow-up meetings after the call and invite all interested parties."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7df4412d-b82b-4623-8ff5-89f3bd9356d8",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 591.4907024073684,
|
||||
"height": 579.2725119898125,
|
||||
"content": "## 3: Using the Custom Workflow Tool\n[Read more about Workflow Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger)\n\nOne common implementation of tool use is to set them up as workflows which are intended triggered via other workflows. With this, we can either build a tool per workflow or for efficiency, take an API approach where multiple tools can exist behind a router (in this case our \"switch\" node).\n\nOur AI agent will therefore only passing through the parameters of the request and won't have to learn/know how to intereact directly with the tools and services."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06b0b3ae-344a-4150-9fa1-bdbcfe80b000",
|
||||
"name": "Create Calendar Event1",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
1240,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"end": "={{ $json.query.end_date }} {{ $json.query.end_time }}",
|
||||
"start": "={{ $json.query.start_date }} {{ $json.query.start_time }}",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"additionalFields": {
|
||||
"summary": "={{ $json.query.title }}",
|
||||
"attendees": [],
|
||||
"description": "={{ $json.query.description }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "2e2eec66-a737-48b9-b1ab-264182163dae",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-940,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 359.6648027457353,
|
||||
"height": 385.336571355038,
|
||||
"content": "## Try It Out!\n### This workflow does the following:\n* Retrieves a meeting transcript\n* Sends transcript to an AI Agent to parse and carry out follow up actions if necessary.\n* If transcript mentions a follow up meeting is required, the AI Agent will call a tool to create the meeting.\n* Additionally if able, the AI Agent will also assign attendees it thinks should attend the meeting. \n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3833bb1c-1145-4abd-a371-bce4c0543fb6",
|
||||
"name": "Schedule Meeting",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
920,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"name": "create_calendar_event",
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "route",
|
||||
"stringValue": "meetings.create"
|
||||
}
|
||||
]
|
||||
},
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Call this tool to create an calendar event. This tool requires the following object request body.\n```\n{\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"start_date\": { \"type\": \"string\" },\n \"start_time\": { \"type\": \"string\" },\n \"end_date\": { \"type\": \"string\" },\n \"end_time\": { \"type\": \"string\" },\n \"attendees\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" }\n }\n }\n }\n }\n}\n```\nNote that dates are in the format yyyy-MM-dd and times are in the format HH:mm:ss."
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "ac955f91-9aa1-4ce8-9a5a-740c4d48dd18",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=system: your role is to help people get the most out of their meetings. You achieve this by helpfully summarising the meeting transcript to pull out useful information and key points of interest and delivery this in note form. You also help carry out any follow-up actions on behalf of the meeting attendees.\n1. Summarise the meeting and highlight any key goals of the meeting.\n2. Identify and list important points mentioned by each attendee. If non-applicable for an attendee, skip and proceed to the next attendee.\n3. Identify and list all next steps agreed by the attendees. If there are none, make a maximum of 3 suggestions based on the transcript instead. Please list the steps even if they've already been actioned.\n4. identify and perform follow-up actions based on a transcript of a meeting. These actions which are allowed are: creating follow-up calendar events if suggested by the attendees.\n\nThe meeting details were as follows:\n* The creator of the meeting was {{ $('Get Calendar Event').item.json[\"creator\"][\"displayName\"] }} <{{ $('Get Calendar Event').item.json[\"creator\"][\"email\"]}}>\n* The attendees were {{ $('Get Calendar Event').item.json[\"attendees\"].map(attendee => `${attendee.display_name} <${attendee.email}>`).join(', ') }}\n* The meeting was scheduled for {{ $('Get Calendar Event').item.json[\"start\"][\"dateTime\"] }}\n\nThe meeting transcript as follows:\n```\n{{ $json[\"text\"] }}\n```",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "b6d24f80-9f47-4c54-b84e-23d5de76f027",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
303.2560786071914
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 464.50696860436165,
|
||||
"height": 446.9122178333584,
|
||||
"content": "## 1. Get Calendar Event\n[Read more about working with Google Calendar](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlecalendar)\n\nIn this demo, we've decided to go with google meet as transcripts are stored in the user google drive. First, we'll need to get the calendar event of which the google meet was attached.\nIf the meet was not arranged through Google calendar, you may need to skip this step and just reference the transcripts in google drive directly."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b28e2c8f-7a4e-4ae8-b298-9a78747b81e5",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-320,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"width": 184.0677386144551,
|
||||
"height": 299.3566512487305,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Set your calendar event ID here."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5ffb49d4-6bfd-420e-9c0f-ed73a955bd46",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 349.91944442094535,
|
||||
"height": 80,
|
||||
"content": "### 💡 Can't find your transcript?\nOnly meetings which own and were recorded and had transcription enabled will be available.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "241ccec3-d8a0-4ca6-9267-31fe6f27aed6",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1200,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"width": 184.0677386144551,
|
||||
"height": 299.3566512487305,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Set your calendar ID here."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"PDF Loader": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Actions Router",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Attendees": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Attendees List",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Actions Router": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Calendar Event1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Fallback Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Attendees List": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Attendee to Invite",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Meeting": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Calendar Event": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Meeting ConferenceRecords",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Transcript File": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "PDF Loader",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Attendee to Invite": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Calendar Event1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Attendees",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Meeting ConferenceRecords": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Meeting Transcript Location",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Calendar Event",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Meeting Transcript Location": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Transcript File",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,762 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "bec5c6c1-52d4-4665-b814-56a6bb82ea6b",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
800,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"temperature": 0
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d3e057d1-df44-4ac3-ac46-fc2b04e3de78",
|
||||
"name": "Get Meeting ConferenceRecords",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
20,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://meet.googleapis.com/v2/conferenceRecords",
|
||||
"options": {},
|
||||
"sendQuery": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"queryParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "filter",
|
||||
"value": "=space.meeting_code={{ $json.conferenceData.conferenceId }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "googleOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"googleOAuth2Api": {
|
||||
"id": "kgVOfvlBIWTWXthG",
|
||||
"name": "Google Meets Oauth2 API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "831668fd-04ab-4144-bec0-c733902f2a13",
|
||||
"name": "Get Meeting Transcript Location",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
200,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://meet.googleapis.com/v2/{{ $json.conferenceRecords[0].name }}/transcripts",
|
||||
"options": {},
|
||||
"authentication": "predefinedCredentialType",
|
||||
"nodeCredentialType": "googleOAuth2Api"
|
||||
},
|
||||
"credentials": {
|
||||
"googleOAuth2Api": {
|
||||
"id": "kgVOfvlBIWTWXthG",
|
||||
"name": "Google Meets Oauth2 API"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "0a1c3386-1456-4abd-a67c-4f2084efb1f1",
|
||||
"name": "Get Transcript File",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
380,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $json.docsDestination.document }}"
|
||||
},
|
||||
"options": {
|
||||
"googleFileConversion": {
|
||||
"conversion": {
|
||||
"docsToFormat": "application/pdf"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "yOwz41gMQclOadgu",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "40d1e969-3a04-4fb0-98c3-59865f317e07",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-480,
|
||||
540
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d277cc0-9f51-43a2-9d17-17d535b4dd53",
|
||||
"name": "PDF Loader",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
660,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "08b2d0ce-0f59-45d8-b010-53910a1bc746",
|
||||
"name": "Get Calendar Event",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
-280,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"eventId": "abc123",
|
||||
"options": {},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"operation": "get"
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "35a68444-15da-4b6e-a3c8-d296971b0fc0",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"summary\": { \"type\": \"string\" },\n \"highlights\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"attendee\": { \"type\": \"string\" },\n \"message\": { \"type\": \"string\" }\n }\n }\n },\n \"next_steps\": {\n \"type\": \"array\",\n \"items:\": {\n \"type\": \"string\"\n }\n },\n \"meetings_created\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"event_title\": { \"type\": \"string\" },\n \"event_invite_url\": { \"type\" : \"string\" }\n }\n }\n }\n }\n}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "e73ab051-1763-4130-bf44-f1461886e5f4",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
640,
|
||||
1200
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c940c9e1-8236-45b8-bdb2-39a326004680",
|
||||
"name": "Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1780,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "3c12dc11-0ff3-4c6a-9d67-1454d7b0d16d",
|
||||
"name": "response",
|
||||
"type": "string",
|
||||
"value": "={{ JSON.stringify($('Create Calendar Event1').item.json) }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "daa3e96f-bcc1-4f99-a050-c09189041ce5",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
800,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "7263764b-8409-4cea-8db3-3278dd7ef9d8",
|
||||
"name": "=route",
|
||||
"type": "string",
|
||||
"value": "={{ $json.route }}"
|
||||
},
|
||||
{
|
||||
"id": "55c3b207-2e98-4137-8413-f72cbff17986",
|
||||
"name": "query",
|
||||
"type": "object",
|
||||
"value": "={{ $json.query.parseJson() }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "4e492c9f-6be3-4b7c-a8f7-e18dd94cd158",
|
||||
"name": "Fallback Response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
960,
|
||||
1340
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "{\n \"response\": {\n \"ok\": false,\n \"error\": \"The requested tool was not found or the service may be unavailable. Do not retry.\"\n }\n}\n"
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "7af68b6d-75ef-4332-8193-eb810179ec90",
|
||||
"name": "Actions Router",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"position": [
|
||||
960,
|
||||
1200
|
||||
],
|
||||
"parameters": {
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"outputKey": "meetings.create",
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.route }}",
|
||||
"rightValue": "meetings.create"
|
||||
}
|
||||
]
|
||||
},
|
||||
"renameOutput": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"fallbackOutput": "extra"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "8cc6b737-2867-4fca-93d1-8973f14a9f00",
|
||||
"name": "Get Attendees",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1440,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "521823f4-cee1-4f69-82e7-cea9be0dbc41",
|
||||
"name": "attendees",
|
||||
"type": "array",
|
||||
"value": "={{ $('Actions Router').item.json.query.attendees }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "1b3bb8f7-3775-48be-8b73-5c9f0db37ebf",
|
||||
"name": "Attendees List",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1444,
|
||||
1212
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "attendees"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c285a0fa-4b0b-4775-83bb-5acb597dd9a8",
|
||||
"name": "Add Attendee to Invite",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
1620,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"eventId": "={{ $('Create Calendar Event1').item.json.id }}",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"operation": "update",
|
||||
"updateFields": {
|
||||
"attendees": [
|
||||
"={{ $json.name }} <{{ $json.email }}>"
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "006c2b05-4526-4e7d-b303-0cd72b36b9e8",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1180,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 756.2929032891963,
|
||||
"height": 445.79624302689535,
|
||||
"content": "## 4. This Tool Creates Calendar Events\nThis tool, given event details and a list of attendees, will create a new Google calendar event and add the attendees to it."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "512dfd7d-ba06-48e5-b97f-3dfbbfb0023f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-56.39068896608171,
|
||||
391.01655789481134
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 586.8663941671947,
|
||||
"height": 405.6964113279832,
|
||||
"content": "## 1. Retrieve Meeting Transcript\n[Read more about working with HTTP node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nThere's no built-in support for Google Meets transcript API however, we can solve this problem with the HTTP node. Note you may also need to setup a separate Google OAuth API Credential to obtain the required scopes."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "91c5b898-b491-4359-90b4-2b7458cc03c8",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
323.25204909069373
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 681.4281346810014,
|
||||
"height": 588.2833041602365,
|
||||
"content": "## 2. Let AI Agent Carry Out Follow-Up Actions\n[Read more about working with AI Agents](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)\n\nThe big difference between Basic LLM chains and AI Agents is that AI agents are given the automony to perform actions. Provided the right tool exists, AI Agents can send emails, book flights and even order pizza! Here we're leaving it up to our agent to book any follow-up meetings after the call and invite all interested parties."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7df4412d-b82b-4623-8ff5-89f3bd9356d8",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
560,
|
||||
940
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 591.4907024073684,
|
||||
"height": 579.2725119898125,
|
||||
"content": "## 3: Using the Custom Workflow Tool\n[Read more about Workflow Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger)\n\nOne common implementation of tool use is to set them up as workflows which are intended triggered via other workflows. With this, we can either build a tool per workflow or for efficiency, take an API approach where multiple tools can exist behind a router (in this case our \"switch\" node).\n\nOur AI agent will therefore only passing through the parameters of the request and won't have to learn/know how to intereact directly with the tools and services."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06b0b3ae-344a-4150-9fa1-bdbcfe80b000",
|
||||
"name": "Create Calendar Event1",
|
||||
"type": "n8n-nodes-base.googleCalendar",
|
||||
"position": [
|
||||
1240,
|
||||
1080
|
||||
],
|
||||
"parameters": {
|
||||
"end": "={{ $json.query.end_date }} {{ $json.query.end_time }}",
|
||||
"start": "={{ $json.query.start_date }} {{ $json.query.start_time }}",
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "c_5792bdf04bc395cbcbc6f7b754268245a33779d36640cc80a357711aa2f09a0a@group.calendar.google.com",
|
||||
"cachedResultName": "n8n-events"
|
||||
},
|
||||
"additionalFields": {
|
||||
"summary": "={{ $json.query.title }}",
|
||||
"attendees": [],
|
||||
"description": "={{ $json.query.description }}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "kWMxmDbMDDJoYFVK",
|
||||
"name": "Google Calendar account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "2e2eec66-a737-48b9-b1ab-264182163dae",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-940,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 359.6648027457353,
|
||||
"height": 385.336571355038,
|
||||
"content": "## Try It Out!\n### This workflow does the following:\n* Retrieves a meeting transcript\n* Sends transcript to an AI Agent to parse and carry out follow up actions if necessary.\n* If transcript mentions a follow up meeting is required, the AI Agent will call a tool to create the meeting.\n* Additionally if able, the AI Agent will also assign attendees it thinks should attend the meeting. \n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3833bb1c-1145-4abd-a371-bce4c0543fb6",
|
||||
"name": "Schedule Meeting",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
920,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"name": "create_calendar_event",
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "route",
|
||||
"stringValue": "meetings.create"
|
||||
}
|
||||
]
|
||||
},
|
||||
"workflowId": "={{ $workflow.id }}",
|
||||
"description": "Call this tool to create an calendar event. This tool requires the following object request body.\n```\n{\n \"type\": \"object\",\n \"properties\": {\n \"title\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"start_date\": { \"type\": \"string\" },\n \"start_time\": { \"type\": \"string\" },\n \"end_date\": { \"type\": \"string\" },\n \"end_time\": { \"type\": \"string\" },\n \"attendees\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" }\n }\n }\n }\n }\n}\n```\nNote that dates are in the format yyyy-MM-dd and times are in the format HH:mm:ss."
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "ac955f91-9aa1-4ce8-9a5a-740c4d48dd18",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=system: your role is to help people get the most out of their meetings. You achieve this by helpfully summarising the meeting transcript to pull out useful information and key points of interest and delivery this in note form. You also help carry out any follow-up actions on behalf of the meeting attendees.\n1. Summarise the meeting and highlight any key goals of the meeting.\n2. Identify and list important points mentioned by each attendee. If non-applicable for an attendee, skip and proceed to the next attendee.\n3. Identify and list all next steps agreed by the attendees. If there are none, make a maximum of 3 suggestions based on the transcript instead. Please list the steps even if they've already been actioned.\n4. identify and perform follow-up actions based on a transcript of a meeting. These actions which are allowed are: creating follow-up calendar events if suggested by the attendees.\n\nThe meeting details were as follows:\n* The creator of the meeting was {{ $('Get Calendar Event').item.json[\"creator\"][\"displayName\"] }} <{{ $('Get Calendar Event').item.json[\"creator\"][\"email\"]}}>\n* The attendees were {{ $('Get Calendar Event').item.json[\"attendees\"].map(attendee => `${attendee.display_name} <${attendee.email}>`).join(', ') }}\n* The meeting was scheduled for {{ $('Get Calendar Event').item.json[\"start\"][\"dateTime\"] }}\n\nThe meeting transcript as follows:\n```\n{{ $json[\"text\"] }}\n```",
|
||||
"agent": "openAiFunctionsAgent",
|
||||
"options": {},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "b6d24f80-9f47-4c54-b84e-23d5de76f027",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-560,
|
||||
303.2560786071914
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 464.50696860436165,
|
||||
"height": 446.9122178333584,
|
||||
"content": "## 1. Get Calendar Event\n[Read more about working with Google Calendar](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlecalendar)\n\nIn this demo, we've decided to go with google meet as transcripts are stored in the user google drive. First, we'll need to get the calendar event of which the google meet was attached.\nIf the meet was not arranged through Google calendar, you may need to skip this step and just reference the transcripts in google drive directly."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b28e2c8f-7a4e-4ae8-b298-9a78747b81e5",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-320,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"width": 184.0677386144551,
|
||||
"height": 299.3566512487305,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Set your calendar event ID here."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5ffb49d4-6bfd-420e-9c0f-ed73a955bd46",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 349.91944442094535,
|
||||
"height": 80,
|
||||
"content": "### 💡 Can't find your transcript?\nOnly meetings which own and were recorded and had transcription enabled will be available.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "241ccec3-d8a0-4ca6-9267-31fe6f27aed6",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1200,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"width": 184.0677386144551,
|
||||
"height": 299.3566512487305,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Set your calendar ID here."
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"PDF Loader": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Actions Router",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Attendees": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Attendees List",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Actions Router": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create Calendar Event1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Fallback Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Attendees List": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Attendee to Invite",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule Meeting": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Calendar Event": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Meeting ConferenceRecords",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Transcript File": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "PDF Loader",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Attendee to Invite": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Calendar Event1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Attendees",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Meeting ConferenceRecords": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Meeting Transcript Location",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Calendar Event",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Meeting Transcript Location": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Transcript File",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,927 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "84ba6d895254e080ac2b4916d987aa66b000f88d4d919a6b9c76848f9b8a7616",
|
||||
"templateId": "2358"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "fb774d11-da48-4481-ad4e-8c93274f123e",
|
||||
"name": "Send message",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
2340,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Data from webhook: {{ $json.query.email }}",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "C079GL6K3U6",
|
||||
"cachedResultName": "general"
|
||||
},
|
||||
"otherOptions": {},
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "5a3ad8f1-eba7-4076-80fc-0c1237aab50b",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1163.3132111854613,
|
||||
"height": 677.0358687053997,
|
||||
"content": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "01c59396-0fef-4d1c-aa1f-787669300650",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1860,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 437,
|
||||
"height": 99,
|
||||
"content": "# What is n8n?\n### Low-code Automation Platform for technical teams"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0bdd4a35-7f5c-443c-a14a-4e6f7ed18712",
|
||||
"name": "Execute JavaScript",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
2340,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n}\n\nreturn $input.all();"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4b1b6cc1-1a9f-4a0c-96d5-fd179c84c79d",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
4440,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 318,
|
||||
"height": 106,
|
||||
"content": "# Example #2\n### RAG with PDF as source"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7e9e7802-5695-4240-83b9-d6f02192ad2b",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
5120,
|
||||
1000
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 3000,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "63783c21-af6d-4e70-8dec-c861641c53fb",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
4880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5742ce9c-2f73-4129-85eb-876f562cf6b1",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
5100,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "document-title",
|
||||
"value": "={{ $('PDFs to download').item.json.whitepaper_title }}"
|
||||
},
|
||||
{
|
||||
"name": "document-publish-year",
|
||||
"value": "={{ $('PDFs to download').item.json.publish_year }}"
|
||||
},
|
||||
{
|
||||
"name": "document-author",
|
||||
"value": "={{ $('PDFs to download').item.json.author }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "686c63fa-4672-4107-bd58-ffbb0650b44b",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
5840,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73a7df02-aa2c-4f0f-aa88-38cbbbf3b1cb",
|
||||
"name": "Embeddings OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
5980,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "42737305-fd39-4ec7-b4ba-53f70085dd5f",
|
||||
"name": "Vector Store Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
|
||||
"position": [
|
||||
6040,
|
||||
840
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2c7a3666-e123-439d-8b74-41eb375f066c",
|
||||
"name": "Download PDF",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
4700,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.file_url }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "866eaeb9-6a7c-4209-b485-8ef13ed006b4",
|
||||
"name": "PDFs to download",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"notes": "BTC Whitepaper + metadata",
|
||||
"position": [
|
||||
4440,
|
||||
600
|
||||
],
|
||||
"parameters": {},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e78f2191-096c-4575-9d48-fb891fd18698",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
4440,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 414.36616595939887,
|
||||
"height": 91.0723900084547,
|
||||
"content": "## A. Load PDF into Pinecone\nDownload the PDF, then text embeddings into Pincecone"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7c3ccf27-32b1-4ea7-b2ef-6997793de733",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
5600,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 284.62109466374466,
|
||||
"height": 86.95121951219511,
|
||||
"content": "## B. Chat with PDF\nUse GPT4o to chat with Pinecone index"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6063d009-da6e-4cbf-899f-c86b879931a7",
|
||||
"name": "Read Pinecone Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
5980,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"pineconeNamespace": "whitepaper"
|
||||
},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "whitepapers",
|
||||
"cachedResultName": "whitepapers"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8aa52156-264d-4911-993c-ac5117a76b21",
|
||||
"name": "Question and Answer Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
5840,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}. \nOnly use vector store knowledge to answer the question. Don't make anything up. If you don't know the answer, tell the user that you don't know.",
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "b394ee1d-a2ca-4db0-8caa-981f8f066787",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
7380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 504.25,
|
||||
"height": 106,
|
||||
"content": "# Example #3\n### AI Assistant that knows how to use predefined API endpoints "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "37a8b8f2-c444-4c6e-9b02-b97a5c616e84",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3020,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 318,
|
||||
"height": 111,
|
||||
"content": "# Example #1\n### Categorize incoming emails with AI"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "07123e8e-8760-4c89-acda-aaef6de68be2",
|
||||
"name": "Anthropic Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
|
||||
"position": [
|
||||
7580,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"temperature": 0.4
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "e338a175-e823-4cd4-b77d-f5acbfcbdb9d",
|
||||
"name": "Get calendar availability",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
7900,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/calendar/v3/freeBusy",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"timeMin\": \"{timeMin}\",\n \"timeMax\": \"{timeMax}\",\n \"timeZone\": \"Europe/Berlin\",\n \"groupExpansionMax\": 20,\n \"calendarExpansionMax\": 10,\n \"items\": [\n {\n \"id\": \"max@n8n.io\"\n }\n ]\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"toolDescription": "Call this tool to get the appointment availability for a particular period on the calendar. The tool may refer to availability as \"Free\" or \"Busy\". \n\nUse {timeMin} and {timeMax} to specify the window for the availability query. For example, to get availability for 25 July, 2024 the {timeMin} would be 2024-07-25T09:00:00+02:00 and {timeMax} would be 2024-07-25T17:00:00+02:00.\n\nIf the tool returns an empty response, it means that something went wrong. It does not mean that there is no availability.",
|
||||
"nodeCredentialType": "googleCalendarOAuth2Api"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ae05933c-dfa9-4272-b610-8b5fc94d76fe",
|
||||
"name": "Appointment booking agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
7680,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "=You are an efficient and courteous assistant tasked with scheduling appointments with Max Tkacz.\n\nWhen users mention an appointment or meeting, they are referring to a meeting with Max.\nWhen users refer to the calendar or \"your schedule,\" they are referring to Max's calendar. \n\nYou can use various tools to access and manage Max's calendar. Your primary goal is to assist users in successfully booking an appointment with Max, ensuring no scheduling conflicts. Only book an appointment if the requested time slot is available (the tool may refer to this as \"Free\")\n\nToday's date is {{ $today.format('dd LLL yyyy') }}.\nAppointments are always 30 minutes in length. \n\n\nProvide accurate information at all times. If the tools are not functioning correctly, inform the user that you are unable to assist them at the moment.\n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7e3b1797-150e-4c7c-93a5-306b981e0b6c",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
8300,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 327.46658341463433,
|
||||
"height": 571.8601927804875,
|
||||
"content": "\n[Open Calendar](https://calendar.google.com/calendar/u/0/r/day/2024/7/26)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "afe8d14d-d0d0-4a11-bb4f-57358de66bc1",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
7720,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 10
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "53d131ea-3235-4e4e-828b-dc22c9021e50",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
6380,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 615.2162978341456,
|
||||
"height": 403.1877919219511,
|
||||
"content": "\nBTC Whitepaper references"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "55a0f180-bb35-4b35-b72c-b9361698e5ad",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9660,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 345.33741540309194,
|
||||
"height": 398.9629539487597,
|
||||
"content": "### Connect with me or explore this demo 👇\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "14b3231d-aa96-4783-be8f-cb2f70b0bc7f",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 197.19036476628202,
|
||||
"content": "# Thank you and happy flowgramming 🤘\n\n### Max Tkacz | Senior Developer Advocate @ n8n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c9a2fcdc-c8ab-4b9d-9979-4fd7cca1e8a8",
|
||||
"name": "Insert into Pinecone vector store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
4920,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {
|
||||
"clearNamespace": true,
|
||||
"pineconeNamespace": "whitepaper"
|
||||
},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "whitepapers",
|
||||
"cachedResultName": "whitepapers"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6a890c74-67f9-4eee-bb56-7c9a68921ae1",
|
||||
"name": "Book appointment",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
8060,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/calendar/v3/calendars/max@n8n.io/events",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"summary\": \"Appointment with {userName}\",\n \"start\": {\n \"dateTime\": \"{startTime}\",\n \"timeZone\": \"Europe/Berlin\"\n },\n \"end\": {\n \"dateTime\": \"{endTime}\",\n \"timeZone\": \"Europe/Berlin\"\n },\n \"attendees\": [\n {\"email\": \"max@n8n.io\"},\n {\"email\": \"{userEmail}\"}\n ]\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"toolDescription": "Call this tool to book an appointment in the calendar. ",
|
||||
"nodeCredentialType": "googleCalendarOAuth2Api",
|
||||
"placeholderDefinitions": {
|
||||
"values": [
|
||||
{
|
||||
"name": "userName",
|
||||
"description": "The full name of the user making the appointment. Like John Doe"
|
||||
},
|
||||
{
|
||||
"name": "startTime",
|
||||
"description": "The start time of the event in Europe/Berlin timezone. For example, 2024-07-24T10:00:00+02:00"
|
||||
},
|
||||
{
|
||||
"name": "endTime",
|
||||
"description": "The end time of the event in Europe/Berlin timezone. It should always be 30 minutes after the startTime. "
|
||||
},
|
||||
{
|
||||
"name": "userEmail",
|
||||
"description": "The email address of the user making the appointment"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7f6e62f2-2d72-4fd2-a6ef-e57028d0055b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
5600,
|
||||
620
|
||||
],
|
||||
"webhookId": "c348693e-9c43-4bf2-90a5-23786273e809",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {
|
||||
"title": "Book an appointment with Max"
|
||||
},
|
||||
"initialMessages": "Hi there! 👋\nI can help you schedule an appointment with Max Tkacz. On which day would you like to meet?"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "52c65975-479d-4c76-bcd3-23f5c9bb6acf",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 80,
|
||||
"content": "### Explore 100+ AI Workflow templates on n8n.io\n[Open Templates Library](https://n8n.io/workflows)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ba0635c0-2ca4-4b27-b960-3a0e0f93a56a",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 80,
|
||||
"content": "### Ask a question in our community (13k+ members)\n[Explore n8n community](https://community.n8n.io/)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "29227c52-a9cc-4bd1-b1a3-78fb805b659c",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
3260,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.5
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "494a2868-9ff5-402c-b83b-6dd2c3ddbcc9",
|
||||
"name": "Add automation label",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3760,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"labelIds": [
|
||||
"Label_4763053241338138112"
|
||||
],
|
||||
"messageId": "={{ $json.id }}",
|
||||
"operation": "addLabels"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "0f9d834d-ec47-43f5-945b-8c464d371122",
|
||||
"name": "On new email to nathan's inbox",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"disabled": true,
|
||||
"position": [
|
||||
3040,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "142e2a49-40bd-4bf5-9ba3-f14ecd68618e",
|
||||
"name": "Add music label",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3760,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"labelIds": [
|
||||
"Label_6822395192337188416"
|
||||
],
|
||||
"messageId": "={{ $json.id }}",
|
||||
"operation": "addLabels"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "2eb46753-a0e8-43ec-a460-466b1dd265c9",
|
||||
"name": "Assign label with AI",
|
||||
"type": "@n8n/n8n-nodes-langchain.textClassifier",
|
||||
"position": [
|
||||
3280,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"inputText": "={{ $json.text }}",
|
||||
"categories": {
|
||||
"categories": [
|
||||
{
|
||||
"category": "automation",
|
||||
"description": "email on the topic of automation or workflows and automated processes, includes newsletters on this topic"
|
||||
},
|
||||
{
|
||||
"category": "music",
|
||||
"description": "email on the topic of music, for example from an artist "
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "576d8206-1b1e-4671-ba45-86e9d844a73b",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1860,
|
||||
460
|
||||
],
|
||||
"webhookId": "74facfd7-0f51-4605-9724-2c300594fcf9",
|
||||
"parameters": {
|
||||
"path": "74facfd7-0f51-4605-9724-2c300594fcf9",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "1e612376-1a3b-4c48-9cd3-97867ba4cad5",
|
||||
"name": "Whether email contains n8n",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
2060,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "a0b16c44-03ea-4e96-9671-7b168697186d",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $json.query.email }}",
|
||||
"rightValue": "@n8n"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Whether email contains n8n",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download PDF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Book appointment": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"PDFs to download": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download PDF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI2": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Read Pinecone Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Assign label with AI",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Anthropic Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Assign label with AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add automation label",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Add music label",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get calendar availability": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read Pinecone Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Retriever",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Whether email contains n8n": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Execute JavaScript",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Send message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new email to nathan's inbox": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Assign label with AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,927 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "84ba6d895254e080ac2b4916d987aa66b000f88d4d919a6b9c76848f9b8a7616",
|
||||
"templateId": "2358"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "fb774d11-da48-4481-ad4e-8c93274f123e",
|
||||
"name": "Send message",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
2340,
|
||||
580
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Data from webhook: {{ $json.query.email }}",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "C079GL6K3U6",
|
||||
"cachedResultName": "general"
|
||||
},
|
||||
"otherOptions": {},
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "5a3ad8f1-eba7-4076-80fc-0c1237aab50b",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1163.3132111854613,
|
||||
"height": 677.0358687053997,
|
||||
"content": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "01c59396-0fef-4d1c-aa1f-787669300650",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1860,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 437,
|
||||
"height": 99,
|
||||
"content": "# What is n8n?\n### Low-code Automation Platform for technical teams"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0bdd4a35-7f5c-443c-a14a-4e6f7ed18712",
|
||||
"name": "Execute JavaScript",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
2340,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n item.json.myNewField = 1;\n}\n\nreturn $input.all();"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4b1b6cc1-1a9f-4a0c-96d5-fd179c84c79d",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
4440,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 318,
|
||||
"height": 106,
|
||||
"content": "# Example #2\n### RAG with PDF as source"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7e9e7802-5695-4240-83b9-d6f02192ad2b",
|
||||
"name": "Recursive Character Text Splitter",
|
||||
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
|
||||
"position": [
|
||||
5120,
|
||||
1000
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"chunkSize": 3000,
|
||||
"chunkOverlap": 200
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "63783c21-af6d-4e70-8dec-c861641c53fb",
|
||||
"name": "Embeddings OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
4880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5742ce9c-2f73-4129-85eb-876f562cf6b1",
|
||||
"name": "Default Data Loader",
|
||||
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
|
||||
"position": [
|
||||
5100,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"loader": "pdfLoader",
|
||||
"options": {
|
||||
"metadata": {
|
||||
"metadataValues": [
|
||||
{
|
||||
"name": "document-title",
|
||||
"value": "={{ $('PDFs to download').item.json.whitepaper_title }}"
|
||||
},
|
||||
{
|
||||
"name": "document-publish-year",
|
||||
"value": "={{ $('PDFs to download').item.json.publish_year }}"
|
||||
},
|
||||
{
|
||||
"name": "document-author",
|
||||
"value": "={{ $('PDFs to download').item.json.author }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"dataType": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "686c63fa-4672-4107-bd58-ffbb0650b44b",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
5840,
|
||||
840
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.3
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "73a7df02-aa2c-4f0f-aa88-38cbbbf3b1cb",
|
||||
"name": "Embeddings OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
|
||||
"position": [
|
||||
5980,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "42737305-fd39-4ec7-b4ba-53f70085dd5f",
|
||||
"name": "Vector Store Retriever",
|
||||
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
|
||||
"position": [
|
||||
6040,
|
||||
840
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2c7a3666-e123-439d-8b74-41eb375f066c",
|
||||
"name": "Download PDF",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
4700,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.file_url }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "866eaeb9-6a7c-4209-b485-8ef13ed006b4",
|
||||
"name": "PDFs to download",
|
||||
"type": "n8n-nodes-base.noOp",
|
||||
"notes": "BTC Whitepaper + metadata",
|
||||
"position": [
|
||||
4440,
|
||||
600
|
||||
],
|
||||
"parameters": {},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e78f2191-096c-4575-9d48-fb891fd18698",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
4440,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 414.36616595939887,
|
||||
"height": 91.0723900084547,
|
||||
"content": "## A. Load PDF into Pinecone\nDownload the PDF, then text embeddings into Pincecone"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7c3ccf27-32b1-4ea7-b2ef-6997793de733",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
5600,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 284.62109466374466,
|
||||
"height": 86.95121951219511,
|
||||
"content": "## B. Chat with PDF\nUse GPT4o to chat with Pinecone index"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6063d009-da6e-4cbf-899f-c86b879931a7",
|
||||
"name": "Read Pinecone Vector Store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
5980,
|
||||
980
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"pineconeNamespace": "whitepaper"
|
||||
},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "whitepapers",
|
||||
"cachedResultName": "whitepapers"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8aa52156-264d-4911-993c-ac5117a76b21",
|
||||
"name": "Question and Answer Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
|
||||
"position": [
|
||||
5840,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}. \nOnly use vector store knowledge to answer the question. Don't make anything up. If you don't know the answer, tell the user that you don't know.",
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "b394ee1d-a2ca-4db0-8caa-981f8f066787",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
7380,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 504.25,
|
||||
"height": 106,
|
||||
"content": "# Example #3\n### AI Assistant that knows how to use predefined API endpoints "
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "37a8b8f2-c444-4c6e-9b02-b97a5c616e84",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3020,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 318,
|
||||
"height": 111,
|
||||
"content": "# Example #1\n### Categorize incoming emails with AI"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "07123e8e-8760-4c89-acda-aaef6de68be2",
|
||||
"name": "Anthropic Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
|
||||
"position": [
|
||||
7580,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"temperature": 0.4
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "e338a175-e823-4cd4-b77d-f5acbfcbdb9d",
|
||||
"name": "Get calendar availability",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
7900,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/calendar/v3/freeBusy",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"timeMin\": \"{timeMin}\",\n \"timeMax\": \"{timeMax}\",\n \"timeZone\": \"Europe/Berlin\",\n \"groupExpansionMax\": 20,\n \"calendarExpansionMax\": 10,\n \"items\": [\n {\n \"id\": \"max@n8n.io\"\n }\n ]\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"toolDescription": "Call this tool to get the appointment availability for a particular period on the calendar. The tool may refer to availability as \"Free\" or \"Busy\". \n\nUse {timeMin} and {timeMax} to specify the window for the availability query. For example, to get availability for 25 July, 2024 the {timeMin} would be 2024-07-25T09:00:00+02:00 and {timeMax} would be 2024-07-25T17:00:00+02:00.\n\nIf the tool returns an empty response, it means that something went wrong. It does not mean that there is no availability.",
|
||||
"nodeCredentialType": "googleCalendarOAuth2Api"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ae05933c-dfa9-4272-b610-8b5fc94d76fe",
|
||||
"name": "Appointment booking agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
7680,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "=You are an efficient and courteous assistant tasked with scheduling appointments with Max Tkacz.\n\nWhen users mention an appointment or meeting, they are referring to a meeting with Max.\nWhen users refer to the calendar or \"your schedule,\" they are referring to Max's calendar. \n\nYou can use various tools to access and manage Max's calendar. Your primary goal is to assist users in successfully booking an appointment with Max, ensuring no scheduling conflicts. Only book an appointment if the requested time slot is available (the tool may refer to this as \"Free\")\n\nToday's date is {{ $today.format('dd LLL yyyy') }}.\nAppointments are always 30 minutes in length. \n\n\nProvide accurate information at all times. If the tools are not functioning correctly, inform the user that you are unable to assist them at the moment.\n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.6
|
||||
},
|
||||
{
|
||||
"id": "7e3b1797-150e-4c7c-93a5-306b981e0b6c",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
8300,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 327.46658341463433,
|
||||
"height": 571.8601927804875,
|
||||
"content": "\n[Open Calendar](https://calendar.google.com/calendar/u/0/r/day/2024/7/26)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "afe8d14d-d0d0-4a11-bb4f-57358de66bc1",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
7720,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"contextWindowLength": 10
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "53d131ea-3235-4e4e-828b-dc22c9021e50",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
6380,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 615.2162978341456,
|
||||
"height": 403.1877919219511,
|
||||
"content": "\nBTC Whitepaper references"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "55a0f180-bb35-4b35-b72c-b9361698e5ad",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9660,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 345.33741540309194,
|
||||
"height": 398.9629539487597,
|
||||
"content": "### Connect with me or explore this demo 👇\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "14b3231d-aa96-4783-be8f-cb2f70b0bc7f",
|
||||
"name": "Sticky Note10",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 197.19036476628202,
|
||||
"content": "# Thank you and happy flowgramming 🤘\n\n### Max Tkacz | Senior Developer Advocate @ n8n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c9a2fcdc-c8ab-4b9d-9979-4fd7cca1e8a8",
|
||||
"name": "Insert into Pinecone vector store",
|
||||
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
|
||||
"position": [
|
||||
4920,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"options": {
|
||||
"clearNamespace": true,
|
||||
"pineconeNamespace": "whitepaper"
|
||||
},
|
||||
"pineconeIndex": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "whitepapers",
|
||||
"cachedResultName": "whitepapers"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6a890c74-67f9-4eee-bb56-7c9a68921ae1",
|
||||
"name": "Book appointment",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
8060,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://www.googleapis.com/calendar/v3/calendars/max@n8n.io/events",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"summary\": \"Appointment with {userName}\",\n \"start\": {\n \"dateTime\": \"{startTime}\",\n \"timeZone\": \"Europe/Berlin\"\n },\n \"end\": {\n \"dateTime\": \"{endTime}\",\n \"timeZone\": \"Europe/Berlin\"\n },\n \"attendees\": [\n {\"email\": \"max@n8n.io\"},\n {\"email\": \"{userEmail}\"}\n ]\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"toolDescription": "Call this tool to book an appointment in the calendar. ",
|
||||
"nodeCredentialType": "googleCalendarOAuth2Api",
|
||||
"placeholderDefinitions": {
|
||||
"values": [
|
||||
{
|
||||
"name": "userName",
|
||||
"description": "The full name of the user making the appointment. Like John Doe"
|
||||
},
|
||||
{
|
||||
"name": "startTime",
|
||||
"description": "The start time of the event in Europe/Berlin timezone. For example, 2024-07-24T10:00:00+02:00"
|
||||
},
|
||||
{
|
||||
"name": "endTime",
|
||||
"description": "The end time of the event in Europe/Berlin timezone. It should always be 30 minutes after the startTime. "
|
||||
},
|
||||
{
|
||||
"name": "userEmail",
|
||||
"description": "The email address of the user making the appointment"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7f6e62f2-2d72-4fd2-a6ef-e57028d0055b",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
5600,
|
||||
620
|
||||
],
|
||||
"webhookId": "c348693e-9c43-4bf2-90a5-23786273e809",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {
|
||||
"title": "Book an appointment with Max"
|
||||
},
|
||||
"initialMessages": "Hi there! 👋\nI can help you schedule an appointment with Max Tkacz. On which day would you like to meet?"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "52c65975-479d-4c76-bcd3-23f5c9bb6acf",
|
||||
"name": "Sticky Note11",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 80,
|
||||
"content": "### Explore 100+ AI Workflow templates on n8n.io\n[Open Templates Library](https://n8n.io/workflows)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ba0635c0-2ca4-4b27-b960-3a0e0f93a56a",
|
||||
"name": "Sticky Note12",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
9220,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 411.2946586626259,
|
||||
"height": 80,
|
||||
"content": "### Ask a question in our community (13k+ members)\n[Explore n8n community](https://community.n8n.io/)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "29227c52-a9cc-4bd1-b1a3-78fb805b659c",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
3260,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o",
|
||||
"options": {
|
||||
"temperature": 0.5
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "494a2868-9ff5-402c-b83b-6dd2c3ddbcc9",
|
||||
"name": "Add automation label",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3760,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"labelIds": [
|
||||
"Label_4763053241338138112"
|
||||
],
|
||||
"messageId": "={{ $json.id }}",
|
||||
"operation": "addLabels"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "0f9d834d-ec47-43f5-945b-8c464d371122",
|
||||
"name": "On new email to nathan's inbox",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"disabled": true,
|
||||
"position": [
|
||||
3040,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "142e2a49-40bd-4bf5-9ba3-f14ecd68618e",
|
||||
"name": "Add music label",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3760,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"labelIds": [
|
||||
"Label_6822395192337188416"
|
||||
],
|
||||
"messageId": "={{ $json.id }}",
|
||||
"operation": "addLabels"
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "2eb46753-a0e8-43ec-a460-466b1dd265c9",
|
||||
"name": "Assign label with AI",
|
||||
"type": "@n8n/n8n-nodes-langchain.textClassifier",
|
||||
"position": [
|
||||
3280,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"inputText": "={{ $json.text }}",
|
||||
"categories": {
|
||||
"categories": [
|
||||
{
|
||||
"category": "automation",
|
||||
"description": "email on the topic of automation or workflows and automated processes, includes newsletters on this topic"
|
||||
},
|
||||
{
|
||||
"category": "music",
|
||||
"description": "email on the topic of music, for example from an artist "
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "576d8206-1b1e-4671-ba45-86e9d844a73b",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
1860,
|
||||
460
|
||||
],
|
||||
"webhookId": "74facfd7-0f51-4605-9724-2c300594fcf9",
|
||||
"parameters": {
|
||||
"path": "74facfd7-0f51-4605-9724-2c300594fcf9",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "1e612376-1a3b-4c48-9cd3-97867ba4cad5",
|
||||
"name": "Whether email contains n8n",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
2060,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "a0b16c44-03ea-4e96-9671-7b168697186d",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $json.query.email }}",
|
||||
"rightValue": "@n8n"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Whether email contains n8n",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download PDF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Book appointment": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"PDFs to download": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download PDF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Embeddings OpenAI2": {
|
||||
"ai_embedding": [
|
||||
[
|
||||
{
|
||||
"node": "Read Pinecone Vector Store",
|
||||
"type": "ai_embedding",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Assign label with AI",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Default Data Loader": {
|
||||
"ai_document": [
|
||||
[
|
||||
{
|
||||
"node": "Insert into Pinecone vector store",
|
||||
"type": "ai_document",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Anthropic Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Assign label with AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add automation label",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Add music label",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Vector Store Retriever": {
|
||||
"ai_retriever": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "ai_retriever",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get calendar availability": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Appointment booking agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read Pinecone Vector Store": {
|
||||
"ai_vectorStore": [
|
||||
[
|
||||
{
|
||||
"node": "Vector Store Retriever",
|
||||
"type": "ai_vectorStore",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Question and Answer Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Whether email contains n8n": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Execute JavaScript",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Send message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On new email to nathan's inbox": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Assign label with AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Recursive Character Text Splitter": {
|
||||
"ai_textSplitter": [
|
||||
[
|
||||
{
|
||||
"node": "Default Data Loader",
|
||||
"type": "ai_textSplitter",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,368 +0,0 @@
|
||||
{
|
||||
"name": "Ask a human",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "a60c8572-56c1-4bf3-8352-a6419a475887",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
900,
|
||||
760
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "b4f2e26c-903b-46b8-bd8b-110fd64de9e4",
|
||||
"name": "Not sure?",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"name": "dont_know_tool",
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "chatInput",
|
||||
"stringValue": "={{ $('Chat Trigger').item.json.chatInput }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"workflowId": "={{ $workflow.id}}",
|
||||
"description": "Use this tool if you don't know the answer to the user's question, or if you're not very confident about your answer."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "951cc691-b422-4ce6-901f-b7feb3afd1ad",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
540,
|
||||
1360
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "194ba9c0-e256-449a-8da7-ac5339123a99",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
500,
|
||||
1020
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1118.3459011229047,
|
||||
"height": 775.3931210698682,
|
||||
"content": "### Sub-workflow: Custom tool\nThe agent above can call this workflow. It checks if the user has supplied an email address. If they haven't it prompts them to provide one. If they have, it messages a customer support channel for help."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "38c6b363-45a7-4e72-9e40-8c0df3cc480f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
500,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0389315b-e48d-4b00-b9a1-899302b1b094",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1060,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 197.45572294791873,
|
||||
"height": 179.21380662202682,
|
||||
"content": "**This tool calls the sub-workflow below**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fb11064a-4cf5-4110-9e39-af24a3225164",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
700,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 150,
|
||||
"height": 213.44323866265472,
|
||||
"content": "**Set your credentials**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d689021d-0a46-4dff-a01a-0b01ecdd198b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 178.0499248677781,
|
||||
"height": 250.57252651663197,
|
||||
"content": "**Set your credentials and Slack details**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0926cd61-c0b8-4bae-ae65-9afd130d17cd",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 185.9375,
|
||||
"height": 214.8397420554627,
|
||||
"content": "## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Hi! Please respond to this as if you don't know the answer to my query._"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cde69dfe-252e-4a05-8d56-fa79431df5d8",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1580,
|
||||
1600
|
||||
],
|
||||
"parameters": {
|
||||
"height": 144.50520156238127,
|
||||
"content": "## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "927b775a-47f6-4067-a1a5-5f13dea28e45",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
600,
|
||||
520
|
||||
],
|
||||
"webhookId": "785e0c0c-12e5-4249-9abe-47bb131975cb",
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "971e7b90-c2d8-4292-9da8-732d7d399f04",
|
||||
"name": "Prompt the user to provide an email",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1060,
|
||||
1520
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "response = {\"response\":\"I'm sorry I don't know the answer. Please repeat your question and include your email address so I can request help.\"};\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "6f5a21b3-c145-46c8-8e69-660100c4a6fc",
|
||||
"name": "Confirm that we've messaged a human",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1300,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "response = {\"response\": \"Thank you for getting in touch. I've messaged a human to help.\"}\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "8b17da5e-e392-4028-91b0-bc02d34e46ed",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "Try to answer the user's question. When you can't answer, or you're not confident of the answer, use the appropriate tool. When you use the dont_know_tool, respond with the message from the tool."
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "990ecd3b-6aa0-4b17-8d01-d606b9164fa8",
|
||||
"name": "Check if user has provided email",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
760,
|
||||
1360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "5e21e7c5-db60-4111-bb17-c289ae0fc159",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "regex"
|
||||
},
|
||||
"leftValue": "={{ $('Execute Workflow Trigger').item.json.chatInput }}",
|
||||
"rightValue": "/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)/gi"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d14da0ae-06ca-422b-b5b6-e7759e74c787",
|
||||
"name": "Message Slack for help",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
1060,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ \"A user had a question the bot couldn't answer. Here's their message: \" + $('Execute Workflow Trigger').item.json.chatInput }}",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": ""
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "278391c7-6945-495e-a4f1-74fb8fcc3549",
|
||||
"name": "GPT4",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
740,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4",
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"GPT4": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Not sure?": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Message Slack for help": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Confirm that we've messaged a human",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check if user has provided email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check if user has provided email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Message Slack for help",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Prompt the user to provide an email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,368 @@
|
||||
{
|
||||
"name": "Ask a human",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "a60c8572-56c1-4bf3-8352-a6419a475887",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
900,
|
||||
760
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "b4f2e26c-903b-46b8-bd8b-110fd64de9e4",
|
||||
"name": "Not sure?",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"position": [
|
||||
1120,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"name": "dont_know_tool",
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "chatInput",
|
||||
"stringValue": "={{ $('Chat Trigger').item.json.chatInput }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"workflowId": "={{ $workflow.id}}",
|
||||
"description": "Use this tool if you don't know the answer to the user's question, or if you're not very confident about your answer."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "951cc691-b422-4ce6-901f-b7feb3afd1ad",
|
||||
"name": "Execute Workflow Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
540,
|
||||
1360
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "194ba9c0-e256-449a-8da7-ac5339123a99",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
500,
|
||||
1020
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 1118.3459011229047,
|
||||
"height": 775.3931210698682,
|
||||
"content": "### Sub-workflow: Custom tool\nThe agent above can call this workflow. It checks if the user has supplied an email address. If they haven't it prompts them to provide one. If they have, it messages a customer support channel for help."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "38c6b363-45a7-4e72-9e40-8c0df3cc480f",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
500,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 927.5,
|
||||
"height": 486.5625,
|
||||
"content": "### Main workflow: AI agent using custom tool"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0389315b-e48d-4b00-b9a1-899302b1b094",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1060,
|
||||
700
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 197.45572294791873,
|
||||
"height": 179.21380662202682,
|
||||
"content": "**This tool calls the sub-workflow below**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fb11064a-4cf5-4110-9e39-af24a3225164",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
700,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 150,
|
||||
"height": 213.44323866265472,
|
||||
"content": "**Set your credentials**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d689021d-0a46-4dff-a01a-0b01ecdd198b",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 178.0499248677781,
|
||||
"height": 250.57252651663197,
|
||||
"content": "**Set your credentials and Slack details**"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0926cd61-c0b8-4bae-ae65-9afd130d17cd",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 185.9375,
|
||||
"height": 214.8397420554627,
|
||||
"content": "## Try it out\n\nSelect **Chat** at the bottom and enter:\n\n_Hi! Please respond to this as if you don't know the answer to my query._"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "cde69dfe-252e-4a05-8d56-fa79431df5d8",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1580,
|
||||
1600
|
||||
],
|
||||
"parameters": {
|
||||
"height": 144.50520156238127,
|
||||
"content": "## Next steps\n\nLearn more about [Advanced AI in n8n](https://docs.n8n.io/advanced-ai/)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "927b775a-47f6-4067-a1a5-5f13dea28e45",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
600,
|
||||
520
|
||||
],
|
||||
"webhookId": "785e0c0c-12e5-4249-9abe-47bb131975cb",
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "971e7b90-c2d8-4292-9da8-732d7d399f04",
|
||||
"name": "Prompt the user to provide an email",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1060,
|
||||
1520
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "response = {\"response\":\"I'm sorry I don't know the answer. Please repeat your question and include your email address so I can request help.\"};\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "6f5a21b3-c145-46c8-8e69-660100c4a6fc",
|
||||
"name": "Confirm that we've messaged a human",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1300,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "response = {\"response\": \"Thank you for getting in touch. I've messaged a human to help.\"}\nreturn response;"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "8b17da5e-e392-4028-91b0-bc02d34e46ed",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
820,
|
||||
520
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"systemMessage": "Try to answer the user's question. When you can't answer, or you're not confident of the answer, use the appropriate tool. When you use the dont_know_tool, respond with the message from the tool."
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "990ecd3b-6aa0-4b17-8d01-d606b9164fa8",
|
||||
"name": "Check if user has provided email",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
760,
|
||||
1360
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "5e21e7c5-db60-4111-bb17-c289ae0fc159",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "regex"
|
||||
},
|
||||
"leftValue": "={{ $('Execute Workflow Trigger').item.json.chatInput }}",
|
||||
"rightValue": "/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)/gi"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "d14da0ae-06ca-422b-b5b6-e7759e74c787",
|
||||
"name": "Message Slack for help",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
1060,
|
||||
1260
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ \"A user had a question the bot couldn't answer. Here's their message: \" + $('Execute Workflow Trigger').item.json.chatInput }}",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": ""
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "278391c7-6945-495e-a4f1-74fb8fcc3549",
|
||||
"name": "GPT4",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
740,
|
||||
740
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4",
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"GPT4": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Not sure?": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Message Slack for help": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Confirm that we've messaged a human",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Execute Workflow Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check if user has provided email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check if user has provided email": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Message Slack for help",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Prompt the user to provide an email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,284 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6c78b4c7-993b-410d-93e7-e11b3052e53b",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
0,
|
||||
420
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c2ab6497-6d6d-483b-bd43-494ae95394c0",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1440,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"is_valid\": { \"type\": \"boolean\" },\n \"photo_description\": {\n \"type\": \"string\",\n \"description\": \"describe the appearance of the person(s), object(s) if any and the background in the image. Mention any colours of each if possible.\"\n },\n\t\t\"reasons\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "b23f5298-17c7-49ac-a8ca-78e006b2d294",
|
||||
"name": "Photo URLs",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
360,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "6baa3e08-8957-454e-8ee9-d5414a0ff990",
|
||||
"name": "data",
|
||||
"type": "array",
|
||||
"value": "={{\n[\n{\n \"name\": \"portrait_1\",\n \"url\": \"https://drive.google.com/file/d/1zs963iFkO-3g2rKak8Hcy555h55D8gjF/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_2\",\n \"url\": \"https://drive.google.com/file/d/19FyDcs68dZauQSEf6SEulJMag51SPsFy/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_3\",\n \"url\": \"https://drive.google.com/file/d/1gbXjfNYE7Tvuw_riFmHMKoqPPu696VfW/view?usp=sharing\",\n\n},\n{\n \"name\": \"portrait_4\",\n \"url\": \"https://drive.google.com/file/d/1s19hYdxgfMkrnU25l6YIDq-myQr1tQMa/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_5\",\n \"url\": \"https://drive.google.com/file/d/193FqIXJWAKj6O2SmOj3cLBfypHBkgdI5/view?usp=sharing\"\n}\n]\n}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "8d445f73-dff7-485b-87e2-5b64da09cbf0",
|
||||
"name": "Photos To List",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
520,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7fb3b829-88a7-42ec-abfd-3ddaa042c916",
|
||||
"name": "Download Photos",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
680,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $json.url }}"
|
||||
},
|
||||
"options": {},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "yOwz41gMQclOadgu",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b8644f6d-691f-49bc-b0fe-33a68c59638d",
|
||||
"name": "Resize For AI",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1060,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1024,
|
||||
"height": 1024,
|
||||
"options": {},
|
||||
"operation": "resize",
|
||||
"resizeOption": "onlyIfLarger"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ecb266f2-0d2d-4cbe-a641-26735f0bdf18",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 594,
|
||||
"height": 438,
|
||||
"content": "## 1. Import Photos To Validate\n[Read more about using Google Drive](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledrive)\n\nIn this demonstration, we'll import 5 different portraits to test our AI vision model. For convenience, we'll use Google Drive but feel free to swap this out for other sources such as other storage or by using webhooks."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1034923-0905-4cdd-a6bf-21d28aa3dd71",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
900,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 774,
|
||||
"height": 589.25,
|
||||
"content": "## 2. Verify Passport Photo Validity Using AI Vision Model\n[Learn more about Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nVerifying if a photo is suitable for a passport photo is a great use-case for AI vision and to automate the process is an equally great use-case for using n8n. Here's we've pasted in the UK governments guidelines copied from gov.uk and have asked the AI to validate the incoming photos following those rules. A structured output parser is used to simplify the AI response which can be used to update a database or backend of your choosing."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af231ee5-adff-4d27-ba5f-8c04ddd4892d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-140,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"width": 386,
|
||||
"height": 610.0104651162792,
|
||||
"content": "## Try It Out!\n\n### This workflow takes a portrait and verifies if it makes for a valid passport photo. It achieves this by using an AI vision model following the UK government guidance.\n\nOpenAI's vision model was found to perform well for understanding photographs and so is recommended for this type of workflow. However, any capable vision model should work.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e07e1655-2683-4e21-b2b7-e0c0bfb569c0",
|
||||
"name": "Passport Photo Validator",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1240,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Assess if the image is a valid according to the passport photo criteria as set by the UK Government.",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=You help verify passport photo validity.\n\n## Rules for digital photos\nhttps://www.gov.uk/photos-for-passports\n\n### The quality of your digital photo\nYour photo must be:\n* clear and in focus\n* in colour\n* unaltered by computer software\n* at least 600 pixels wide and 750 pixels tall\n* at least 50KB and no more than 10MB\n\n### What your digital photo must show\nThe digital photo must:\n* contain no other objects or people\n* be taken against a plain white or light-coloured background\n* be in clear contrast to the background\n* not have ‘red eye’\n* If you’re using a photo taken on your own device, include your head, shoulders and upper body. Do not crop your photo - it will be done for you.\n\nIn your photo you must:\n* be facing forwards and looking straight at the camera\n* have a plain expression and your mouth closed\n* have your eyes open and visible\n* not have hair in front of your eyes\n* not have a head covering (unless it’s for religious or medical reasons)\n* not have anything covering your face\n* not have any shadows on your face or behind you - shadows on light background are okay\n* Do not wear glasses in your photo unless you have to do so. If you must wear glasses, they cannot be sunglasses or tinted glasses, and you must make sure your eyes are not covered by the frames or any glare, reflection or shadow.\n\n### Photos of babies and children\n* Children must be on their own in the picture. Babies must not be holding toys or using dummies.\n* Children under 6 do not have to be looking directly at the camera or have a plain expression.\n* Children under one do not have to have their eyes open. You can support their head with your hand, but your hand must not be visible in the photo.\n* Children under one should lie on a plain light-coloured sheet. Take the photo from above.\n\n"
|
||||
},
|
||||
{
|
||||
"type": "HumanMessagePromptTemplate",
|
||||
"messageType": "imageBinary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "0a36ba22-90b2-4abf-943b-c1cc8e7317d5",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
1240,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-pro-latest"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "dSxo6ns5wn658r8N",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Photo URLs": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Photos To List",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Resize For AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Photos To List": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Photos",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Photos": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Resize For AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Photo URLs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "6c78b4c7-993b-410d-93e7-e11b3052e53b",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
0,
|
||||
420
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c2ab6497-6d6d-483b-bd43-494ae95394c0",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1440,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"schemaType": "manual",
|
||||
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"is_valid\": { \"type\": \"boolean\" },\n \"photo_description\": {\n \"type\": \"string\",\n \"description\": \"describe the appearance of the person(s), object(s) if any and the background in the image. Mention any colours of each if possible.\"\n },\n\t\t\"reasons\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\" }\n }\n\t}\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "b23f5298-17c7-49ac-a8ca-78e006b2d294",
|
||||
"name": "Photo URLs",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
360,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "6baa3e08-8957-454e-8ee9-d5414a0ff990",
|
||||
"name": "data",
|
||||
"type": "array",
|
||||
"value": "={{\n[\n{\n \"name\": \"portrait_1\",\n \"url\": \"https://drive.google.com/file/d/1zs963iFkO-3g2rKak8Hcy555h55D8gjF/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_2\",\n \"url\": \"https://drive.google.com/file/d/19FyDcs68dZauQSEf6SEulJMag51SPsFy/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_3\",\n \"url\": \"https://drive.google.com/file/d/1gbXjfNYE7Tvuw_riFmHMKoqPPu696VfW/view?usp=sharing\",\n\n},\n{\n \"name\": \"portrait_4\",\n \"url\": \"https://drive.google.com/file/d/1s19hYdxgfMkrnU25l6YIDq-myQr1tQMa/view?usp=sharing\"\n},\n{\n \"name\": \"portrait_5\",\n \"url\": \"https://drive.google.com/file/d/193FqIXJWAKj6O2SmOj3cLBfypHBkgdI5/view?usp=sharing\"\n}\n]\n}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "8d445f73-dff7-485b-87e2-5b64da09cbf0",
|
||||
"name": "Photos To List",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
520,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7fb3b829-88a7-42ec-abfd-3ddaa042c916",
|
||||
"name": "Download Photos",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
680,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"fileId": {
|
||||
"__rl": true,
|
||||
"mode": "url",
|
||||
"value": "={{ $json.url }}"
|
||||
},
|
||||
"options": {},
|
||||
"operation": "download"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "yOwz41gMQclOadgu",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b8644f6d-691f-49bc-b0fe-33a68c59638d",
|
||||
"name": "Resize For AI",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1060,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1024,
|
||||
"height": 1024,
|
||||
"options": {},
|
||||
"operation": "resize",
|
||||
"resizeOption": "onlyIfLarger"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ecb266f2-0d2d-4cbe-a641-26735f0bdf18",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 594,
|
||||
"height": 438,
|
||||
"content": "## 1. Import Photos To Validate\n[Read more about using Google Drive](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledrive)\n\nIn this demonstration, we'll import 5 different portraits to test our AI vision model. For convenience, we'll use Google Drive but feel free to swap this out for other sources such as other storage or by using webhooks."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a1034923-0905-4cdd-a6bf-21d28aa3dd71",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
900,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 774,
|
||||
"height": 589.25,
|
||||
"content": "## 2. Verify Passport Photo Validity Using AI Vision Model\n[Learn more about Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nVerifying if a photo is suitable for a passport photo is a great use-case for AI vision and to automate the process is an equally great use-case for using n8n. Here's we've pasted in the UK governments guidelines copied from gov.uk and have asked the AI to validate the incoming photos following those rules. A structured output parser is used to simplify the AI response which can be used to update a database or backend of your choosing."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "af231ee5-adff-4d27-ba5f-8c04ddd4892d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-140,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"width": 386,
|
||||
"height": 610.0104651162792,
|
||||
"content": "## Try It Out!\n\n### This workflow takes a portrait and verifies if it makes for a valid passport photo. It achieves this by using an AI vision model following the UK government guidance.\n\nOpenAI's vision model was found to perform well for understanding photographs and so is recommended for this type of workflow. However, any capable vision model should work.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e07e1655-2683-4e21-b2b7-e0c0bfb569c0",
|
||||
"name": "Passport Photo Validator",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1240,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Assess if the image is a valid according to the passport photo criteria as set by the UK Government.",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=You help verify passport photo validity.\n\n## Rules for digital photos\nhttps://www.gov.uk/photos-for-passports\n\n### The quality of your digital photo\nYour photo must be:\n* clear and in focus\n* in colour\n* unaltered by computer software\n* at least 600 pixels wide and 750 pixels tall\n* at least 50KB and no more than 10MB\n\n### What your digital photo must show\nThe digital photo must:\n* contain no other objects or people\n* be taken against a plain white or light-coloured background\n* be in clear contrast to the background\n* not have ‘red eye’\n* If you’re using a photo taken on your own device, include your head, shoulders and upper body. Do not crop your photo - it will be done for you.\n\nIn your photo you must:\n* be facing forwards and looking straight at the camera\n* have a plain expression and your mouth closed\n* have your eyes open and visible\n* not have hair in front of your eyes\n* not have a head covering (unless it’s for religious or medical reasons)\n* not have anything covering your face\n* not have any shadows on your face or behind you - shadows on light background are okay\n* Do not wear glasses in your photo unless you have to do so. If you must wear glasses, they cannot be sunglasses or tinted glasses, and you must make sure your eyes are not covered by the frames or any glare, reflection or shadow.\n\n### Photos of babies and children\n* Children must be on their own in the picture. Babies must not be holding toys or using dummies.\n* Children under 6 do not have to be looking directly at the camera or have a plain expression.\n* Children under one do not have to have their eyes open. You can support their head with your hand, but your hand must not be visible in the photo.\n* Children under one should lie on a plain light-coloured sheet. Take the photo from above.\n\n"
|
||||
},
|
||||
{
|
||||
"type": "HumanMessagePromptTemplate",
|
||||
"messageType": "imageBinary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "0a36ba22-90b2-4abf-943b-c1cc8e7317d5",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
1240,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-pro-latest"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "dSxo6ns5wn658r8N",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Photo URLs": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Photos To List",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Resize For AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Photos To List": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Photos",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Photos": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Resize For AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Passport Photo Validator",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Photo URLs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,563 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "51dbe3b4-42f6-43c9-85dc-42ae49be6ba9",
|
||||
"name": "Get RFP Data",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
1003,
|
||||
278
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c42e6bfc-a426-4d12-bf95-f3fe6e944631",
|
||||
"name": "Item List Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserItemList",
|
||||
"position": [
|
||||
2140,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1703e9c3-f49e-4272-ad11-0b9d4e9a76c6",
|
||||
"name": "For Each Question...",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
2460,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "a54fa4ee-6f67-41a9-89fe-fd9f2bf094de",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
760,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 532.597092515486,
|
||||
"height": 508.1316876142587,
|
||||
"content": "## 1. API to Trigger Workflow\n[Read more about using Webhooks](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/)\n\nThis workflow requires the user to submit the RFP document via an API request. It's a common pattern to use the webhook node for this purpose. Be sure to secure this webhook endpoint in production!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fdef005f-7838-4b8c-8af4-4b7c6f947ee2",
|
||||
"name": "Set Variables",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1143,
|
||||
278
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "={\n \"doc_title\": \"{{ $('Wait for Request').item.json.body.title }}\",\n \"doc_filename\": \"{{ $('Wait for Request').item.json.body.id }} | {{ $('Wait for Request').item.json.body.title }} | {{ $now.format('yyyyMMddhhmmss') }}| RFP Response\",\n \"reply_to\": \"{{ $('Wait for Request').item.json.body.reply_to }}\"\n}\n"
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "a64f6274-62fc-42fb-b7c7-5aa85746c621",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1320,
|
||||
148.42417112849222
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 493.289385759178,
|
||||
"height": 418.29352785836636,
|
||||
"content": "## 2. Create a new Doc to Capture Responses For RFP Questions\n[Read more about working with Google Docs](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledocs/)\n\nFor each RFP we process, let's create its very own document to store the results. It will serve as a draft document for the RFP response."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2b3df6af-c1ab-44a1-8907-425944294477",
|
||||
"name": "Create new RFP Response Document",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
1420,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"title": "={{ $json.doc_filename }}",
|
||||
"folderId": "=1y0I8MH32maIWCJh767mRE_NMHC6A3bUu"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "0bf30bef-2910-432b-b5eb-dee3fe39b797",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1840,
|
||||
110.52747078833045
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 500.1029039641811,
|
||||
"height": 599.9895116376663,
|
||||
"content": "## 3. Identifying Questions using AI\n[Read more about Question & Answer Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainretrievalqa/)\n\nUsing the power of LLMs, we're able to extract the RFP questionnaire regardless of original formatting or layout. This allows AutoRFP to handle a wide range of RFPs without requiring explicit extraction rules for edge cases.\n\nAdditionally, We'll use the Input List Output Parser to return a list of questions for further processing."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1c064047-1f6a-47c8-bb49-85b4d6f8e854",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2380,
|
||||
84.66944065837868
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 746.3888903304862,
|
||||
"height": 600.3660610069576,
|
||||
"content": "## 4. Generating Question & Answer Pairs with AI\n[Read more about using OpenAI Assistants in n8n](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/)\n\nBy preparing an OpenAI Assistant with marketing material and sales documents about our company and business, we are able to use AI to answer RFP questions with the accurate and relevant context. Potentially allowing sales teams to increase the number of RFPs they can reply to.\n\nThis portion of the workflow loops through and answers each question individually for better answers. We can record the Question and Answer pairings to the RFP response document we created earlier."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e663ba01-e9a6-4247-9d97-8f796d29d72a",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1960,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec0b439e-9fd8-4960-b8bb-04f4f7814a0a",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
300,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"width": 421.778219154496,
|
||||
"height": 515.8006969458895,
|
||||
"content": "## Try It Out!\n\n**This workflow does the following:**\n* Receives a RFP document via webhook\n* Creates a new RFP response document via Google Docs\n* Uses LLMs to extract the questions from the RFP document into a questions list\n* Loops through each question and uses an OpenAI Assistant to generate an answer. Saving each answer into the response document.\n* Once complete, sends a gmail and slack notification to the team.\n\n\n📃**Example Documents**\nTo run this workflow, you'll need to following 2 documents:\n* [RFP Document](https://drive.google.com/file/d/1G42h4Vz2lBuiNCnOiXF_-EBP1MaIEVq5/view?usp=sharing)\n* [Example Company Document](https://drive.google.com/file/d/16WywCYcxBgYHXB3TY3wXUTyfyG2n_BA0/view?usp=sharing)\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "244ff32d-9bc4-4a67-a6c2-4a7dc308058e",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3160,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 474.3513281516049,
|
||||
"height": 390.51033452105344,
|
||||
"content": "## 5. Send Notification Once Completed\n[Read more about using Slack](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack)\n\n\nFinally, we can use a number of ways to notify the sales team when the process is complete. Here, we've opted to send the requesting user an email with a link to the RFP response document."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "94243b69-43b8-4731-9a6b-2934db832cc6",
|
||||
"name": "Send Chat Notification",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
3440,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=RFP document \"{{ $('Set Variables').item.json.title }}\" completed!",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "RFP-channel"
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "VfK3js0YdqBdQLGP",
|
||||
"name": "Slack account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "391d7e07-2a6d-4c4d-bf42-9cc5466cc1b5",
|
||||
"name": "Send Email Notification",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3240,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"sendTo": "={{ $('Set Variables').item.json.reply_to }}",
|
||||
"message": "=Your RFP document \"{{ $('Set Variables').item.json.title }}\" is now complete!",
|
||||
"options": {},
|
||||
"subject": "=RFP Questionnaire \"{{ $('Set Variables').item.json.title }}\" Completed!",
|
||||
"emailType": "text"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "Sf5Gfl9NiFTNXFWb",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "34115f45-21ff-49a0-95f4-1fed53b53583",
|
||||
"name": "Add Metadata to Response Doc",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
1600,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "=Title: {{ $('Set Variables').item.json.doc_title }}\nDate generated: {{ $now.format(\"yyyy-MM-dd @ hh:mm\") }}\nRequested by: {{ $('Set Variables').item.json.reply_to }}\nExecution Id: http://localhost:5678/workflow/{{ $workflow.id }}/executions/{{ $execution.id }}\n\n---\n\n",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "={{ $json.id }}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "f285d896-ba15-4f8a-b041-7cbcbe2e1050",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
783,
|
||||
238
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.30781285767205,
|
||||
"height": 306.5264325350084,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Use a tool such as Postman to send data to the webhook."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b6e4e40e-b10b-48f2-bfe2-1ad38b1c6518",
|
||||
"name": "Record Question & Answer in Response Doc",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
2940,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "={{ $runIndex+1 }}. {{ $json.content }}\n{{ $json.output }}\n\n",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "={{ $('Create new RFP Response Document').item.json.id }}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "ae8cc28f-4fd3-41d7-8a30-2675f58d1067",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2600,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"width": 306.8994213707367,
|
||||
"height": 481.01365258903786,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\nYou'll need to create an OpenAI Assistant to use this workflow.\n* Sign up for [OpenAI Dashboard](https://platform.openai.com) if you haven't already.\n* Create an [OpenAI Assistant](https://platform.openai.com/playground/assistants)\n* Upload the [example company doc](https://drive.google.com/file/d/16WywCYcxBgYHXB3TY3wXUTyfyG2n_BA0/view?usp=sharing) to the assistant.\n\nThe assistant will use the company doc to answer the questions."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "81825554-5cbe-469b-8511-a92d5ea165cb",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3200,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 386.79263167741857,
|
||||
"height": 94.04968721739164,
|
||||
"content": "🚨**Required**\n* Update the email address to send to in Gmail Node.\n* Update the channel and message for Slack."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "25a57ca0-6789-499c-873b-07aba40530ed",
|
||||
"name": "Answer Question with Context",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
2620,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.response.text }}",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_QBI5lLKOsjktr3DRB4MwrgZd",
|
||||
"cachedResultName": "Nexus Digital Solutions Bot"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "1b4cc83b-a793-47c1-9dd6-0d7484db07b4",
|
||||
"name": "Wait for Request",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
823,
|
||||
278
|
||||
],
|
||||
"webhookId": "35e874df-2904-494e-a9f5-5a3f20f517f8",
|
||||
"parameters": {
|
||||
"path": "35e874df-2904-494e-a9f5-5a3f20f517f8",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2f97e3e6-c100-4045-bcb3-6fbd17cfb420",
|
||||
"name": "Extract Questions From RFP",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1960,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=You have been given a RFP document as part of a tender process of a buyer. Please extract all questions intended for the supplier. You must ensure the questions extracted are exactly has they are written in the RFP document.\n\n<RFP>{{ $('Get RFP Data').item.json.text }}<RFP>",
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "4945b975-ac84-406e-8482-44cfa5679ef9",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
760,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 529.9947173986736,
|
||||
"height": 157.64231937074243,
|
||||
"content": "### Example Webhook Request\ncurl --location 'https://<n8n_webhook_url>' \\\n--form 'id=\"RFP001\"' \\\n--form 'title=\"BlueChip Travel and StarBus Web Services\"' \\\n--form 'reply_to=\"jim@example.com\"' \\\n--form 'data=@\"k9pnbALxX/RFP Questionnaire.pdf\"'\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Get RFP Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Variables",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set Variables": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create new RFP Response Document",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wait for Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get RFP Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"For Each Question...": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email Notification",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Answer Question with Context",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Item List Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send Email Notification": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Chat Notification",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract Questions From RFP": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "For Each Question...",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Metadata to Response Doc": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Answer Question with Context": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Record Question & Answer in Response Doc",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create new RFP Response Document": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Metadata to Response Doc",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Record Question & Answer in Response Doc": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "For Each Question...",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,563 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "26ba763460b97c249b82942b23b6384876dfeb9327513332e743c5f6219c2b8e"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "51dbe3b4-42f6-43c9-85dc-42ae49be6ba9",
|
||||
"name": "Get RFP Data",
|
||||
"type": "n8n-nodes-base.extractFromFile",
|
||||
"position": [
|
||||
1003,
|
||||
278
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "pdf"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c42e6bfc-a426-4d12-bf95-f3fe6e944631",
|
||||
"name": "Item List Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserItemList",
|
||||
"position": [
|
||||
2140,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1703e9c3-f49e-4272-ad11-0b9d4e9a76c6",
|
||||
"name": "For Each Question...",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
2460,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "a54fa4ee-6f67-41a9-89fe-fd9f2bf094de",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
760,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 532.597092515486,
|
||||
"height": 508.1316876142587,
|
||||
"content": "## 1. API to Trigger Workflow\n[Read more about using Webhooks](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/)\n\nThis workflow requires the user to submit the RFP document via an API request. It's a common pattern to use the webhook node for this purpose. Be sure to secure this webhook endpoint in production!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "fdef005f-7838-4b8c-8af4-4b7c6f947ee2",
|
||||
"name": "Set Variables",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1143,
|
||||
278
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "={\n \"doc_title\": \"{{ $('Wait for Request').item.json.body.title }}\",\n \"doc_filename\": \"{{ $('Wait for Request').item.json.body.id }} | {{ $('Wait for Request').item.json.body.title }} | {{ $now.format('yyyyMMddhhmmss') }}| RFP Response\",\n \"reply_to\": \"{{ $('Wait for Request').item.json.body.reply_to }}\"\n}\n"
|
||||
},
|
||||
"typeVersion": 3.3
|
||||
},
|
||||
{
|
||||
"id": "a64f6274-62fc-42fb-b7c7-5aa85746c621",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1320,
|
||||
148.42417112849222
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 493.289385759178,
|
||||
"height": 418.29352785836636,
|
||||
"content": "## 2. Create a new Doc to Capture Responses For RFP Questions\n[Read more about working with Google Docs](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googledocs/)\n\nFor each RFP we process, let's create its very own document to store the results. It will serve as a draft document for the RFP response."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2b3df6af-c1ab-44a1-8907-425944294477",
|
||||
"name": "Create new RFP Response Document",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
1420,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"title": "={{ $json.doc_filename }}",
|
||||
"folderId": "=1y0I8MH32maIWCJh767mRE_NMHC6A3bUu"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "0bf30bef-2910-432b-b5eb-dee3fe39b797",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1840,
|
||||
110.52747078833045
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 500.1029039641811,
|
||||
"height": 599.9895116376663,
|
||||
"content": "## 3. Identifying Questions using AI\n[Read more about Question & Answer Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainretrievalqa/)\n\nUsing the power of LLMs, we're able to extract the RFP questionnaire regardless of original formatting or layout. This allows AutoRFP to handle a wide range of RFPs without requiring explicit extraction rules for edge cases.\n\nAdditionally, We'll use the Input List Output Parser to return a list of questions for further processing."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1c064047-1f6a-47c8-bb49-85b4d6f8e854",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2380,
|
||||
84.66944065837868
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 746.3888903304862,
|
||||
"height": 600.3660610069576,
|
||||
"content": "## 4. Generating Question & Answer Pairs with AI\n[Read more about using OpenAI Assistants in n8n](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/)\n\nBy preparing an OpenAI Assistant with marketing material and sales documents about our company and business, we are able to use AI to answer RFP questions with the accurate and relevant context. Potentially allowing sales teams to increase the number of RFPs they can reply to.\n\nThis portion of the workflow loops through and answers each question individually for better answers. We can record the Question and Answer pairings to the RFP response document we created earlier."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e663ba01-e9a6-4247-9d97-8f796d29d72a",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
1960,
|
||||
540
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ec0b439e-9fd8-4960-b8bb-04f4f7814a0a",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
300,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"width": 421.778219154496,
|
||||
"height": 515.8006969458895,
|
||||
"content": "## Try It Out!\n\n**This workflow does the following:**\n* Receives a RFP document via webhook\n* Creates a new RFP response document via Google Docs\n* Uses LLMs to extract the questions from the RFP document into a questions list\n* Loops through each question and uses an OpenAI Assistant to generate an answer. Saving each answer into the response document.\n* Once complete, sends a gmail and slack notification to the team.\n\n\n📃**Example Documents**\nTo run this workflow, you'll need to following 2 documents:\n* [RFP Document](https://drive.google.com/file/d/1G42h4Vz2lBuiNCnOiXF_-EBP1MaIEVq5/view?usp=sharing)\n* [Example Company Document](https://drive.google.com/file/d/16WywCYcxBgYHXB3TY3wXUTyfyG2n_BA0/view?usp=sharing)\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "244ff32d-9bc4-4a67-a6c2-4a7dc308058e",
|
||||
"name": "Sticky Note5",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3160,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 474.3513281516049,
|
||||
"height": 390.51033452105344,
|
||||
"content": "## 5. Send Notification Once Completed\n[Read more about using Slack](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.slack)\n\n\nFinally, we can use a number of ways to notify the sales team when the process is complete. Here, we've opted to send the requesting user an email with a link to the RFP response document."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "94243b69-43b8-4731-9a6b-2934db832cc6",
|
||||
"name": "Send Chat Notification",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
3440,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=RFP document \"{{ $('Set Variables').item.json.title }}\" completed!",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "name",
|
||||
"value": "RFP-channel"
|
||||
},
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "VfK3js0YdqBdQLGP",
|
||||
"name": "Slack account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "391d7e07-2a6d-4c4d-bf42-9cc5466cc1b5",
|
||||
"name": "Send Email Notification",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
3240,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"sendTo": "={{ $('Set Variables').item.json.reply_to }}",
|
||||
"message": "=Your RFP document \"{{ $('Set Variables').item.json.title }}\" is now complete!",
|
||||
"options": {},
|
||||
"subject": "=RFP Questionnaire \"{{ $('Set Variables').item.json.title }}\" Completed!",
|
||||
"emailType": "text"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "Sf5Gfl9NiFTNXFWb",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "34115f45-21ff-49a0-95f4-1fed53b53583",
|
||||
"name": "Add Metadata to Response Doc",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
1600,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "=Title: {{ $('Set Variables').item.json.doc_title }}\nDate generated: {{ $now.format(\"yyyy-MM-dd @ hh:mm\") }}\nRequested by: {{ $('Set Variables').item.json.reply_to }}\nExecution Id: http://localhost:5678/workflow/{{ $workflow.id }}/executions/{{ $execution.id }}\n\n---\n\n",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "={{ $json.id }}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "f285d896-ba15-4f8a-b041-7cbcbe2e1050",
|
||||
"name": "Sticky Note6",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
783,
|
||||
238
|
||||
],
|
||||
"parameters": {
|
||||
"width": 192.30781285767205,
|
||||
"height": 306.5264325350084,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\n* Use a tool such as Postman to send data to the webhook."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b6e4e40e-b10b-48f2-bfe2-1ad38b1c6518",
|
||||
"name": "Record Question & Answer in Response Doc",
|
||||
"type": "n8n-nodes-base.googleDocs",
|
||||
"position": [
|
||||
2940,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"actionsUi": {
|
||||
"actionFields": [
|
||||
{
|
||||
"text": "={{ $runIndex+1 }}. {{ $json.content }}\n{{ $json.output }}\n\n",
|
||||
"action": "insert"
|
||||
}
|
||||
]
|
||||
},
|
||||
"operation": "update",
|
||||
"documentURL": "={{ $('Create new RFP Response Document').item.json.id }}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDocsOAuth2Api": {
|
||||
"id": "V0G0vi1DRj7Cqbp9",
|
||||
"name": "Google Docs account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "ae8cc28f-4fd3-41d7-8a30-2675f58d1067",
|
||||
"name": "Sticky Note7",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2600,
|
||||
440
|
||||
],
|
||||
"parameters": {
|
||||
"width": 306.8994213707367,
|
||||
"height": 481.01365258903786,
|
||||
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🚨**Required**\nYou'll need to create an OpenAI Assistant to use this workflow.\n* Sign up for [OpenAI Dashboard](https://platform.openai.com) if you haven't already.\n* Create an [OpenAI Assistant](https://platform.openai.com/playground/assistants)\n* Upload the [example company doc](https://drive.google.com/file/d/16WywCYcxBgYHXB3TY3wXUTyfyG2n_BA0/view?usp=sharing) to the assistant.\n\nThe assistant will use the company doc to answer the questions."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "81825554-5cbe-469b-8511-a92d5ea165cb",
|
||||
"name": "Sticky Note8",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
3200,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 386.79263167741857,
|
||||
"height": 94.04968721739164,
|
||||
"content": "🚨**Required**\n* Update the email address to send to in Gmail Node.\n* Update the channel and message for Slack."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "25a57ca0-6789-499c-873b-07aba40530ed",
|
||||
"name": "Answer Question with Context",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
2620,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.response.text }}",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_QBI5lLKOsjktr3DRB4MwrgZd",
|
||||
"cachedResultName": "Nexus Digital Solutions Bot"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "8gccIjcuf3gvaoEr",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "1b4cc83b-a793-47c1-9dd6-0d7484db07b4",
|
||||
"name": "Wait for Request",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
823,
|
||||
278
|
||||
],
|
||||
"webhookId": "35e874df-2904-494e-a9f5-5a3f20f517f8",
|
||||
"parameters": {
|
||||
"path": "35e874df-2904-494e-a9f5-5a3f20f517f8",
|
||||
"options": {},
|
||||
"httpMethod": "POST"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2f97e3e6-c100-4045-bcb3-6fbd17cfb420",
|
||||
"name": "Extract Questions From RFP",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1960,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=You have been given a RFP document as part of a tender process of a buyer. Please extract all questions intended for the supplier. You must ensure the questions extracted are exactly has they are written in the RFP document.\n\n<RFP>{{ $('Get RFP Data').item.json.text }}<RFP>",
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "4945b975-ac84-406e-8482-44cfa5679ef9",
|
||||
"name": "Sticky Note9",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
760,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 529.9947173986736,
|
||||
"height": 157.64231937074243,
|
||||
"content": "### Example Webhook Request\ncurl --location 'https://<n8n_webhook_url>' \\\n--form 'id=\"RFP001\"' \\\n--form 'title=\"BlueChip Travel and StarBus Web Services\"' \\\n--form 'reply_to=\"jim@example.com\"' \\\n--form 'data=@\"k9pnbALxX/RFP Questionnaire.pdf\"'\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Get RFP Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Variables",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set Variables": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create new RFP Response Document",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wait for Request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get RFP Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"For Each Question...": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Email Notification",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Answer Question with Context",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Item List Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Send Email Notification": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send Chat Notification",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Extract Questions From RFP": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "For Each Question...",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Metadata to Response Doc": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Extract Questions From RFP",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Answer Question with Context": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Record Question & Answer in Response Doc",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create new RFP Response Document": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Metadata to Response Doc",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Record Question & Answer in Response Doc": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "For Each Question...",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,425 +0,0 @@
|
||||
{
|
||||
"id": "BMI5WkmyU8nZqfII",
|
||||
"meta": {
|
||||
"instanceId": "e03b0f22ca12c92061d789d5980a9bc31d9d7e7dd7513ac93c09ac5a0d147623",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "modelo do chatbot",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "c6e454af-70a1-4c65-8450-8159f7fc738b",
|
||||
"name": "If",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
160,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "7ea831a4-0e20-4725-a6f5-3dc2f41f1cf4",
|
||||
"operator": {
|
||||
"type": "object",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.leadData }}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"id": "ccb46339-4e43-42e6-aa45-d5a0cbd62214",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2221736f-ef99-4ac8-8a81-51af6d4e7dcd",
|
||||
"name": "Edit Fields1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
440,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "19a16867-b574-4b99-82f1-a86752b7fe9f",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "=\"Hello, just so you can get to know me, with no intention of a response, please save this information in your memory. My name is {{ $json.leadData.name }}. I am {{ $json.leadData.age }} years old and currently live in {{ $json.leadData.city }}, {{ $json.leadData.state }}. My profession is {{ $json.leadData.profession }}, and my education level is {{ $json.leadData.educationLevel }}.\nIf I’m part of an adhesion group and have an entity, it would be {{ $json.leadData.entity }}.\n\nI am using a {{ $json.leadData.deviceType }} device to access this through the {{ $json.leadData.channel }} channel. At the moment, I am looking for a health insurance plan of type {{ $json.leadData.quotationType }}.\""
|
||||
},
|
||||
{
|
||||
"id": "0df8d578-8332-4cde-9044-489de16ab390",
|
||||
"name": "session_id",
|
||||
"type": "string",
|
||||
"value": "={{ $json.session_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "6aa1b3a4-0e6a-4312-9d9f-f67c4bf8f443",
|
||||
"name": "Edit Fields2",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "19a16867-b574-4b99-82f1-a86752b7fe9f",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "={{ $('Chat Trigger').item.json.chatInput}}"
|
||||
},
|
||||
{
|
||||
"id": "0df8d578-8332-4cde-9044-489de16ab390",
|
||||
"name": "session_id",
|
||||
"type": "string",
|
||||
"value": "={{ $('Chat Trigger').item.json.session_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "6afe6158-7a8b-4a83-a778-6fd28e2a11af",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
600,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_numdCoMZPQ6GwfiJg5drg9hr",
|
||||
"cachedResultName": "Chat IA - Testes - Dezembro - APIS"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FW1FWHcMcwemQ1kZ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "4b961f1d-7da2-4a0b-98e3-7ec35ee14335",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-20,
|
||||
560
|
||||
],
|
||||
"webhookId": "1f83e8ac-d465-454a-8327-cef7f0149cb1",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {},
|
||||
"initialMessages": "Olá 👋\nSou Jovelino, o serviço de IA do Joov, me mande sua pergunta e responderei em seguida! :)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dccdb07f-97db-4a5a-9b09-02a5de65246e",
|
||||
"name": "Postgres Chat Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
640,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "aimessages",
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.session_id }}{{ $json.sessionId }}",
|
||||
"sessionIdType": "customKey",
|
||||
"contextWindowLength": 30
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "M1cYa0bOSX1nfczy",
|
||||
"name": "Postgres account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "553dd27b-ab06-4605-99e0-8f15735cfff3",
|
||||
"name": "Postgres Chat Memory1",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
760,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "aimessages",
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.session_id }}{{ $json.sessionId }}",
|
||||
"sessionIdType": "customKey",
|
||||
"contextWindowLength": 1
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "M1cYa0bOSX1nfczy",
|
||||
"name": "Postgres account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "0103fb97-c691-4bd3-b26d-85aaa9774594",
|
||||
"name": "Products in Daatabase",
|
||||
"type": "n8n-nodes-base.mySqlTool",
|
||||
"position": [
|
||||
1460,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT * \nFROM Products p \nWHERE \n cityQuery = '{{ $fromAI(\"cityQuery\") }}' AND \n state = '{{ $fromAI(\"state\") }}' AND \n modality = 'PME' AND \n removed = 0 AND \n ({{ $fromAI(\"holderCount\") || 1 }} + {{ $fromAI(\"dependentsCount\") || 0 }}) BETWEEN p.minLifeAmount AND p.maxLifeAmount AND\n (CASE\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 0 AND 18 THEN priceAtAge0To18\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 19 AND 23 THEN priceAtAge19To23\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 24 AND 28 THEN priceAtAge24To28\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 29 AND 33 THEN priceAtAge29To33\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 34 AND 38 THEN priceAtAge34To38\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 39 AND 43 THEN priceAtAge39To43\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 44 AND 48 THEN priceAtAge44To48\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 49 AND 53 THEN priceAtAge49To53\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 54 AND 58 THEN priceAtAge54To58\n ELSE priceAtAge59To199\n END) IS NOT NULL\nORDER BY \n (CASE\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 0 AND 18 THEN priceAtAge0To18\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 19 AND 23 THEN priceAtAge19To23\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 24 AND 28 THEN priceAtAge24To28\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 29 AND 33 THEN priceAtAge29To33\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 34 AND 38 THEN priceAtAge34To38\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 39 AND 43 THEN priceAtAge39To43\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 44 AND 48 THEN priceAtAge44To48\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 49 AND 53 THEN priceAtAge49To53\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 54 AND 58 THEN priceAtAge54To58\n ELSE priceAtAge59To199\n END) ASC, \n createdAt DESC\nLIMIT 3;\n",
|
||||
"options": {
|
||||
"detailedOutput": true
|
||||
},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "// Search for the X product bla bla bla"
|
||||
},
|
||||
"credentials": {
|
||||
"mySql": {
|
||||
"id": "lkGJt8aNB0azyaGy",
|
||||
"name": "MySQL account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.4
|
||||
},
|
||||
{
|
||||
"id": "0cdfd89f-eb9e-4b6c-90d1-1cf8d6ed96bb",
|
||||
"name": "Knowledge Base",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1340,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://quotation.joov.com.br/widget/info?modalidade={modalidade}&estado=SP&cidade={city}&operadora={operadora}",
|
||||
"toolDescription": "Here you will find the knowlegde base of my shop and bla bla bla Use this when they ask for price, whatever i want."
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "393f792a-4eff-4b33-aac0-025fc622a4b3",
|
||||
"name": "External API",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1200,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://integracao-sed-alb-323570099.us-east-1.elb.amazonaws.com/findByNameAndBirthDate",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"name\": \"{{json.name}}\",\n \"birthdate\": \"{{json.birthdate }}\"\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"toolDescription": "Pegue o nome completo em camel case, exemplo: Fernanda Melo, e a data de nacimento nesse formato: 1990-03-28"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "7ce7a5e7-6238-4479-a26f-bdcde1784188",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1160,
|
||||
414
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 436.73182569600795,
|
||||
"height": 367.7413881276459,
|
||||
"content": "TOOLS"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df6737ca-c588-48fc-9761-2a5307841298",
|
||||
"name": "OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_x2qfc7EuoPv7XGOL84ClEZ3L",
|
||||
"cachedResultName": "PINE"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FW1FWHcMcwemQ1kZ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d1dc3988-6677-47c9-b91a-6875c7b6151d",
|
||||
"connections": {
|
||||
"If": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"External API": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Knowledge Base": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory1": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Products in Daatabase": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,425 @@
|
||||
{
|
||||
"id": "BMI5WkmyU8nZqfII",
|
||||
"meta": {
|
||||
"instanceId": "e03b0f22ca12c92061d789d5980a9bc31d9d7e7dd7513ac93c09ac5a0d147623",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "modelo do chatbot",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "c6e454af-70a1-4c65-8450-8159f7fc738b",
|
||||
"name": "If",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
160,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 1,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "7ea831a4-0e20-4725-a6f5-3dc2f41f1cf4",
|
||||
"operator": {
|
||||
"type": "object",
|
||||
"operation": "exists",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json.leadData }}",
|
||||
"rightValue": ""
|
||||
},
|
||||
{
|
||||
"id": "ccb46339-4e43-42e6-aa45-d5a0cbd62214",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "2221736f-ef99-4ac8-8a81-51af6d4e7dcd",
|
||||
"name": "Edit Fields1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
440,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "19a16867-b574-4b99-82f1-a86752b7fe9f",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "=\"Hello, just so you can get to know me, with no intention of a response, please save this information in your memory. My name is {{ $json.leadData.name }}. I am {{ $json.leadData.age }} years old and currently live in {{ $json.leadData.city }}, {{ $json.leadData.state }}. My profession is {{ $json.leadData.profession }}, and my education level is {{ $json.leadData.educationLevel }}.\nIf I’m part of an adhesion group and have an entity, it would be {{ $json.leadData.entity }}.\n\nI am using a {{ $json.leadData.deviceType }} device to access this through the {{ $json.leadData.channel }} channel. At the moment, I am looking for a health insurance plan of type {{ $json.leadData.quotationType }}.\""
|
||||
},
|
||||
{
|
||||
"id": "0df8d578-8332-4cde-9044-489de16ab390",
|
||||
"name": "session_id",
|
||||
"type": "string",
|
||||
"value": "={{ $json.session_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "6aa1b3a4-0e6a-4312-9d9f-f67c4bf8f443",
|
||||
"name": "Edit Fields2",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
920,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "19a16867-b574-4b99-82f1-a86752b7fe9f",
|
||||
"name": "chatInput",
|
||||
"type": "string",
|
||||
"value": "={{ $('Chat Trigger').item.json.chatInput}}"
|
||||
},
|
||||
{
|
||||
"id": "0df8d578-8332-4cde-9044-489de16ab390",
|
||||
"name": "session_id",
|
||||
"type": "string",
|
||||
"value": "={{ $('Chat Trigger').item.json.session_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "6afe6158-7a8b-4a83-a778-6fd28e2a11af",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
600,
|
||||
960
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_numdCoMZPQ6GwfiJg5drg9hr",
|
||||
"cachedResultName": "Chat IA - Testes - Dezembro - APIS"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FW1FWHcMcwemQ1kZ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
},
|
||||
{
|
||||
"id": "4b961f1d-7da2-4a0b-98e3-7ec35ee14335",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
-20,
|
||||
560
|
||||
],
|
||||
"webhookId": "1f83e8ac-d465-454a-8327-cef7f0149cb1",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {},
|
||||
"initialMessages": "Olá 👋\nSou Jovelino, o serviço de IA do Joov, me mande sua pergunta e responderei em seguida! :)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "dccdb07f-97db-4a5a-9b09-02a5de65246e",
|
||||
"name": "Postgres Chat Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
640,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "aimessages",
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.session_id }}{{ $json.sessionId }}",
|
||||
"sessionIdType": "customKey",
|
||||
"contextWindowLength": 30
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "M1cYa0bOSX1nfczy",
|
||||
"name": "Postgres account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "553dd27b-ab06-4605-99e0-8f15735cfff3",
|
||||
"name": "Postgres Chat Memory1",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
|
||||
"position": [
|
||||
760,
|
||||
1160
|
||||
],
|
||||
"parameters": {
|
||||
"tableName": "aimessages",
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.session_id }}{{ $json.sessionId }}",
|
||||
"sessionIdType": "customKey",
|
||||
"contextWindowLength": 1
|
||||
},
|
||||
"credentials": {
|
||||
"postgres": {
|
||||
"id": "M1cYa0bOSX1nfczy",
|
||||
"name": "Postgres account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "0103fb97-c691-4bd3-b26d-85aaa9774594",
|
||||
"name": "Products in Daatabase",
|
||||
"type": "n8n-nodes-base.mySqlTool",
|
||||
"position": [
|
||||
1460,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT * \nFROM Products p \nWHERE \n cityQuery = '{{ $fromAI(\"cityQuery\") }}' AND \n state = '{{ $fromAI(\"state\") }}' AND \n modality = 'PME' AND \n removed = 0 AND \n ({{ $fromAI(\"holderCount\") || 1 }} + {{ $fromAI(\"dependentsCount\") || 0 }}) BETWEEN p.minLifeAmount AND p.maxLifeAmount AND\n (CASE\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 0 AND 18 THEN priceAtAge0To18\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 19 AND 23 THEN priceAtAge19To23\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 24 AND 28 THEN priceAtAge24To28\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 29 AND 33 THEN priceAtAge29To33\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 34 AND 38 THEN priceAtAge34To38\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 39 AND 43 THEN priceAtAge39To43\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 44 AND 48 THEN priceAtAge44To48\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 49 AND 53 THEN priceAtAge49To53\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 54 AND 58 THEN priceAtAge54To58\n ELSE priceAtAge59To199\n END) IS NOT NULL\nORDER BY \n (CASE\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 0 AND 18 THEN priceAtAge0To18\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 19 AND 23 THEN priceAtAge19To23\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 24 AND 28 THEN priceAtAge24To28\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 29 AND 33 THEN priceAtAge29To33\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 34 AND 38 THEN priceAtAge34To38\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 39 AND 43 THEN priceAtAge39To43\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 44 AND 48 THEN priceAtAge44To48\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 49 AND 53 THEN priceAtAge49To53\n WHEN {{ $fromAI(\"holderAge\") }} BETWEEN 54 AND 58 THEN priceAtAge54To58\n ELSE priceAtAge59To199\n END) ASC, \n createdAt DESC\nLIMIT 3;\n",
|
||||
"options": {
|
||||
"detailedOutput": true
|
||||
},
|
||||
"operation": "executeQuery",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "// Search for the X product bla bla bla"
|
||||
},
|
||||
"credentials": {
|
||||
"mySql": {
|
||||
"id": "lkGJt8aNB0azyaGy",
|
||||
"name": "MySQL account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.4
|
||||
},
|
||||
{
|
||||
"id": "0cdfd89f-eb9e-4b6c-90d1-1cf8d6ed96bb",
|
||||
"name": "Knowledge Base",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1340,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://quotation.joov.com.br/widget/info?modalidade={modalidade}&estado=SP&cidade={city}&operadora={operadora}",
|
||||
"toolDescription": "Here you will find the knowlegde base of my shop and bla bla bla Use this when they ask for price, whatever i want."
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "393f792a-4eff-4b33-aac0-025fc622a4b3",
|
||||
"name": "External API",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
|
||||
"position": [
|
||||
1200,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://integracao-sed-alb-323570099.us-east-1.elb.amazonaws.com/findByNameAndBirthDate",
|
||||
"method": "POST",
|
||||
"jsonBody": "={\n \"name\": \"{{json.name}}\",\n \"birthdate\": \"{{json.birthdate }}\"\n}",
|
||||
"sendBody": true,
|
||||
"specifyBody": "json",
|
||||
"toolDescription": "Pegue o nome completo em camel case, exemplo: Fernanda Melo, e a data de nacimento nesse formato: 1990-03-28"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "7ce7a5e7-6238-4479-a26f-bdcde1784188",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1160,
|
||||
414
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 436.73182569600795,
|
||||
"height": 367.7413881276459,
|
||||
"content": "TOOLS"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "df6737ca-c588-48fc-9761-2a5307841298",
|
||||
"name": "OpenAI2",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.chatInput }}",
|
||||
"prompt": "define",
|
||||
"options": {},
|
||||
"resource": "assistant",
|
||||
"assistantId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "asst_x2qfc7EuoPv7XGOL84ClEZ3L",
|
||||
"cachedResultName": "PINE"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "FW1FWHcMcwemQ1kZ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d1dc3988-6677-47c9-b91a-6875c7b6151d",
|
||||
"connections": {
|
||||
"If": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"External API": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Knowledge Base": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Postgres Chat Memory1": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Products in Daatabase": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI2",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,335 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "087ae6e2-b333-4a30-9010-c78050203961",
|
||||
"name": "OpenAI Assistant",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAiAssistant",
|
||||
"position": [
|
||||
1340,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=## Our Previous Conversation:\n{{ $json[\"messages\"].map(m => `\nHuman: ${m.human}\nAI Assistant: ${m.ai}\n`) }}\n## Current message:\n{{ $('Chat Trigger').item.json.chatInput }}",
|
||||
"options": {},
|
||||
"assistantId": "asst_HDSAnzsp4WqY4UC1iI9auH5z"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VQtv7frm7eLiEDnd",
|
||||
"name": "OpenAi account 7"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3793b10a-ebb7-42ec-8b9b-7fa3a353d9a3",
|
||||
"name": "Calculator",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
|
||||
"position": [
|
||||
1500,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7bee2882-bb9e-402e-ba42-9b1ed0e1264b",
|
||||
"name": "Chat Memory Manager",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
760,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "5c66e482-819e-47e7-90be-779e92364e2a",
|
||||
"name": "Chat Memory Manager1",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
1720,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "user",
|
||||
"message": "={{ $('Chat Trigger').item.json.chatInput }}"
|
||||
},
|
||||
{
|
||||
"type": "ai",
|
||||
"message": "={{ $json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "b96bf629-bd21-4528-8988-e63c5af89fd7",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1140,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "messages"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "95001be1-f046-47e3-a58c-25bff170ba06",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2320,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "output",
|
||||
"stringValue": "={{ $('OpenAI Assistant').item.json.output }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "4ea04793-c7fb-4b81-abf7-49590aa76ca7",
|
||||
"name": "Limit",
|
||||
"type": "n8n-nodes-base.limit",
|
||||
"position": [
|
||||
2100,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "16921f74-d420-445a-9e09-19a6116a3267",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
],
|
||||
"webhookId": "1f83e8ac-d465-454a-8327-cef7f0149cb1",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {
|
||||
"loadPreviousSession": "memory"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c0826494-779a-4c2d-93c9-746150ac9482",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
740,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 514.8706020514577,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Read contents of the chat from memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ce4594d-070a-4985-9c5d-fcd4ebc4a627",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1320,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 298.02823821086326,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Call the assistant, passing in the previous chat messages"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "49885b3b-de77-4c02-a35e-d188fee38831",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1700,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 298.02823821086326,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Add the latest chat messages to the memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f45e8589-d61b-440a-ae89-31ded2738ef7",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2080,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 356.0564764217267,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Return the model output"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3b72a676-aaa2-472a-b055-1fed03f52101",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
360,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"height": 300.48941882630095,
|
||||
"content": "## Try me out\n1. In the OpenAI Assistant node, make sure your OpenAI credentials are set and choose an assistant to use (you'll need to create one if you don't have one already)\n2. Click the 'Chat' button below\n\n - In the first message, tell the AI what your name is\n - In a second message, ask the AI what your name is"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a2250328-e4ce-4ac6-b4fe-658ab173bc28",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
1280,
|
||||
880
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.sessionId }}123",
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Limit": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI Assistant",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calculator": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI Assistant",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Memory Manager",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Assistant": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Memory Manager1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Memory Manager": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Memory Manager1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Limit",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Trigger",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Chat Memory Manager",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Chat Memory Manager1",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "087ae6e2-b333-4a30-9010-c78050203961",
|
||||
"name": "OpenAI Assistant",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAiAssistant",
|
||||
"position": [
|
||||
1340,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=## Our Previous Conversation:\n{{ $json[\"messages\"].map(m => `\nHuman: ${m.human}\nAI Assistant: ${m.ai}\n`) }}\n## Current message:\n{{ $('Chat Trigger').item.json.chatInput }}",
|
||||
"options": {},
|
||||
"assistantId": "asst_HDSAnzsp4WqY4UC1iI9auH5z"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VQtv7frm7eLiEDnd",
|
||||
"name": "OpenAi account 7"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3793b10a-ebb7-42ec-8b9b-7fa3a353d9a3",
|
||||
"name": "Calculator",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolCalculator",
|
||||
"position": [
|
||||
1500,
|
||||
640
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7bee2882-bb9e-402e-ba42-9b1ed0e1264b",
|
||||
"name": "Chat Memory Manager",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
760,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "5c66e482-819e-47e7-90be-779e92364e2a",
|
||||
"name": "Chat Memory Manager1",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryManager",
|
||||
"position": [
|
||||
1720,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "insert",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"type": "user",
|
||||
"message": "={{ $('Chat Trigger').item.json.chatInput }}"
|
||||
},
|
||||
{
|
||||
"type": "ai",
|
||||
"message": "={{ $json.output }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "b96bf629-bd21-4528-8988-e63c5af89fd7",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1140,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData",
|
||||
"destinationFieldName": "messages"
|
||||
},
|
||||
"typeVersion": 1,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "95001be1-f046-47e3-a58c-25bff170ba06",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2320,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"fields": {
|
||||
"values": [
|
||||
{
|
||||
"name": "output",
|
||||
"stringValue": "={{ $('OpenAI Assistant').item.json.output }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "4ea04793-c7fb-4b81-abf7-49590aa76ca7",
|
||||
"name": "Limit",
|
||||
"type": "n8n-nodes-base.limit",
|
||||
"position": [
|
||||
2100,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "16921f74-d420-445a-9e09-19a6116a3267",
|
||||
"name": "Chat Trigger",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
460,
|
||||
460
|
||||
],
|
||||
"webhookId": "1f83e8ac-d465-454a-8327-cef7f0149cb1",
|
||||
"parameters": {
|
||||
"public": true,
|
||||
"options": {
|
||||
"loadPreviousSession": "memory"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c0826494-779a-4c2d-93c9-746150ac9482",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
740,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 514.8706020514577,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Read contents of the chat from memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4ce4594d-070a-4985-9c5d-fcd4ebc4a627",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1320,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 298.02823821086326,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Call the assistant, passing in the previous chat messages"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "49885b3b-de77-4c02-a35e-d188fee38831",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1700,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 298.02823821086326,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Add the latest chat messages to the memory"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f45e8589-d61b-440a-ae89-31ded2738ef7",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2080,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 356.0564764217267,
|
||||
"height": 196.64941360686112,
|
||||
"content": "Return the model output"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3b72a676-aaa2-472a-b055-1fed03f52101",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
360,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"height": 300.48941882630095,
|
||||
"content": "## Try me out\n1. In the OpenAI Assistant node, make sure your OpenAI credentials are set and choose an assistant to use (you'll need to create one if you don't have one already)\n2. Click the 'Chat' button below\n\n - In the first message, tell the AI what your name is\n - In a second message, ask the AI what your name is"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a2250328-e4ce-4ac6-b4fe-658ab173bc28",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
1280,
|
||||
880
|
||||
],
|
||||
"parameters": {
|
||||
"sessionKey": "={{ $('Chat Trigger').item.json.sessionId }}123",
|
||||
"contextWindowLength": 20
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Limit": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI Assistant",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calculator": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI Assistant",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Memory Manager",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Assistant": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Memory Manager1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Memory Manager": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat Memory Manager1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Limit",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "Chat Trigger",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Chat Memory Manager",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Chat Memory Manager1",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
{
|
||||
"id": "af8RV5b2TWB2LclA",
|
||||
"meta": {
|
||||
"instanceId": "95f2ab28b3dabb8da5d47aa5145b95fe3845f47b20d6343dd5256b6a28ba8fab",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Chat with local LLMs using n8n and Ollama",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "475385fa-28f3-45c4-bd1a-10dde79f74f2",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
700,
|
||||
460
|
||||
],
|
||||
"webhookId": "ebdeba3f-6b4f-49f3-ba0a-8253dd226161",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "61133dc6-dcd9-44ff-85f2-5d8cc2ce813e",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
900,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "MyYvr1tcNQ4e7M6l",
|
||||
"name": "Local Ollama"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3e89571f-7c87-44c6-8cfd-4903d5e1cdc5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
160,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 485,
|
||||
"height": 473,
|
||||
"content": "## Chat with local LLMs using n8n and Ollama\nThis n8n workflow allows you to seamlessly interact with your self-hosted Large Language Models (LLMs) through a user-friendly chat interface. By connecting to Ollama, a powerful tool for managing local LLMs, you can send prompts and receive AI-generated responses directly within n8n.\n\n### How it works\n1. When chat message received: Captures the user's input from the chat interface.\n2. Chat LLM Chain: Sends the input to the Ollama server and receives the AI-generated response.\n3. Delivers the LLM's response back to the chat interface.\n\n### Set up steps\n* Make sure Ollama is installed and running on your machine before executing this workflow.\n* Edit the Ollama address if different from the default.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9345cadf-a72e-4d3d-b9f0-d670744065fe",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 368,
|
||||
"height": 258,
|
||||
"content": "## Ollama setup\n* Connect to your local Ollama, usually on http://localhost:11434\n* If running in Docker, make sure that the n8n container has access to the host's network in order to connect to Ollama. You can do this by passing `--net=host` option when starting the n8n Docker container"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eeffdd4e-6795-4ebc-84f7-87b5ac4167d9",
|
||||
"name": "Chat LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
920,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "3af03daa-e085-4774-8676-41578a4cba2d",
|
||||
"connections": {
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Chat LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
116
OpenAI_and_LLMs/Chat with local LLMs using n8n and Ollama.txt
Normal file
116
OpenAI_and_LLMs/Chat with local LLMs using n8n and Ollama.txt
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"id": "af8RV5b2TWB2LclA",
|
||||
"meta": {
|
||||
"instanceId": "95f2ab28b3dabb8da5d47aa5145b95fe3845f47b20d6343dd5256b6a28ba8fab",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Chat with local LLMs using n8n and Ollama",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "475385fa-28f3-45c4-bd1a-10dde79f74f2",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
700,
|
||||
460
|
||||
],
|
||||
"webhookId": "ebdeba3f-6b4f-49f3-ba0a-8253dd226161",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "61133dc6-dcd9-44ff-85f2-5d8cc2ce813e",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
900,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "MyYvr1tcNQ4e7M6l",
|
||||
"name": "Local Ollama"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "3e89571f-7c87-44c6-8cfd-4903d5e1cdc5",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
160,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 485,
|
||||
"height": 473,
|
||||
"content": "## Chat with local LLMs using n8n and Ollama\nThis n8n workflow allows you to seamlessly interact with your self-hosted Large Language Models (LLMs) through a user-friendly chat interface. By connecting to Ollama, a powerful tool for managing local LLMs, you can send prompts and receive AI-generated responses directly within n8n.\n\n### How it works\n1. When chat message received: Captures the user's input from the chat interface.\n2. Chat LLM Chain: Sends the input to the Ollama server and receives the AI-generated response.\n3. Delivers the LLM's response back to the chat interface.\n\n### Set up steps\n* Make sure Ollama is installed and running on your machine before executing this workflow.\n* Edit the Ollama address if different from the default.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9345cadf-a72e-4d3d-b9f0-d670744065fe",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1040,
|
||||
660
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 368,
|
||||
"height": 258,
|
||||
"content": "## Ollama setup\n* Connect to your local Ollama, usually on http://localhost:11434\n* If running in Docker, make sure that the n8n container has access to the host's network in order to connect to Ollama. You can do this by passing `--net=host` option when starting the n8n Docker container"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eeffdd4e-6795-4ebc-84f7-87b5ac4167d9",
|
||||
"name": "Chat LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
920,
|
||||
460
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "3af03daa-e085-4774-8676-41578a4cba2d",
|
||||
"connections": {
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Chat LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Chat LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
{
|
||||
"id": "wDD4XugmHIvx3KMT",
|
||||
"meta": {
|
||||
"instanceId": "149cdf730f0c143663259ddc6124c9c26e824d8d2d059973b871074cf4bda531"
|
||||
},
|
||||
"name": "Image Generation API",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d743f947-ad45-4e59-97d4-79b98eaddedb",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
260,
|
||||
-20
|
||||
],
|
||||
"webhookId": "970dd3c6-de83-46fd-9038-33c470571390",
|
||||
"parameters": {
|
||||
"path": "970dd3c6-de83-46fd-9038-33c470571390",
|
||||
"options": {},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "832e993e-69e9-475b-8322-776d88da0440",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1400,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "53044a93-375f-48f2-971d-bf765bcdb7a0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"width": 301.7420425026802,
|
||||
"height": 260.80333469825376,
|
||||
"content": "## Webhook Trigger \n**This Node starts listening to requests to the Webhook URL**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c7b3b04e-903b-4d7c-bbf1-2bc2f1b1a426",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 469.32758643852594,
|
||||
"height": 297.34454352637044,
|
||||
"content": "## Creating your Prompt-URL \n**To use this Workflow you need to append your prompt to your Webhook URL in the following way**\n\n1. Take your Webhook URL\n2. Ideate a Prompt and Replace every Space (\" \") by %20 (Url Encoding)\n3. Append \"?input=\" and right after that your encoded prompt to your url\n4. Copy paste this into a webbrowser as soon as you run the Webhook"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "473ff6e5-441a-4706-86a4-190936cc6ac1",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-54.959833265087354
|
||||
],
|
||||
"parameters": {
|
||||
"width": 522.2493371551094,
|
||||
"height": 109.59833265087394,
|
||||
"content": "## Starting the Workflow\n**To start the workflow paste the encoded URL into your webbrowser**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8874f52-ef7e-4aea-be5b-81e3276da3d2",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1120,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"prompt": "={{ $json.query.input }}",
|
||||
"options": {},
|
||||
"resource": "image"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "08c073a6-e01e-4b04-8051-502c918998c4",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1280,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"width": 329.4629595446998,
|
||||
"height": 278.4439182704484,
|
||||
"content": "## Response\n**Watch the image being rendered in your webbrowser**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "19f7e652-5417-4b02-a1f5-8796bbac25c3",
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
{
|
||||
"id": "wDD4XugmHIvx3KMT",
|
||||
"meta": {
|
||||
"instanceId": "149cdf730f0c143663259ddc6124c9c26e824d8d2d059973b871074cf4bda531"
|
||||
},
|
||||
"name": "Image Generation API",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "d743f947-ad45-4e59-97d4-79b98eaddedb",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
260,
|
||||
-20
|
||||
],
|
||||
"webhookId": "970dd3c6-de83-46fd-9038-33c470571390",
|
||||
"parameters": {
|
||||
"path": "970dd3c6-de83-46fd-9038-33c470571390",
|
||||
"options": {},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "832e993e-69e9-475b-8322-776d88da0440",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
1400,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "binary"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "53044a93-375f-48f2-971d-bf765bcdb7a0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"width": 301.7420425026802,
|
||||
"height": 260.80333469825376,
|
||||
"content": "## Webhook Trigger \n**This Node starts listening to requests to the Webhook URL**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c7b3b04e-903b-4d7c-bbf1-2bc2f1b1a426",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
180,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"width": 469.32758643852594,
|
||||
"height": 297.34454352637044,
|
||||
"content": "## Creating your Prompt-URL \n**To use this Workflow you need to append your prompt to your Webhook URL in the following way**\n\n1. Take your Webhook URL\n2. Ideate a Prompt and Replace every Space (\" \") by %20 (Url Encoding)\n3. Append \"?input=\" and right after that your encoded prompt to your url\n4. Copy paste this into a webbrowser as soon as you run the Webhook"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "473ff6e5-441a-4706-86a4-190936cc6ac1",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-54.959833265087354
|
||||
],
|
||||
"parameters": {
|
||||
"width": 522.2493371551094,
|
||||
"height": 109.59833265087394,
|
||||
"content": "## Starting the Workflow\n**To start the workflow paste the encoded URL into your webbrowser**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8874f52-ef7e-4aea-be5b-81e3276da3d2",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1120,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"prompt": "={{ $json.query.input }}",
|
||||
"options": {},
|
||||
"resource": "image"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "08c073a6-e01e-4b04-8051-502c918998c4",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1280,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"width": 329.4629595446998,
|
||||
"height": 278.4439182704484,
|
||||
"content": "## Response\n**Watch the image being rendered in your webbrowser**\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "19f7e652-5417-4b02-a1f5-8796bbac25c3",
|
||||
"connections": {
|
||||
"OpenAI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,192 +0,0 @@
|
||||
{
|
||||
"id": "6Yzmlp5xF6oHo1VW",
|
||||
"meta": {
|
||||
"instanceId": "173f55e6572798fa42ea9c5c92623a3c3308080d3fcd2bd784d26d855b1ce820"
|
||||
},
|
||||
"name": "Text to Speech (OpenAI)",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "938fedbd-e34c-40af-af2f-b9c669e1a6e9",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
380,
|
||||
380
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d59db5d-8fe6-4292-a221-a0d0194c6e0c",
|
||||
"name": "Set input text and TTS voice",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
760,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "{\n \"input_text\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\"\n}\n"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "9d54de1d-59b7-4c1f-9e88-13572da5292c",
|
||||
"name": "Send HTTP Request to OpenAI's TTS Endpoint",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1120,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/audio/speech",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"value": "tts-1"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"value": "={{ $json.input_text }}"
|
||||
},
|
||||
{
|
||||
"name": "voice",
|
||||
"value": "={{ $json.voice }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"value": "Bearer $OPENAI_API_KEY"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VokTSv2Eg5m5aDg7",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "1ce72c9c-aa6f-4a18-9d5a-3971686a51ec",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
256
|
||||
],
|
||||
"parameters": {
|
||||
"width": 273,
|
||||
"height": 339,
|
||||
"content": "## Workflow Trigger\nYou can replace this manual trigger with another trigger type as required by your use case."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eb487535-5f36-465e-aeee-e9ff62373e53",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
660,
|
||||
257
|
||||
],
|
||||
"parameters": {
|
||||
"width": 273,
|
||||
"height": 335,
|
||||
"content": "## Manually Set OpenAI TTS Configuration\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36b380bd-0703-4b60-83cb-c4ad9265864d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"width": 302,
|
||||
"height": 335,
|
||||
"content": "## Send Request to OpenAI TTS API\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ff35ff28-62b5-49c8-a657-795aa916b524",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
660,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 273,
|
||||
"height": 278,
|
||||
"content": "### Configuration Options\n- \"input_text\" is the text you would like to be turned into speech, and can be replaced with a programmatic value for your use case. Bear in mind that the maximum number of tokens per API call is 4,000.\n\n- \"voice\" is the voice used by the TTS model. The default is alloy, other options can be found here: [OpenAI TTS Docs](https://platform.openai.com/docs/guides/text-to-speech)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5f7ef80e-b5c8-41df-9411-525fafc2d910",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 299,
|
||||
"height": 278,
|
||||
"content": "### Output\nThe output returned by OpenAI's TTS endpoint is a .mp3 audio file (binary).\n\n\n### Credentials\nTo use this workflow, you'll have to configure and provide a valid OpenAI credential.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "19d67805-e208-4f0e-af44-c304e66e8ce8",
|
||||
"connections": {
|
||||
"Set input text and TTS voice": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send HTTP Request to OpenAI's TTS Endpoint",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set input text and TTS voice",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
192
OpenAI_and_LLMs/Convert text to speech with OpenAI.txt
Normal file
192
OpenAI_and_LLMs/Convert text to speech with OpenAI.txt
Normal file
@@ -0,0 +1,192 @@
|
||||
{
|
||||
"id": "6Yzmlp5xF6oHo1VW",
|
||||
"meta": {
|
||||
"instanceId": "173f55e6572798fa42ea9c5c92623a3c3308080d3fcd2bd784d26d855b1ce820"
|
||||
},
|
||||
"name": "Text to Speech (OpenAI)",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "938fedbd-e34c-40af-af2f-b9c669e1a6e9",
|
||||
"name": "When clicking \"Test workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
380,
|
||||
380
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1d59db5d-8fe6-4292-a221-a0d0194c6e0c",
|
||||
"name": "Set input text and TTS voice",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
760,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "{\n \"input_text\": \"The quick brown fox jumped over the lazy dog.\",\n \"voice\": \"alloy\"\n}\n"
|
||||
},
|
||||
"typeVersion": 3.2
|
||||
},
|
||||
{
|
||||
"id": "9d54de1d-59b7-4c1f-9e88-13572da5292c",
|
||||
"name": "Send HTTP Request to OpenAI's TTS Endpoint",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1120,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/audio/speech",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"authentication": "predefinedCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"value": "tts-1"
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"value": "={{ $json.input_text }}"
|
||||
},
|
||||
{
|
||||
"name": "voice",
|
||||
"value": "={{ $json.voice }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"value": "Bearer $OPENAI_API_KEY"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "VokTSv2Eg5m5aDg7",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.1
|
||||
},
|
||||
{
|
||||
"id": "1ce72c9c-aa6f-4a18-9d5a-3971686a51ec",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
280,
|
||||
256
|
||||
],
|
||||
"parameters": {
|
||||
"width": 273,
|
||||
"height": 339,
|
||||
"content": "## Workflow Trigger\nYou can replace this manual trigger with another trigger type as required by your use case."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "eb487535-5f36-465e-aeee-e9ff62373e53",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
660,
|
||||
257
|
||||
],
|
||||
"parameters": {
|
||||
"width": 273,
|
||||
"height": 335,
|
||||
"content": "## Manually Set OpenAI TTS Configuration\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36b380bd-0703-4b60-83cb-c4ad9265864d",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
260
|
||||
],
|
||||
"parameters": {
|
||||
"width": 302,
|
||||
"height": 335,
|
||||
"content": "## Send Request to OpenAI TTS API\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ff35ff28-62b5-49c8-a657-795aa916b524",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
660,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 273,
|
||||
"height": 278,
|
||||
"content": "### Configuration Options\n- \"input_text\" is the text you would like to be turned into speech, and can be replaced with a programmatic value for your use case. Bear in mind that the maximum number of tokens per API call is 4,000.\n\n- \"voice\" is the voice used by the TTS model. The default is alloy, other options can be found here: [OpenAI TTS Docs](https://platform.openai.com/docs/guides/text-to-speech)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5f7ef80e-b5c8-41df-9411-525fafc2d910",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1020,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 299,
|
||||
"height": 278,
|
||||
"content": "### Output\nThe output returned by OpenAI's TTS endpoint is a .mp3 audio file (binary).\n\n\n### Credentials\nTo use this workflow, you'll have to configure and provide a valid OpenAI credential.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "19d67805-e208-4f0e-af44-c304e66e8ce8",
|
||||
"connections": {
|
||||
"Set input text and TTS voice": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send HTTP Request to OpenAI's TTS Endpoint",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Test workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set input text and TTS voice",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
754
OpenAI_and_LLMs/Create a Branded AI-Powered Website Chatbot.txt
Normal file
754
OpenAI_and_LLMs/Create a Branded AI-Powered Website Chatbot.txt
Normal file
File diff suppressed because one or more lines are too long
@@ -1,290 +0,0 @@
|
||||
{
|
||||
"id": "q2MJWAqpKF2BCJkq",
|
||||
"meta": {
|
||||
"instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff"
|
||||
},
|
||||
"name": "LangChain - Example - Code Node Example",
|
||||
"tags": [
|
||||
{
|
||||
"id": "snf16n0p2UrGP838",
|
||||
"name": "LangChain - Example",
|
||||
"createdAt": "2023-09-25T16:21:55.962Z",
|
||||
"updatedAt": "2023-09-25T16:21:55.962Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ad1a920e-1048-4b58-9c4a-a0469a1f189d",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmOpenAi",
|
||||
"position": [
|
||||
900,
|
||||
628
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7dd04ecd-f169-455c-9c90-140140e37542",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"width": 432,
|
||||
"height": 237,
|
||||
"content": "## Self-coded LLM Chain Node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "05ad7d68-5dc8-42f2-8274-fcb5bdeb68cb",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
280,
|
||||
428
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "39e2fd34-3261-44a1-aa55-96f169d55aad",
|
||||
"name": "Set",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
428
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "input",
|
||||
"value": "Tell me a joke"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "42a3184c-0c62-4e79-9220-7a93e313317e",
|
||||
"name": "Set1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "input",
|
||||
"value": "What year was Einstein born?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4e2af29d-7fc4-484b-8028-1b9a84d60172",
|
||||
"name": "Chat OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
731,
|
||||
1108
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "334e9176-3a18-4838-84cb-70e8154f1a30",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
880,
|
||||
1028
|
||||
],
|
||||
"parameters": {
|
||||
"width": 320.2172923777021,
|
||||
"height": 231,
|
||||
"content": "## Self-coded Tool Node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "05e0d5c6-df18-42ba-99b6-a2b65633a14d",
|
||||
"name": "Custom - Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.code",
|
||||
"position": [
|
||||
971,
|
||||
1108
|
||||
],
|
||||
"parameters": {
|
||||
"code": {
|
||||
"supplyData": {
|
||||
"code": "console.log('Custom Wikipedia Node runs');\nconst { WikipediaQueryRun } = require('langchain/tools');\nreturn new WikipediaQueryRun();"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"output": [
|
||||
{
|
||||
"type": "ai_tool"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9c729e9a-f173-430c-8bcd-74101b614891",
|
||||
"name": "Custom - LLM Chain Node",
|
||||
"type": "@n8n/n8n-nodes-langchain.code",
|
||||
"position": [
|
||||
880,
|
||||
428
|
||||
],
|
||||
"parameters": {
|
||||
"code": {
|
||||
"execute": {
|
||||
"code": "const { PromptTemplate } = require('langchain/prompts');\n\nconst query = $input.item.json.input;\nconst prompt = PromptTemplate.fromTemplate(query);\nconst llm = await this.getInputConnectionData('ai_languageModel', 0);\nlet chain = prompt.pipe(llm);\nconst output = await chain.invoke();\nreturn [ {json: { output } } ];"
|
||||
}
|
||||
},
|
||||
"inputs": {
|
||||
"input": [
|
||||
{
|
||||
"type": "main"
|
||||
},
|
||||
{
|
||||
"type": "ai_languageModel",
|
||||
"required": true,
|
||||
"maxConnections": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputs": {
|
||||
"output": [
|
||||
{
|
||||
"type": "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6427bbf0-49a6-4810-9744-87d88151e914",
|
||||
"name": "Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "e14a709d-08fe-4ed7-903a-fb2bae80b28a",
|
||||
"connections": {
|
||||
"Set": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Custom - LLM Chain Node",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Custom - LLM Chain Node",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Custom - Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Set1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
290
OpenAI_and_LLMs/Custom LangChain agent written in JavaScript.txt
Normal file
290
OpenAI_and_LLMs/Custom LangChain agent written in JavaScript.txt
Normal file
@@ -0,0 +1,290 @@
|
||||
{
|
||||
"id": "q2MJWAqpKF2BCJkq",
|
||||
"meta": {
|
||||
"instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff"
|
||||
},
|
||||
"name": "LangChain - Example - Code Node Example",
|
||||
"tags": [
|
||||
{
|
||||
"id": "snf16n0p2UrGP838",
|
||||
"name": "LangChain - Example",
|
||||
"createdAt": "2023-09-25T16:21:55.962Z",
|
||||
"updatedAt": "2023-09-25T16:21:55.962Z"
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "ad1a920e-1048-4b58-9c4a-a0469a1f189d",
|
||||
"name": "OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmOpenAi",
|
||||
"position": [
|
||||
900,
|
||||
628
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7dd04ecd-f169-455c-9c90-140140e37542",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
800,
|
||||
340
|
||||
],
|
||||
"parameters": {
|
||||
"width": 432,
|
||||
"height": 237,
|
||||
"content": "## Self-coded LLM Chain Node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "05ad7d68-5dc8-42f2-8274-fcb5bdeb68cb",
|
||||
"name": "When clicking \"Execute Workflow\"",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
280,
|
||||
428
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "39e2fd34-3261-44a1-aa55-96f169d55aad",
|
||||
"name": "Set",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
428
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "input",
|
||||
"value": "Tell me a joke"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "42a3184c-0c62-4e79-9220-7a93e313317e",
|
||||
"name": "Set1",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "input",
|
||||
"value": "What year was Einstein born?"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4e2af29d-7fc4-484b-8028-1b9a84d60172",
|
||||
"name": "Chat OpenAI",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
731,
|
||||
1108
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "4jRB4A20cPycBqP5",
|
||||
"name": "OpenAI account - n8n"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "334e9176-3a18-4838-84cb-70e8154f1a30",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
880,
|
||||
1028
|
||||
],
|
||||
"parameters": {
|
||||
"width": 320.2172923777021,
|
||||
"height": 231,
|
||||
"content": "## Self-coded Tool Node"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "05e0d5c6-df18-42ba-99b6-a2b65633a14d",
|
||||
"name": "Custom - Wikipedia",
|
||||
"type": "@n8n/n8n-nodes-langchain.code",
|
||||
"position": [
|
||||
971,
|
||||
1108
|
||||
],
|
||||
"parameters": {
|
||||
"code": {
|
||||
"supplyData": {
|
||||
"code": "console.log('Custom Wikipedia Node runs');\nconst { WikipediaQueryRun } = require('langchain/tools');\nreturn new WikipediaQueryRun();"
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"output": [
|
||||
{
|
||||
"type": "ai_tool"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9c729e9a-f173-430c-8bcd-74101b614891",
|
||||
"name": "Custom - LLM Chain Node",
|
||||
"type": "@n8n/n8n-nodes-langchain.code",
|
||||
"position": [
|
||||
880,
|
||||
428
|
||||
],
|
||||
"parameters": {
|
||||
"code": {
|
||||
"execute": {
|
||||
"code": "const { PromptTemplate } = require('langchain/prompts');\n\nconst query = $input.item.json.input;\nconst prompt = PromptTemplate.fromTemplate(query);\nconst llm = await this.getInputConnectionData('ai_languageModel', 0);\nlet chain = prompt.pipe(llm);\nconst output = await chain.invoke();\nreturn [ {json: { output } } ];"
|
||||
}
|
||||
},
|
||||
"inputs": {
|
||||
"input": [
|
||||
{
|
||||
"type": "main"
|
||||
},
|
||||
{
|
||||
"type": "ai_languageModel",
|
||||
"required": true,
|
||||
"maxConnections": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputs": {
|
||||
"output": [
|
||||
{
|
||||
"type": "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6427bbf0-49a6-4810-9744-87d88151e914",
|
||||
"name": "Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
880,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "e14a709d-08fe-4ed7-903a-fb2bae80b28a",
|
||||
"connections": {
|
||||
"Set": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Custom - LLM Chain Node",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Custom - LLM Chain Node",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Chat OpenAI": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Custom - Wikipedia": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking \"Execute Workflow\"": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Set1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,665 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "7858a8e25b8fc4dae485c1ef345e6fe74effb1f5060433ef500b4c186c965c18"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "49ab7596-665e-4a0f-bb8b-9dc04525ce88",
|
||||
"name": "Gmail",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
2340,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"message": "={{ $json.html }}",
|
||||
"options": {},
|
||||
"subject": "Podcast Review"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "1MUdv1HbrQUFABiZ",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "40aa23f4-69d6-46e5-84a2-b46a64a3f0af",
|
||||
"name": "TaddyTopDaily",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.taddy.org/",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "query",
|
||||
"value": "=query { getTopChartsByGenres( limitPerPage:10, filterByCountry:UNITED_STATES_OF_AMERICA, taddyType:PODCASTEPISODE, genres:PODCASTSERIES_{{ $json.genre }}){ topChartsId podcastEpisodes{ uuid name audioUrl podcastSeries{ uuid name } } } }"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "X-USER-ID"
|
||||
},
|
||||
{
|
||||
"name": "X-API-KEY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "42eea23b-b09c-49ee-af5b-12abb3960390",
|
||||
"name": "Genre",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1420,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "e995cd5b-b91c-4a9d-8215-44d7dfe3f52f",
|
||||
"name": "genre",
|
||||
"type": "string",
|
||||
"value": "TECHNOLOGY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "da256fbf-ed7b-4a26-9fa8-33d1c2b717a5",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1840,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "data.getTopChartsByGenres.podcastEpisodes"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "069ab68c-dcd6-406f-8e7f-2597f62a04f5",
|
||||
"name": "Whisper Transcribe Audio",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1880,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/audio/transcriptions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"value": "whisper-1"
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"parameterType": "formBinaryData",
|
||||
"inputDataFieldName": "data"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tTOOlpAaNT3QoKbQ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "ffa67b8d-8601-4e1d-8f72-b6266e6b3327",
|
||||
"name": "Final Data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2320,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "={\n\"podcast\": \"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].podcastSeries.name }}\",\n\"name\": \"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].name.replace(/\\\"/g,'\\\"') }}\",\n \"url\":\"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].audioUrl.replace(/\"/g,'') }}\",\n\"summary\":\"{{ $json.message.content.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '<br/>').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t') }}\"\n \n}\n"
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "88cd1fa5-07ae-4dcd-b4f8-85cbf7c98d73",
|
||||
"name": "Merge Results",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1900,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return [{fields:$input.all().map(x=>x.json)}]"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4c2c80d1-750f-42f1-a0f1-343dec325b0f",
|
||||
"name": "HTML",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
2120,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n</head>\n<body>\n <table>\n <tr> \n {{ ['Podcast', 'Episode', 'Summary'].map(propname=>'<td><h4>'+propname+'</h4></td>').join('') }}\n </tr>\n {{ $json.fields.map(ep=>{ return `<tr><td>${ep.podcast}</td><td><a href=\"${ep.url}\">${ep.name}</a></td><td>${ep.summary}</td><td></td></tr>`} ) }}\n </table>\n</body>\n</html>\n\n<style>\ntr { \n border: 1px solid #000; \n padding: 8px; \n }\n.container {\n background-color: #ffffff;\n text-align: center;\n padding: 16px;\n border-radius: 8px;\n}\n\nh1 {\n color: #ff6d5a;\n font-size: 24px;\n font-weight: bold;\n padding: 8px;\n}\n\nh2 {\n color: #909399;\n font-size: 18px;\n font-weight: bold;\n padding: 8px;\n}\n</style>\n"
|
||||
},
|
||||
"executeOnce": true,
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "f1d13556-2c3a-48e5-84a1-5b82f338c6ba",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 547.952991050529,
|
||||
"height": 683.5200847858991,
|
||||
"content": "## Daily Podcast Summary\n### This workflow will summarize the content in the day's top podcasts for a certain genre, then send you the podcasts with summaries by email\n\n## Setup:\n 1. Create a free API key on Taddy here: https://taddy.org/signup/developers\n 2. Input your user number and API key into the `TaddyTopDaily` node in the header parameters X-USER-ID and X-API-KEY respectively.\n 3. Create access credentials for your Gmail as described here: https://developers.google.com/workspace/guides/create-credentials. Use the credentials from your *client_secret.json* in the `Gmail` node.\n 4. In the `Genre` node, set the genre of podcasts you want a summary for. Valid values are: TECHNOLOGY, NEWS, ARTS, COMEDY, SPORTS, FICTION, etc. Look at api.taddy.org for the full list (they will be displayed in the help docs as PODCASTSERIES_TECHNOLOGY, PODCASTSERIES_NEWS, etc.)\n 5. Enter your email address in the `Gmail` node.\n 6. Change the schedule time for sending email from `Schedule` to whichever time you want to receive the email.\n \n\n## Test:\n- Link a `Test Workflow` node in place of the `Schedule` node.\n- Hit Test Workflow.\n- Check your email for the results."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5aee7279-349e-47cd-99dc-7a32677b5a20",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1820,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"width": 651.4454343326669,
|
||||
"height": 252.64899257060446,
|
||||
"content": "### Whisper transcribes and Open AI summarizes the podcast"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f8b4a203-b27f-4a11-90ef-a7e1561219f5",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1100,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1189.7320416038633,
|
||||
"height": 249.2202456997519,
|
||||
"content": "### Get daily list of top podcasts (according to Apple charts) and download audio, then crop for OpenAI"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7045c9c8-5509-4dc0-b167-ddd4d6c90c22",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1825,
|
||||
1384
|
||||
],
|
||||
"parameters": {
|
||||
"width": 645.0210885124873,
|
||||
"height": 227.94126205257731,
|
||||
"content": "### Finally, send the email!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8dc9583b-cec3-4ac0-a74a-329f6c3b4801",
|
||||
"name": "Summarize Podcast",
|
||||
"type": "n8n-nodes-base.openAi",
|
||||
"position": [
|
||||
2140,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"prompt": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "=Summarize the major points of the following podcast: {{ $json.text }}. Start your answer by saying 'This episode focuses on', 'This episode is about', etc. Contain your answer to 3-4 paragraphs max, and focus on only key information. "
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"maxTokens": 500
|
||||
},
|
||||
"resource": "chat",
|
||||
"requestOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tTOOlpAaNT3QoKbQ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8d122f1-29f9-41ca-9c6b-b72269686fd6",
|
||||
"name": "Schedule",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
1220,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"triggerAtHour": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "67bc7a5b-8d0a-4de4-918d-410551dad4d7",
|
||||
"name": "Request Audio Crop",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1000,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.products.aspose.app/audio/cutter/api/cutter",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "1",
|
||||
"parameterType": "formBinaryData",
|
||||
"inputDataFieldName": "data"
|
||||
},
|
||||
{
|
||||
"name": "convertOption",
|
||||
"value": "{\"startTime\":\"00:08:00\",\"endTime\":\"00:24:00\",\"audioFormat\":\"mp3\"}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Accept",
|
||||
"value": "*/*("
|
||||
},
|
||||
{
|
||||
"name": "Connection",
|
||||
"value": "keep-alive"
|
||||
},
|
||||
{
|
||||
"name": "Origin",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Referer",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "empty"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Mode",
|
||||
"value": "cors"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Site",
|
||||
"value": "same-site"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "0dc62507-3fea-45d7-a0dc-e92fb8e2600f",
|
||||
"name": "Get Download Link",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1200,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.products.aspose.app/audio/cutter/api/cutter/HandleStatus?fileRequestId={{ $('Request Audio Crop').item.json.Data.FileRequestId }}",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Accept",
|
||||
"value": "application/json, text/javascript, */*; q=0.01"
|
||||
},
|
||||
{
|
||||
"name": "Connection",
|
||||
"value": "keep-alive"
|
||||
},
|
||||
{
|
||||
"name": "Origin",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Referer",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "empty"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "cors"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "same-site"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "8aa65189-2a4b-4ac4-9915-45ccd679a5da",
|
||||
"name": "Download Cut MP3",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1660,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.Data.DownloadLink }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "4e7318df-dbaa-4d9f-858d-4455ead763c1",
|
||||
"name": "Download Podcast",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
2060,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.audioUrl }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "ab4601c6-7387-4f2f-a2f3-4256f88c0b3e",
|
||||
"name": "Wait",
|
||||
"type": "n8n-nodes-base.wait",
|
||||
"position": [
|
||||
1600,
|
||||
1360
|
||||
],
|
||||
"webhookId": "bc28bc57-d9ea-430e-88db-78d088a058cb",
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a0b300b9-aaad-48f1-8319-a03700e0d298",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
920,
|
||||
1100
|
||||
],
|
||||
"parameters": {
|
||||
"width": 898.7483569555845,
|
||||
"height": 387.3779915472271,
|
||||
"content": "### Crop the podcast down before analysis"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "34ca89fe-4ed1-491f-b3b9-32e97040959b",
|
||||
"name": "If Downloads Ready",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1380,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "loose"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "49440938-0cb3-41c8-bcab-b7ad96973f77",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $input.all().map(x=>x.json.Data.DownloadLink).reduce((accumulator, currentValue) => accumulator && currentValue, true)\n}}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"looseTypeValidation": true
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Gmail",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wait": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Download Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Genre": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "TaddyTopDaily",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Genre",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Podcast",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Final Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Results",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Results": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"TaddyTopDaily": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Cut MP3": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Whisper Transcribe Audio",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Podcast": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Request Audio Crop",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Download Link": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If Downloads Ready",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Summarize Podcast": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Final Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If Downloads Ready": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Cut MP3",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Wait",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Request Audio Crop": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Download Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Whisper Transcribe Audio": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Summarize Podcast",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
665
OpenAI_and_LLMs/Daily Podcast Summary.txt
Normal file
665
OpenAI_and_LLMs/Daily Podcast Summary.txt
Normal file
@@ -0,0 +1,665 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "7858a8e25b8fc4dae485c1ef345e6fe74effb1f5060433ef500b4c186c965c18"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "49ab7596-665e-4a0f-bb8b-9dc04525ce88",
|
||||
"name": "Gmail",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
2340,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"message": "={{ $json.html }}",
|
||||
"options": {},
|
||||
"subject": "Podcast Review"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "1MUdv1HbrQUFABiZ",
|
||||
"name": "Gmail account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "40aa23f4-69d6-46e5-84a2-b46a64a3f0af",
|
||||
"name": "TaddyTopDaily",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1620,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.taddy.org/",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "query",
|
||||
"value": "=query { getTopChartsByGenres( limitPerPage:10, filterByCountry:UNITED_STATES_OF_AMERICA, taddyType:PODCASTEPISODE, genres:PODCASTSERIES_{{ $json.genre }}){ topChartsId podcastEpisodes{ uuid name audioUrl podcastSeries{ uuid name } } } }"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "X-USER-ID"
|
||||
},
|
||||
{
|
||||
"name": "X-API-KEY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "42eea23b-b09c-49ee-af5b-12abb3960390",
|
||||
"name": "Genre",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1420,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "e995cd5b-b91c-4a9d-8215-44d7dfe3f52f",
|
||||
"name": "genre",
|
||||
"type": "string",
|
||||
"value": "TECHNOLOGY"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "da256fbf-ed7b-4a26-9fa8-33d1c2b717a5",
|
||||
"name": "Split Out",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
1840,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"fieldToSplitOut": "data.getTopChartsByGenres.podcastEpisodes"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "069ab68c-dcd6-406f-8e7f-2597f62a04f5",
|
||||
"name": "Whisper Transcribe Audio",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1880,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/audio/transcriptions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "model",
|
||||
"value": "whisper-1"
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"parameterType": "formBinaryData",
|
||||
"inputDataFieldName": "data"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tTOOlpAaNT3QoKbQ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "ffa67b8d-8601-4e1d-8f72-b6266e6b3327",
|
||||
"name": "Final Data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
2320,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "raw",
|
||||
"options": {},
|
||||
"jsonOutput": "={\n\"podcast\": \"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].podcastSeries.name }}\",\n\"name\": \"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].name.replace(/\\\"/g,'\\\"') }}\",\n \"url\":\"{{ $('TaddyTopDaily').item.json.data.getTopChartsByGenres.podcastEpisodes[$itemIndex].audioUrl.replace(/\"/g,'') }}\",\n\"summary\":\"{{ $json.message.content.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '<br/>').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t') }}\"\n \n}\n"
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "88cd1fa5-07ae-4dcd-b4f8-85cbf7c98d73",
|
||||
"name": "Merge Results",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1900,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "return [{fields:$input.all().map(x=>x.json)}]"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4c2c80d1-750f-42f1-a0f1-343dec325b0f",
|
||||
"name": "HTML",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
2120,
|
||||
1440
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n</head>\n<body>\n <table>\n <tr> \n {{ ['Podcast', 'Episode', 'Summary'].map(propname=>'<td><h4>'+propname+'</h4></td>').join('') }}\n </tr>\n {{ $json.fields.map(ep=>{ return `<tr><td>${ep.podcast}</td><td><a href=\"${ep.url}\">${ep.name}</a></td><td>${ep.summary}</td><td></td></tr>`} ) }}\n </table>\n</body>\n</html>\n\n<style>\ntr { \n border: 1px solid #000; \n padding: 8px; \n }\n.container {\n background-color: #ffffff;\n text-align: center;\n padding: 16px;\n border-radius: 8px;\n}\n\nh1 {\n color: #ff6d5a;\n font-size: 24px;\n font-weight: bold;\n padding: 8px;\n}\n\nh2 {\n color: #909399;\n font-size: 18px;\n font-weight: bold;\n padding: 8px;\n}\n</style>\n"
|
||||
},
|
||||
"executeOnce": true,
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "f1d13556-2c3a-48e5-84a1-5b82f338c6ba",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 547.952991050529,
|
||||
"height": 683.5200847858991,
|
||||
"content": "## Daily Podcast Summary\n### This workflow will summarize the content in the day's top podcasts for a certain genre, then send you the podcasts with summaries by email\n\n## Setup:\n 1. Create a free API key on Taddy here: https://taddy.org/signup/developers\n 2. Input your user number and API key into the `TaddyTopDaily` node in the header parameters X-USER-ID and X-API-KEY respectively.\n 3. Create access credentials for your Gmail as described here: https://developers.google.com/workspace/guides/create-credentials. Use the credentials from your *client_secret.json* in the `Gmail` node.\n 4. In the `Genre` node, set the genre of podcasts you want a summary for. Valid values are: TECHNOLOGY, NEWS, ARTS, COMEDY, SPORTS, FICTION, etc. Look at api.taddy.org for the full list (they will be displayed in the help docs as PODCASTSERIES_TECHNOLOGY, PODCASTSERIES_NEWS, etc.)\n 5. Enter your email address in the `Gmail` node.\n 6. Change the schedule time for sending email from `Schedule` to whichever time you want to receive the email.\n \n\n## Test:\n- Link a `Test Workflow` node in place of the `Schedule` node.\n- Hit Test Workflow.\n- Check your email for the results."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5aee7279-349e-47cd-99dc-7a32677b5a20",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1820,
|
||||
1060
|
||||
],
|
||||
"parameters": {
|
||||
"width": 651.4454343326669,
|
||||
"height": 252.64899257060446,
|
||||
"content": "### Whisper transcribes and Open AI summarizes the podcast"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f8b4a203-b27f-4a11-90ef-a7e1561219f5",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1100,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"width": 1189.7320416038633,
|
||||
"height": 249.2202456997519,
|
||||
"content": "### Get daily list of top podcasts (according to Apple charts) and download audio, then crop for OpenAI"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7045c9c8-5509-4dc0-b167-ddd4d6c90c22",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1825,
|
||||
1384
|
||||
],
|
||||
"parameters": {
|
||||
"width": 645.0210885124873,
|
||||
"height": 227.94126205257731,
|
||||
"content": "### Finally, send the email!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8dc9583b-cec3-4ac0-a74a-329f6c3b4801",
|
||||
"name": "Summarize Podcast",
|
||||
"type": "n8n-nodes-base.openAi",
|
||||
"position": [
|
||||
2140,
|
||||
1120
|
||||
],
|
||||
"parameters": {
|
||||
"model": "gpt-4o-mini",
|
||||
"prompt": {
|
||||
"messages": [
|
||||
{
|
||||
"content": "=Summarize the major points of the following podcast: {{ $json.text }}. Start your answer by saying 'This episode focuses on', 'This episode is about', etc. Contain your answer to 3-4 paragraphs max, and focus on only key information. "
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"maxTokens": 500
|
||||
},
|
||||
"resource": "chat",
|
||||
"requestOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "tTOOlpAaNT3QoKbQ",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e8d122f1-29f9-41ca-9c6b-b72269686fd6",
|
||||
"name": "Schedule",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
1220,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"triggerAtHour": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "67bc7a5b-8d0a-4de4-918d-410551dad4d7",
|
||||
"name": "Request Audio Crop",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1000,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.products.aspose.app/audio/cutter/api/cutter",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"sendBody": true,
|
||||
"contentType": "multipart-form-data",
|
||||
"sendHeaders": true,
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "1",
|
||||
"parameterType": "formBinaryData",
|
||||
"inputDataFieldName": "data"
|
||||
},
|
||||
{
|
||||
"name": "convertOption",
|
||||
"value": "{\"startTime\":\"00:08:00\",\"endTime\":\"00:24:00\",\"audioFormat\":\"mp3\"}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Accept",
|
||||
"value": "*/*("
|
||||
},
|
||||
{
|
||||
"name": "Connection",
|
||||
"value": "keep-alive"
|
||||
},
|
||||
{
|
||||
"name": "Origin",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Referer",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "empty"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Mode",
|
||||
"value": "cors"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Site",
|
||||
"value": "same-site"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "0dc62507-3fea-45d7-a0dc-e92fb8e2600f",
|
||||
"name": "Get Download Link",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1200,
|
||||
1220
|
||||
],
|
||||
"parameters": {
|
||||
"url": "=https://api.products.aspose.app/audio/cutter/api/cutter/HandleStatus?fileRequestId={{ $('Request Audio Crop').item.json.Data.FileRequestId }}",
|
||||
"options": {},
|
||||
"sendHeaders": true,
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Accept",
|
||||
"value": "application/json, text/javascript, */*; q=0.01"
|
||||
},
|
||||
{
|
||||
"name": "Connection",
|
||||
"value": "keep-alive"
|
||||
},
|
||||
{
|
||||
"name": "Origin",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Referer",
|
||||
"value": "https://products.aspose.app"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "empty"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "cors"
|
||||
},
|
||||
{
|
||||
"name": "Sec-Fetch-Dest",
|
||||
"value": "same-site"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "8aa65189-2a4b-4ac4-9915-45ccd679a5da",
|
||||
"name": "Download Cut MP3",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1660,
|
||||
1140
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.Data.DownloadLink }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "4e7318df-dbaa-4d9f-858d-4455ead763c1",
|
||||
"name": "Download Podcast",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
2060,
|
||||
820
|
||||
],
|
||||
"parameters": {
|
||||
"url": "={{ $json.audioUrl }}",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "ab4601c6-7387-4f2f-a2f3-4256f88c0b3e",
|
||||
"name": "Wait",
|
||||
"type": "n8n-nodes-base.wait",
|
||||
"position": [
|
||||
1600,
|
||||
1360
|
||||
],
|
||||
"webhookId": "bc28bc57-d9ea-430e-88db-78d088a058cb",
|
||||
"parameters": {},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a0b300b9-aaad-48f1-8319-a03700e0d298",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
920,
|
||||
1100
|
||||
],
|
||||
"parameters": {
|
||||
"width": 898.7483569555845,
|
||||
"height": 387.3779915472271,
|
||||
"content": "### Crop the podcast down before analysis"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "34ca89fe-4ed1-491f-b3b9-32e97040959b",
|
||||
"name": "If Downloads Ready",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
1380,
|
||||
1180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "loose"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "49440938-0cb3-41c8-bcab-b7ad96973f77",
|
||||
"operator": {
|
||||
"type": "boolean",
|
||||
"operation": "true",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $input.all().map(x=>x.json.Data.DownloadLink).reduce((accumulator, currentValue) => accumulator && currentValue, true)\n}}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"looseTypeValidation": true
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Gmail",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Wait": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Download Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Genre": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "TaddyTopDaily",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Schedule": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Genre",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Podcast",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Final Data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Results",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Results": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"TaddyTopDaily": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Cut MP3": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Whisper Transcribe Audio",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Download Podcast": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Request Audio Crop",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Download Link": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "If Downloads Ready",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Summarize Podcast": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Final Data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"If Downloads Ready": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Download Cut MP3",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Wait",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Request Audio Crop": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Download Link",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Whisper Transcribe Audio": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Summarize Podcast",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,245 +0,0 @@
|
||||
{
|
||||
"id": "jAML9xW28lOdsObH",
|
||||
"meta": {
|
||||
"instanceId": "be04c66ddabda64dad2c5d4c4611c3879370cfcff746359dfed22dbbfaacfc1a",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Daily meetings summarization with Gemini AI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "2f5c6f8b-023a-4fc0-8684-66d7f743af0a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
100,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 217.47708894878716,
|
||||
"height": 233,
|
||||
"content": "### Gemini Flash model a base"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8c159251-d78c-4f18-a886-b930194e6459",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 223.7196765498655,
|
||||
"height": 236.66152029520293,
|
||||
"content": "### Send the response from AI back to slack channel\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ee7164d8-f257-4e47-9867-239440153fd4",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 561,
|
||||
"height": 360,
|
||||
"content": "## Trigger the task daily, receive the meetings data, process the data and return response for sending\n\n\n\n\n\n\n\n\n\n\n\nNo memory assigned to the model since the model is running one task and doesn't need a followup, then send the data to the user."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "30ac78b7-08ba-4df9-a67c-e6825a9de380",
|
||||
"name": "Send response back to slack channel",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
660,
|
||||
100
|
||||
],
|
||||
"webhookId": "636ae330-cc22-408b-b6a5-caf02e48897f",
|
||||
"parameters": {
|
||||
"text": "=Gemini : {{ $json.output.removeMarkdown() }} ",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "C07QMTJHR0A",
|
||||
"cachedResultName": "ai-chat-gemini"
|
||||
},
|
||||
"otherOptions": {
|
||||
"mrkdwn": true,
|
||||
"includeLinkToWorkflow": false
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "DFQMzAsWKIdZFCR4",
|
||||
"name": "Slack account - iKemo"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "938738d6-1e2e-4e93-a5bf-70d11fd4fd32",
|
||||
"name": "Google Calendar - Get Events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
400,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"timeMax": "={{ $fromAI('end_date') }}",
|
||||
"timeMin": "={{ $fromAI('start_date') }}"
|
||||
},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "john@iKemo.io",
|
||||
"cachedResultName": "john@iKemo.io"
|
||||
},
|
||||
"operation": "getAll",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this tool when you’re asked to retrieve events data."
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "R2W7XHvEyQgyykI0",
|
||||
"name": "Google Calendar - John"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "2290c30e-9e9f-471a-a882-df6856a1dd9d",
|
||||
"name": "Calendar AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
240,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=summarize today's meetings.\nstartdate = {{ $now.format('yyyy-MM-dd 00:00:00') }}\nenddate = {{ $now.format('yyyy-MM-dd 23:59:59') }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a Google Calendar assistant.\nYour primary goal is to assist the user in managing their calendar effectively using Event Retrieval tool. \nAlways base your responses on the current date: \n{{ DateTime.local().toFormat('cccc d LLLL yyyy') }}.\nGeneral Guidelines:\nAlways mention all meetings attendees\nTool: Event Retrieval\nFormat the date range:\nstart_date: Start date and time in YYYY-MM-DD HH:mm:ss.\nend_date: End date and time in YYYY-MM-DD HH:mm:ss.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "dd63bab9-0f95-4b84-8bbd-26a1f91fe635",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
20,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"triggerAtHour": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "06b9ecd2-83e0-498f-ad79-fbc89242a6f0",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 221.73584905660368,
|
||||
"height": 233,
|
||||
"content": "### Access Google Calendar and fetch all the data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "48679508-2af8-4507-80a9-fc0aad171169",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
160,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash-latest"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "3BBJHhMKD8W8VfL4",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "e517b214-b0e5-4119-8aaf-77ee0655dd78",
|
||||
"connections": {
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calendar AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send response back to slack channel",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Get Events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
245
OpenAI_and_LLMs/Daily meetings summarization with Gemini AI.txt
Normal file
245
OpenAI_and_LLMs/Daily meetings summarization with Gemini AI.txt
Normal file
@@ -0,0 +1,245 @@
|
||||
{
|
||||
"id": "jAML9xW28lOdsObH",
|
||||
"meta": {
|
||||
"instanceId": "be04c66ddabda64dad2c5d4c4611c3879370cfcff746359dfed22dbbfaacfc1a",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Daily meetings summarization with Gemini AI",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "2f5c6f8b-023a-4fc0-8684-66d7f743af0a",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
100,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 217.47708894878716,
|
||||
"height": 233,
|
||||
"content": "### Gemini Flash model a base"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8c159251-d78c-4f18-a886-b930194e6459",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
600,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 223.7196765498655,
|
||||
"height": 236.66152029520293,
|
||||
"content": "### Send the response from AI back to slack channel\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "ee7164d8-f257-4e47-9867-239440153fd4",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 561,
|
||||
"height": 360,
|
||||
"content": "## Trigger the task daily, receive the meetings data, process the data and return response for sending\n\n\n\n\n\n\n\n\n\n\n\nNo memory assigned to the model since the model is running one task and doesn't need a followup, then send the data to the user."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "30ac78b7-08ba-4df9-a67c-e6825a9de380",
|
||||
"name": "Send response back to slack channel",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
660,
|
||||
100
|
||||
],
|
||||
"webhookId": "636ae330-cc22-408b-b6a5-caf02e48897f",
|
||||
"parameters": {
|
||||
"text": "=Gemini : {{ $json.output.removeMarkdown() }} ",
|
||||
"select": "channel",
|
||||
"channelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "C07QMTJHR0A",
|
||||
"cachedResultName": "ai-chat-gemini"
|
||||
},
|
||||
"otherOptions": {
|
||||
"mrkdwn": true,
|
||||
"includeLinkToWorkflow": false
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": {
|
||||
"id": "DFQMzAsWKIdZFCR4",
|
||||
"name": "Slack account - iKemo"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "938738d6-1e2e-4e93-a5bf-70d11fd4fd32",
|
||||
"name": "Google Calendar - Get Events",
|
||||
"type": "n8n-nodes-base.googleCalendarTool",
|
||||
"position": [
|
||||
400,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"timeMax": "={{ $fromAI('end_date') }}",
|
||||
"timeMin": "={{ $fromAI('start_date') }}"
|
||||
},
|
||||
"calendar": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "john@iKemo.io",
|
||||
"cachedResultName": "john@iKemo.io"
|
||||
},
|
||||
"operation": "getAll",
|
||||
"descriptionType": "manual",
|
||||
"toolDescription": "Use this tool when you’re asked to retrieve events data."
|
||||
},
|
||||
"credentials": {
|
||||
"googleCalendarOAuth2Api": {
|
||||
"id": "R2W7XHvEyQgyykI0",
|
||||
"name": "Google Calendar - John"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "2290c30e-9e9f-471a-a882-df6856a1dd9d",
|
||||
"name": "Calendar AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
240,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=summarize today's meetings.\nstartdate = {{ $now.format('yyyy-MM-dd 00:00:00') }}\nenddate = {{ $now.format('yyyy-MM-dd 23:59:59') }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are a Google Calendar assistant.\nYour primary goal is to assist the user in managing their calendar effectively using Event Retrieval tool. \nAlways base your responses on the current date: \n{{ DateTime.local().toFormat('cccc d LLLL yyyy') }}.\nGeneral Guidelines:\nAlways mention all meetings attendees\nTool: Event Retrieval\nFormat the date range:\nstart_date: Start date and time in YYYY-MM-DD HH:mm:ss.\nend_date: End date and time in YYYY-MM-DD HH:mm:ss.\n"
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "dd63bab9-0f95-4b84-8bbd-26a1f91fe635",
|
||||
"name": "Schedule Trigger",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"position": [
|
||||
20,
|
||||
100
|
||||
],
|
||||
"parameters": {
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"triggerAtHour": 9
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "06b9ecd2-83e0-498f-ad79-fbc89242a6f0",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 221.73584905660368,
|
||||
"height": 233,
|
||||
"content": "### Access Google Calendar and fetch all the data"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "48679508-2af8-4507-80a9-fc0aad171169",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
160,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash-latest"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "3BBJHhMKD8W8VfL4",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "e517b214-b0e5-4119-8aaf-77ee0655dd78",
|
||||
"connections": {
|
||||
"Schedule Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calendar AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send response back to slack channel",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Calendar - Get Events": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "Calendar AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,478 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "6e361bfcd1e8378c9b07774b22409c7eaea7080f01d5248da45077c0c6108b99",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "cbc036f7-b0e1-4eb4-94c3-7571c67a1efe",
|
||||
"name": "Code",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-120,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "// Get the input text\nconst text = $input.item.json.text;\n\n// Ensure text is not null or undefined\nif (!text) {\n throw new Error('Input text is empty');\n}\n\n// Function to split text into sentences while preserving dates and list items\nfunction splitIntoSentences(text) {\n const monthNames = '(?:Januar|Februar|März|April|Mai|Juni|Juli|August|September|Oktober|November|Dezember)';\n const datePattern = `(?:\\\\d{1,2}\\\\.\\\\s*(?:${monthNames}|\\\\d{1,2}\\\\.)\\\\s*\\\\d{2,4})`;\n \n // Split by sentence-ending punctuation, but not within dates or list items\n const regex = new RegExp(`(?<=[.!?])\\\\s+(?=[A-ZÄÖÜ]|$)(?!${datePattern}|\\\\s*[-•]\\\\s)`, 'g');\n \n return text.split(regex)\n .map(sentence => sentence.trim())\n .filter(sentence => sentence !== '');\n}\n\n// Split the text into sentences\nconst sentences = splitIntoSentences(text);\n\n// Output a single object with an array of sentences\nreturn { json: { sentences: sentences } };"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "faae4740-a529-4275-be0e-b079c3bfde58",
|
||||
"name": "Split Out1",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
340,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"destinationFieldName": "claim"
|
||||
},
|
||||
"fieldToSplitOut": "sentences"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c3944f89-e267-4df0-8fc4-9281eac4e759",
|
||||
"name": "Basic LLM Chain4",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
640,
|
||||
-40
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Document: {{ $('Merge1').item.json.facts }}\nClaim: {{ $json.claim }}",
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "4e53c7f1-ab9f-42be-a253-9328b209fc68",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
700,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": "bespoke-minicheck:latest",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "DeuK54dDNrCCnXHl",
|
||||
"name": "Ollama account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0252e47e-0e50-4024-92a0-74b554c8cbd1",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-760,
|
||||
40
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8dd3f67c-e36f-4b03-8f9f-9b52ea23e0ed",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-460,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "55748f38-486f-495f-91ec-02c1d49acf18",
|
||||
"name": "facts",
|
||||
"type": "string",
|
||||
"value": "Sara Beery came to MIT as an assistant professor in MIT’s Department of Electrical Engineering and Computer Science (EECS) eager to focus on ecological challenges. She has fashioned her research career around the opportunity to apply her expertise in computer vision, machine learning, and data science to tackle real-world issues in conservation and sustainability. Beery was drawn to the Institute’s commitment to “computing for the planet,” and set out to bring her methods to global-scale environmental and biodiversity monitoring.\n\nIn the Pacific Northwest, salmon have a disproportionate impact on the health of their ecosystems, and their complex reproductive needs have attracted Beery’s attention. Each year, millions of salmon embark on a migration to spawn. Their journey begins in freshwater stream beds where the eggs hatch. Young salmon fry (newly hatched salmon) make their way to the ocean, where they spend several years maturing to adulthood. As adults, the salmon return to the streams where they were born in order to spawn, ensuring the continuation of their species by depositing their eggs in the gravel of the stream beds. Both male and female salmon die shortly after supplying the river habitat with the next generation of salmon."
|
||||
},
|
||||
{
|
||||
"id": "7d8e29db-4a4b-47c5-8c93-fda1e72137a7",
|
||||
"name": "text",
|
||||
"type": "string",
|
||||
"value": "MIT's AI Pioneer Tackles Salmon Conservation Professor Sara Beery, a rising star in MIT's Department of Electrical Engineering and Computer Science, is revolutionizing ecological conservation through cutting-edge technology. Specializing in computer vision, machine learning, and data science, Beery has set her sights on addressing real-world sustainability challenges. Her current focus? The vital salmon populations of the Pacific Northwest. These fish play a crucial role in their ecosystems, with their complex life cycle spanning from freshwater streams to the open ocean and back again. Beery's innovative approach uses AI to monitor salmon migration patterns, providing unprecedented insights into their behavior and habitat needs. Beery's work has led to the development of underwater AI cameras that can distinguish between different salmon species with 99.9% accuracy. Her team has also created a revolutionary \"salmon translator\" that can predict spawning locations based on fish vocalizations. As climate change threatens these delicate ecosystems, Beery's research offers hope for more effective conservation strategies. By harnessing the power of technology, she's not just studying nature – she's actively working to preserve it for future generations."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "25849b47-1550-464c-9e70-e787712e5765",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1120,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "eaea7ef4-a5d5-42b8-b262-e9a4bd6b7281",
|
||||
"name": "Filter",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
1340,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "20a4ffd6-0dd0-44f9-97bc-7d891f689f4d",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.text }}",
|
||||
"rightValue": "No"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "9f074bdb-b1a6-4c36-be1c-203f78092657",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-760,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "facts"
|
||||
},
|
||||
{
|
||||
"name": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "0a08ac40-b497-4f6e-ac2c-2213a00d63f2",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1560,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b0d79886-01fc-43c7-88fe-a7a5b8b56b35",
|
||||
"name": "Merge1",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
80,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "82640408-9db4-4a12-9136-1a22985b609b",
|
||||
"name": "Basic LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1780,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.data }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "You are a fact-checking assistant. Your task is to analyze a list of statements, each accompanied by a \"yes\" or \"no\" indicating whether the statement is correct. Follow these guidelines:\n\n1. Review Process:\n a) Carefully read through each statement and its corresponding yes/no answer.\n b) Identify which statements are marked as incorrect (no).\n c) Ignore chit-chat sentences or statements that don't contain factual information.\n d) Count the total number of incorrect factual statements.\n\n2. Statement Classification:\n - Factual Statements: Contains specific information, data, or claims that can be verified.\n - Chit-chat/Non-factual: General comments, introductions, or transitions that don't present verifiable facts.\n\n3. Summary Structure:\n a) Overview: Provide a brief summary of the number of factual errors found.\n b) List of Problems: Enumerate the incorrect factual statements.\n c) Final Assessment: Offer a concise evaluation of the overall state of the article's factual accuracy.\n\n4. Prioritization:\n - Focus only on the factual statements marked as incorrect (no).\n - Ignore statements marked as correct (yes) and non-factual chit-chat.\n\n5. Feedback Tone:\n - Maintain a neutral and objective tone.\n - Present the information factually without additional commentary.\n\n6. Output Format:\n Present your summary in the following structure:\n\n ## Problem Summary\n [Number] incorrect factual statements were identified in the article.\n\n ## List of Incorrect Factual Statements\n 1. [First incorrect factual statement]\n 2. [Second incorrect factual statement]\n 3. [Third incorrect factual statement]\n (Continue listing all incorrect factual statements)\n\n ## Final Assessment\n Based on the number of incorrect factual statements:\n - If 0-1 errors: The article appears to be highly accurate and may only need minor factual adjustments.\n - If 2-3 errors: The article requires some revision to address these factual inaccuracies.\n - If 4 or more errors: The article needs significant revision to improve its factual accuracy.\n\nRemember, your role is to provide a clear, concise summary of the incorrect factual statements to help the writing team quickly understand what needs to be addressed. Ignore any chit-chat or non-factual statements in your analysis and summary."
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "719054ef-0863-4e52-8390-23313c750aac",
|
||||
"name": "Ollama Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmOllama",
|
||||
"position": [
|
||||
1880,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"model": "qwen2.5:1.5b",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "DeuK54dDNrCCnXHl",
|
||||
"name": "Ollama account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6595eb25-32ce-49f5-a013-b87d7f3c65d3",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1480,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 860,
|
||||
"height": 600,
|
||||
"content": "## Build a summary\n\nThis is useful to run it in an agentic workflow. You may remove the summary part and return the raw array with the found issues."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9f6cde97-d2a7-44e4-b715-321ec1e68bd3",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 760,
|
||||
"height": 600,
|
||||
"content": "## Split into sentences"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1ceb8f3c-c00b-4496-82b2-20578550c4be",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 920,
|
||||
"height": 600,
|
||||
"content": "## Fact checking\n\nThis use a small ollama model that is specialized on that task: https://ollama.com/library/bespoke-minicheck\n\nYou have to install it before use with `ollama pull bespoke-minicheck`."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6e340925-d4e5-4fe1-ba9d-a89a23b68226",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-860,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"width": 600,
|
||||
"height": 300,
|
||||
"content": "## Test workflow\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5561d606-93d2-4887-839d-8ce2230ff30c",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-860,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 600,
|
||||
"height": 280,
|
||||
"content": "## Entrypoint to use in other workflows\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Filter": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Basic LLM Chain4",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain4": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain4",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,478 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "6e361bfcd1e8378c9b07774b22409c7eaea7080f01d5248da45077c0c6108b99",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "cbc036f7-b0e1-4eb4-94c3-7571c67a1efe",
|
||||
"name": "Code",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-120,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "// Get the input text\nconst text = $input.item.json.text;\n\n// Ensure text is not null or undefined\nif (!text) {\n throw new Error('Input text is empty');\n}\n\n// Function to split text into sentences while preserving dates and list items\nfunction splitIntoSentences(text) {\n const monthNames = '(?:Januar|Februar|März|April|Mai|Juni|Juli|August|September|Oktober|November|Dezember)';\n const datePattern = `(?:\\\\d{1,2}\\\\.\\\\s*(?:${monthNames}|\\\\d{1,2}\\\\.)\\\\s*\\\\d{2,4})`;\n \n // Split by sentence-ending punctuation, but not within dates or list items\n const regex = new RegExp(`(?<=[.!?])\\\\s+(?=[A-ZÄÖÜ]|$)(?!${datePattern}|\\\\s*[-•]\\\\s)`, 'g');\n \n return text.split(regex)\n .map(sentence => sentence.trim())\n .filter(sentence => sentence !== '');\n}\n\n// Split the text into sentences\nconst sentences = splitIntoSentences(text);\n\n// Output a single object with an array of sentences\nreturn { json: { sentences: sentences } };"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "faae4740-a529-4275-be0e-b079c3bfde58",
|
||||
"name": "Split Out1",
|
||||
"type": "n8n-nodes-base.splitOut",
|
||||
"position": [
|
||||
340,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"destinationFieldName": "claim"
|
||||
},
|
||||
"fieldToSplitOut": "sentences"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "c3944f89-e267-4df0-8fc4-9281eac4e759",
|
||||
"name": "Basic LLM Chain4",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
640,
|
||||
-40
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Document: {{ $('Merge1').item.json.facts }}\nClaim: {{ $json.claim }}",
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "4e53c7f1-ab9f-42be-a253-9328b209fc68",
|
||||
"name": "Ollama Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
|
||||
"position": [
|
||||
700,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"model": "bespoke-minicheck:latest",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "DeuK54dDNrCCnXHl",
|
||||
"name": "Ollama account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0252e47e-0e50-4024-92a0-74b554c8cbd1",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
-760,
|
||||
40
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8dd3f67c-e36f-4b03-8f9f-9b52ea23e0ed",
|
||||
"name": "Edit Fields",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-460,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "55748f38-486f-495f-91ec-02c1d49acf18",
|
||||
"name": "facts",
|
||||
"type": "string",
|
||||
"value": "Sara Beery came to MIT as an assistant professor in MIT’s Department of Electrical Engineering and Computer Science (EECS) eager to focus on ecological challenges. She has fashioned her research career around the opportunity to apply her expertise in computer vision, machine learning, and data science to tackle real-world issues in conservation and sustainability. Beery was drawn to the Institute’s commitment to “computing for the planet,” and set out to bring her methods to global-scale environmental and biodiversity monitoring.\n\nIn the Pacific Northwest, salmon have a disproportionate impact on the health of their ecosystems, and their complex reproductive needs have attracted Beery’s attention. Each year, millions of salmon embark on a migration to spawn. Their journey begins in freshwater stream beds where the eggs hatch. Young salmon fry (newly hatched salmon) make their way to the ocean, where they spend several years maturing to adulthood. As adults, the salmon return to the streams where they were born in order to spawn, ensuring the continuation of their species by depositing their eggs in the gravel of the stream beds. Both male and female salmon die shortly after supplying the river habitat with the next generation of salmon."
|
||||
},
|
||||
{
|
||||
"id": "7d8e29db-4a4b-47c5-8c93-fda1e72137a7",
|
||||
"name": "text",
|
||||
"type": "string",
|
||||
"value": "MIT's AI Pioneer Tackles Salmon Conservation Professor Sara Beery, a rising star in MIT's Department of Electrical Engineering and Computer Science, is revolutionizing ecological conservation through cutting-edge technology. Specializing in computer vision, machine learning, and data science, Beery has set her sights on addressing real-world sustainability challenges. Her current focus? The vital salmon populations of the Pacific Northwest. These fish play a crucial role in their ecosystems, with their complex life cycle spanning from freshwater streams to the open ocean and back again. Beery's innovative approach uses AI to monitor salmon migration patterns, providing unprecedented insights into their behavior and habitat needs. Beery's work has led to the development of underwater AI cameras that can distinguish between different salmon species with 99.9% accuracy. Her team has also created a revolutionary \"salmon translator\" that can predict spawning locations based on fish vocalizations. As climate change threatens these delicate ecosystems, Beery's research offers hope for more effective conservation strategies. By harnessing the power of technology, she's not just studying nature – she's actively working to preserve it for future generations."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "25849b47-1550-464c-9e70-e787712e5765",
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1120,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "eaea7ef4-a5d5-42b8-b262-e9a4bd6b7281",
|
||||
"name": "Filter",
|
||||
"type": "n8n-nodes-base.filter",
|
||||
"position": [
|
||||
1340,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "20a4ffd6-0dd0-44f9-97bc-7d891f689f4d",
|
||||
"operator": {
|
||||
"name": "filter.operator.equals",
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
},
|
||||
"leftValue": "={{ $json.text }}",
|
||||
"rightValue": "No"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "9f074bdb-b1a6-4c36-be1c-203f78092657",
|
||||
"name": "When Executed by Another Workflow",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
-760,
|
||||
-200
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "facts"
|
||||
},
|
||||
{
|
||||
"name": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "0a08ac40-b497-4f6e-ac2c-2213a00d63f2",
|
||||
"name": "Aggregate",
|
||||
"type": "n8n-nodes-base.aggregate",
|
||||
"position": [
|
||||
1560,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"aggregate": "aggregateAllItemData"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "b0d79886-01fc-43c7-88fe-a7a5b8b56b35",
|
||||
"name": "Merge1",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
80,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "82640408-9db4-4a12-9136-1a22985b609b",
|
||||
"name": "Basic LLM Chain",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1780,
|
||||
-160
|
||||
],
|
||||
"parameters": {
|
||||
"text": "={{ $json.data }}",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "You are a fact-checking assistant. Your task is to analyze a list of statements, each accompanied by a \"yes\" or \"no\" indicating whether the statement is correct. Follow these guidelines:\n\n1. Review Process:\n a) Carefully read through each statement and its corresponding yes/no answer.\n b) Identify which statements are marked as incorrect (no).\n c) Ignore chit-chat sentences or statements that don't contain factual information.\n d) Count the total number of incorrect factual statements.\n\n2. Statement Classification:\n - Factual Statements: Contains specific information, data, or claims that can be verified.\n - Chit-chat/Non-factual: General comments, introductions, or transitions that don't present verifiable facts.\n\n3. Summary Structure:\n a) Overview: Provide a brief summary of the number of factual errors found.\n b) List of Problems: Enumerate the incorrect factual statements.\n c) Final Assessment: Offer a concise evaluation of the overall state of the article's factual accuracy.\n\n4. Prioritization:\n - Focus only on the factual statements marked as incorrect (no).\n - Ignore statements marked as correct (yes) and non-factual chit-chat.\n\n5. Feedback Tone:\n - Maintain a neutral and objective tone.\n - Present the information factually without additional commentary.\n\n6. Output Format:\n Present your summary in the following structure:\n\n ## Problem Summary\n [Number] incorrect factual statements were identified in the article.\n\n ## List of Incorrect Factual Statements\n 1. [First incorrect factual statement]\n 2. [Second incorrect factual statement]\n 3. [Third incorrect factual statement]\n (Continue listing all incorrect factual statements)\n\n ## Final Assessment\n Based on the number of incorrect factual statements:\n - If 0-1 errors: The article appears to be highly accurate and may only need minor factual adjustments.\n - If 2-3 errors: The article requires some revision to address these factual inaccuracies.\n - If 4 or more errors: The article needs significant revision to improve its factual accuracy.\n\nRemember, your role is to provide a clear, concise summary of the incorrect factual statements to help the writing team quickly understand what needs to be addressed. Ignore any chit-chat or non-factual statements in your analysis and summary."
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define"
|
||||
},
|
||||
"typeVersion": 1.5
|
||||
},
|
||||
{
|
||||
"id": "719054ef-0863-4e52-8390-23313c750aac",
|
||||
"name": "Ollama Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmOllama",
|
||||
"position": [
|
||||
1880,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"model": "qwen2.5:1.5b",
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"ollamaApi": {
|
||||
"id": "DeuK54dDNrCCnXHl",
|
||||
"name": "Ollama account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6595eb25-32ce-49f5-a013-b87d7f3c65d3",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1480,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 860,
|
||||
"height": 600,
|
||||
"content": "## Build a summary\n\nThis is useful to run it in an agentic workflow. You may remove the summary part and return the raw array with the found issues."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "9f6cde97-d2a7-44e4-b715-321ec1e68bd3",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-240,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 760,
|
||||
"height": 600,
|
||||
"content": "## Split into sentences"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1ceb8f3c-c00b-4496-82b2-20578550c4be",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
540,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 920,
|
||||
"height": 600,
|
||||
"content": "## Fact checking\n\nThis use a small ollama model that is specialized on that task: https://ollama.com/library/bespoke-minicheck\n\nYou have to install it before use with `ollama pull bespoke-minicheck`."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "6e340925-d4e5-4fe1-ba9d-a89a23b68226",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-860,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"width": 600,
|
||||
"height": 300,
|
||||
"content": "## Test workflow\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5561d606-93d2-4887-839d-8ce2230ff30c",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-860,
|
||||
-320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 600,
|
||||
"height": 280,
|
||||
"content": "## Entrypoint to use in other workflows\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Code": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Filter",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Filter": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Aggregate",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Out1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Aggregate": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Out1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Basic LLM Chain4",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Edit Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Basic LLM Chain4": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ollama Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Basic LLM Chain4",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When Executed by Another Workflow": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Code",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Edit Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
{
|
||||
"id": "eXiaTDyKfXpMeyLh",
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Dynamically generate HTML page from user request using OpenAI Structured Output",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1d9659f-4cd0-4f87-844d-32b2af1dcf13",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2160,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "text/html; charset=UTF-8"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.html }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5ca8ad3e-7702-4f07-af24-d38e94fdc4ec",
|
||||
"name": "Open AI - Using Structured Output",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1240,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/chat/completions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.query.query }}\"\n }\n ],\n \"response_format\":\n{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"ui\",\n \"description\": \"Dynamically generated UI\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the UI component\",\n \"enum\": [\n \"div\",\n \"span\",\n \"a\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"img\",\n \"button\",\n \"input\",\n \"textarea\",\n \"select\",\n \"option\",\n \"label\",\n \"form\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tr\",\n \"th\",\n \"td\",\n \"nav\",\n \"header\",\n \"footer\",\n \"section\",\n \"article\",\n \"aside\",\n \"main\",\n \"figure\",\n \"figcaption\",\n \"blockquote\",\n \"q\",\n \"hr\",\n \"code\",\n \"pre\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"canvas\",\n \"svg\",\n \"path\",\n \"circle\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"g\",\n \"use\",\n \"symbol\"\n]\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the UI component, used for buttons or form fields\"\n },\n \"children\": {\n \"type\": \"array\",\n \"description\": \"Nested UI components\",\n \"items\": {\n \"$ref\": \"#\"\n }\n },\n \"attributes\": {\n \"type\": \"array\",\n \"description\": \"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the attribute, for example onClick or className\"\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"The value of the attribute using the Tailwind framework classes\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"value\"]\n }\n }\n },\n \"required\": [\"type\", \"label\", \"children\", \"attributes\"],\n \"additionalProperties\": false\n }\n }\n}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "24e5ca73-a3b3-4096-8c66-d84838d89b0c",
|
||||
"name": "OpenAI - JSON to HTML",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1420,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You convert a JSON to HTML. \nThe JSON output has the following fields:\n- html: the page HTML\n- title: the page title"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.choices[0].message.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "c50bdc84-ba59-4f30-acf7-496cee25068d",
|
||||
"name": "Format the HTML result",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
1940,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <title>{{ $json.message.content.title }}</title>\n</head>\n<body>\n{{ $json.message.content.html }}\n</body>\n</html>"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "193093f4-b1ce-4964-ab10-c3208e343c69",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1134,
|
||||
62
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 638,
|
||||
"height": 503,
|
||||
"content": "## Generate HTML from user query\n\n**HTTP Request node**\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\n- The output is a JSON containing HTML components and attributed\n\n\n**OpenAI node**\n- Format the response from the previous node from JSON format to HTML format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0371156a-211f-4d92-82b1-f14fe60d4b6b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 768,
|
||||
"height": 503,
|
||||
"content": "## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\n- It uses Tailwind CSS to make it slightly nicer, but any\n\n**How it works**\n- Once active, go to the production URL and add what you'd like to build as the parameter \"query\"\n- Example: https://production_url.com?query=a%20signup%20form\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\n- Finally, the response is integrated in a HTML container and rendered to the user\n\n**Further thoughts**\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06380781-5189-4d99-9ecd-d8913ce40fd5",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
820,
|
||||
380
|
||||
],
|
||||
"webhookId": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"parameters": {
|
||||
"path": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"options": {
|
||||
"allowedOrigins": "*"
|
||||
},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d2307a2a-5427-4769-94a6-10eab703a788",
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Open AI - Using Structured Output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - JSON to HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format the HTML result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format the HTML result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Open AI - Using Structured Output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - JSON to HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"id": "eXiaTDyKfXpMeyLh",
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Dynamically generate HTML page from user request using OpenAI Structured Output",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1d9659f-4cd0-4f87-844d-32b2af1dcf13",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2160,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "text/html; charset=UTF-8"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.html }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5ca8ad3e-7702-4f07-af24-d38e94fdc4ec",
|
||||
"name": "Open AI - Using Structured Output",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1240,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/chat/completions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.query.query }}\"\n }\n ],\n \"response_format\":\n{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"ui\",\n \"description\": \"Dynamically generated UI\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the UI component\",\n \"enum\": [\n \"div\",\n \"span\",\n \"a\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"img\",\n \"button\",\n \"input\",\n \"textarea\",\n \"select\",\n \"option\",\n \"label\",\n \"form\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tr\",\n \"th\",\n \"td\",\n \"nav\",\n \"header\",\n \"footer\",\n \"section\",\n \"article\",\n \"aside\",\n \"main\",\n \"figure\",\n \"figcaption\",\n \"blockquote\",\n \"q\",\n \"hr\",\n \"code\",\n \"pre\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"canvas\",\n \"svg\",\n \"path\",\n \"circle\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"g\",\n \"use\",\n \"symbol\"\n]\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the UI component, used for buttons or form fields\"\n },\n \"children\": {\n \"type\": \"array\",\n \"description\": \"Nested UI components\",\n \"items\": {\n \"$ref\": \"#\"\n }\n },\n \"attributes\": {\n \"type\": \"array\",\n \"description\": \"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the attribute, for example onClick or className\"\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"The value of the attribute using the Tailwind framework classes\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"value\"]\n }\n }\n },\n \"required\": [\"type\", \"label\", \"children\", \"attributes\"],\n \"additionalProperties\": false\n }\n }\n}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "24e5ca73-a3b3-4096-8c66-d84838d89b0c",
|
||||
"name": "OpenAI - JSON to HTML",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1420,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You convert a JSON to HTML. \nThe JSON output has the following fields:\n- html: the page HTML\n- title: the page title"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.choices[0].message.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "c50bdc84-ba59-4f30-acf7-496cee25068d",
|
||||
"name": "Format the HTML result",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
1940,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <title>{{ $json.message.content.title }}</title>\n</head>\n<body>\n{{ $json.message.content.html }}\n</body>\n</html>"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "193093f4-b1ce-4964-ab10-c3208e343c69",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1134,
|
||||
62
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 638,
|
||||
"height": 503,
|
||||
"content": "## Generate HTML from user query\n\n**HTTP Request node**\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\n- The output is a JSON containing HTML components and attributed\n\n\n**OpenAI node**\n- Format the response from the previous node from JSON format to HTML format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0371156a-211f-4d92-82b1-f14fe60d4b6b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 768,
|
||||
"height": 503,
|
||||
"content": "## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\n- It uses Tailwind CSS to make it slightly nicer, but any\n\n**How it works**\n- Once active, go to the production URL and add what you'd like to build as the parameter \"query\"\n- Example: https://production_url.com?query=a%20signup%20form\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\n- Finally, the response is integrated in a HTML container and rendered to the user\n\n**Further thoughts**\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06380781-5189-4d99-9ecd-d8913ce40fd5",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
820,
|
||||
380
|
||||
],
|
||||
"webhookId": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"parameters": {
|
||||
"path": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"options": {
|
||||
"allowedOrigins": "*"
|
||||
},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d2307a2a-5427-4769-94a6-10eab703a788",
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Open AI - Using Structured Output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - JSON to HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format the HTML result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format the HTML result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Open AI - Using Structured Output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - JSON to HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
{
|
||||
"id": "eXiaTDyKfXpMeyLh",
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Dynamically generate HTML page from user request using OpenAI Structured Output",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1d9659f-4cd0-4f87-844d-32b2af1dcf13",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2160,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "text/html; charset=UTF-8"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.html }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5ca8ad3e-7702-4f07-af24-d38e94fdc4ec",
|
||||
"name": "Open AI - Using Structured Output",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1240,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/chat/completions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.query.query }}\"\n }\n ],\n \"response_format\":\n{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"ui\",\n \"description\": \"Dynamically generated UI\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the UI component\",\n \"enum\": [\n \"div\",\n \"span\",\n \"a\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"img\",\n \"button\",\n \"input\",\n \"textarea\",\n \"select\",\n \"option\",\n \"label\",\n \"form\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tr\",\n \"th\",\n \"td\",\n \"nav\",\n \"header\",\n \"footer\",\n \"section\",\n \"article\",\n \"aside\",\n \"main\",\n \"figure\",\n \"figcaption\",\n \"blockquote\",\n \"q\",\n \"hr\",\n \"code\",\n \"pre\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"canvas\",\n \"svg\",\n \"path\",\n \"circle\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"g\",\n \"use\",\n \"symbol\"\n]\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the UI component, used for buttons or form fields\"\n },\n \"children\": {\n \"type\": \"array\",\n \"description\": \"Nested UI components\",\n \"items\": {\n \"$ref\": \"#\"\n }\n },\n \"attributes\": {\n \"type\": \"array\",\n \"description\": \"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the attribute, for example onClick or className\"\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"The value of the attribute using the Tailwind framework classes\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"value\"]\n }\n }\n },\n \"required\": [\"type\", \"label\", \"children\", \"attributes\"],\n \"additionalProperties\": false\n }\n }\n}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "24e5ca73-a3b3-4096-8c66-d84838d89b0c",
|
||||
"name": "OpenAI - JSON to HTML",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1420,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You convert a JSON to HTML. \nThe JSON output has the following fields:\n- html: the page HTML\n- title: the page title"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.choices[0].message.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "c50bdc84-ba59-4f30-acf7-496cee25068d",
|
||||
"name": "Format the HTML result",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
1940,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <title>{{ $json.message.content.title }}</title>\n</head>\n<body>\n{{ $json.message.content.html }}\n</body>\n</html>"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "193093f4-b1ce-4964-ab10-c3208e343c69",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1134,
|
||||
62
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 638,
|
||||
"height": 503,
|
||||
"content": "## Generate HTML from user query\n\n**HTTP Request node**\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\n- The output is a JSON containing HTML components and attributed\n\n\n**OpenAI node**\n- Format the response from the previous node from JSON format to HTML format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0371156a-211f-4d92-82b1-f14fe60d4b6b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 768,
|
||||
"height": 503,
|
||||
"content": "## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\n- It uses Tailwind CSS to make it slightly nicer, but any\n\n**How it works**\n- Once active, go to the production URL and add what you'd like to build as the parameter \"query\"\n- Example: https://production_url.com?query=a%20signup%20form\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\n- Finally, the response is integrated in a HTML container and rendered to the user\n\n**Further thoughts**\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06380781-5189-4d99-9ecd-d8913ce40fd5",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
820,
|
||||
380
|
||||
],
|
||||
"webhookId": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"parameters": {
|
||||
"path": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"options": {
|
||||
"allowedOrigins": "*"
|
||||
},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d2307a2a-5427-4769-94a6-10eab703a788",
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Open AI - Using Structured Output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - JSON to HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format the HTML result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format the HTML result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Open AI - Using Structured Output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - JSON to HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"id": "eXiaTDyKfXpMeyLh",
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Dynamically generate HTML page from user request using OpenAI Structured Output",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b1d9659f-4cd0-4f87-844d-32b2af1dcf13",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
2160,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "text/html; charset=UTF-8"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{ $json.html }}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "5ca8ad3e-7702-4f07-af24-d38e94fdc4ec",
|
||||
"name": "Open AI - Using Structured Output",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
1240,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://api.openai.com/v1/chat/completions",
|
||||
"method": "POST",
|
||||
"options": {},
|
||||
"jsonBody": "={\n \"model\": \"gpt-4o-2024-08-06\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a user interface designer and copy writter. Your job is to help users visualize their website ideas. You design elegant and simple webs, with professional text. You use Tailwind framework\"\n },\n {\n \"role\": \"user\",\n \"content\": \"{{ $json.query.query }}\"\n }\n ],\n \"response_format\":\n{\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"ui\",\n \"description\": \"Dynamically generated UI\",\n \"strict\": true,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"description\": \"The type of the UI component\",\n \"enum\": [\n \"div\",\n \"span\",\n \"a\",\n \"p\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"img\",\n \"button\",\n \"input\",\n \"textarea\",\n \"select\",\n \"option\",\n \"label\",\n \"form\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tr\",\n \"th\",\n \"td\",\n \"nav\",\n \"header\",\n \"footer\",\n \"section\",\n \"article\",\n \"aside\",\n \"main\",\n \"figure\",\n \"figcaption\",\n \"blockquote\",\n \"q\",\n \"hr\",\n \"code\",\n \"pre\",\n \"iframe\",\n \"video\",\n \"audio\",\n \"canvas\",\n \"svg\",\n \"path\",\n \"circle\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"g\",\n \"use\",\n \"symbol\"\n]\n },\n \"label\": {\n \"type\": \"string\",\n \"description\": \"The label of the UI component, used for buttons or form fields\"\n },\n \"children\": {\n \"type\": \"array\",\n \"description\": \"Nested UI components\",\n \"items\": {\n \"$ref\": \"#\"\n }\n },\n \"attributes\": {\n \"type\": \"array\",\n \"description\": \"Arbitrary attributes for the UI component, suitable for any element using Tailwind framework\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the attribute, for example onClick or className\"\n },\n \"value\": {\n \"type\": \"string\",\n \"description\": \"The value of the attribute using the Tailwind framework classes\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"name\", \"value\"]\n }\n }\n },\n \"required\": [\"type\", \"label\", \"children\", \"attributes\"],\n \"additionalProperties\": false\n }\n }\n}\n}",
|
||||
"sendBody": true,
|
||||
"sendHeaders": true,
|
||||
"specifyBody": "json",
|
||||
"authentication": "predefinedCredentialType",
|
||||
"headerParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "application/json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nodeCredentialType": "openAiApi"
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "24e5ca73-a3b3-4096-8c66-d84838d89b0c",
|
||||
"name": "OpenAI - JSON to HTML",
|
||||
"type": "@n8n/n8n-nodes-langchain.openAi",
|
||||
"position": [
|
||||
1420,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"modelId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini",
|
||||
"cachedResultName": "GPT-4O-MINI"
|
||||
},
|
||||
"options": {
|
||||
"temperature": 0.2
|
||||
},
|
||||
"messages": {
|
||||
"values": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": "You convert a JSON to HTML. \nThe JSON output has the following fields:\n- html: the page HTML\n- title: the page title"
|
||||
},
|
||||
{
|
||||
"content": "={{ $json.choices[0].message.content }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonOutput": true
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "WqzqjezKh8VtxdqA",
|
||||
"name": "OpenAi account - Baptiste"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "c50bdc84-ba59-4f30-acf7-496cee25068d",
|
||||
"name": "Format the HTML result",
|
||||
"type": "n8n-nodes-base.html",
|
||||
"position": [
|
||||
1940,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"html": "<!DOCTYPE html>\n\n<html>\n<head>\n <meta charset=\"UTF-8\" />\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <title>{{ $json.message.content.title }}</title>\n</head>\n<body>\n{{ $json.message.content.html }}\n</body>\n</html>"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "193093f4-b1ce-4964-ab10-c3208e343c69",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1134,
|
||||
62
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 638,
|
||||
"height": 503,
|
||||
"content": "## Generate HTML from user query\n\n**HTTP Request node**\n- Send the user query to OpenAI, with a defined JSON response format - *using HTTP Request node as it has not yet been implemented in the OpenAI nodes*\n- The response format is inspired by the [Structured Output defined in OpenAI Introduction post](https://openai.com/index/introducing-structured-outputs-in-the-api)\n- The output is a JSON containing HTML components and attributed\n\n\n**OpenAI node**\n- Format the response from the previous node from JSON format to HTML format"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "0371156a-211f-4d92-82b1-f14fe60d4b6b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
0,
|
||||
60
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 768,
|
||||
"height": 503,
|
||||
"content": "## Workflow: Dynamically generate an HTML page from a user request using OpenAI Structured Output\n\n**Overview**\n- This workflow is a experiment to build HTML pages from a user input using the new Structured Output from OpenAI.\n- The Structured Output could be used in a variety of cases. Essentially, it guarantees the output from the GPT will follow a defined structure (JSON object).\n- It uses Tailwind CSS to make it slightly nicer, but any\n\n**How it works**\n- Once active, go to the production URL and add what you'd like to build as the parameter \"query\"\n- Example: https://production_url.com?query=a%20signup%20form\n- OpenAI nodes will first output the UI as a JSON then convert it to HTML\n- Finally, the response is integrated in a HTML container and rendered to the user\n\n**Further thoughts**\n- Results are not yet amazing, it is hard to see the direct value of such an experiment\n- But it showcase the potential of the Structured Output. Being able to guarantee the output format is key to build robust AI applications."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "06380781-5189-4d99-9ecd-d8913ce40fd5",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
820,
|
||||
380
|
||||
],
|
||||
"webhookId": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"parameters": {
|
||||
"path": "d962c916-6369-431a-9d80-af6e6a50fdf5",
|
||||
"options": {
|
||||
"allowedOrigins": "*"
|
||||
},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d2307a2a-5427-4769-94a6-10eab703a788",
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Open AI - Using Structured Output",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI - JSON to HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format the HTML result",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format the HTML result": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Open AI - Using Structured Output": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "OpenAI - JSON to HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,401 +0,0 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0b64edf1-57e0-4704-b78c-c8ab2b91f74d",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
480,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a875d1c5-ccfe-4bbf-b429-56a42b0ca778",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "dSxo6ns5wn658r8N",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a5e00543-dbaa-4e62-afb0-825ebefae3f3",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1480,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchemaExample": "{\n\t\"caption_title\": \"\",\n\t\"caption_text\": \"\"\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "bb9af9c6-6c81-4e92-a29f-18ab3afbe327",
|
||||
"name": "Get Info",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1100,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "information"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8a0dbd5d-5886-484a-80a0-486f349a9856",
|
||||
"name": "Resize For AI",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1100,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"options": {},
|
||||
"operation": "resize"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d29f254a-5fa3-46fa-b153-19dfd8e8c6a7",
|
||||
"name": "Calculate Positioning",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
2020,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const { size, output } = $input.item.json;\n\nconst lineHeight = 35;\nconst fontSize = Math.round(size.height / lineHeight);\nconst maxLineLength = Math.round(size.width/fontSize) * 2;\nconst text = `\"${output.caption_title}\". ${output.caption_text}`;\nconst numLinesOccupied = Math.round(text.length / maxLineLength);\n\nconst verticalPadding = size.height * 0.02;\nconst horizontalPadding = size.width * 0.02;\nconst rectPosX = 0;\nconst rectPosY = size.height - (verticalPadding * 2.5) - (numLinesOccupied * fontSize);\nconst textPosX = horizontalPadding;\nconst textPosY = size.height - (numLinesOccupied * fontSize) - (verticalPadding/2);\n\nreturn {\n caption: {\n fontSize,\n maxLineLength,\n numLinesOccupied,\n rectPosX,\n rectPosY,\n textPosX,\n textPosY,\n verticalPadding,\n horizontalPadding,\n }\n}\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "12a7f2d6-8684-48a5-aa41-40a8a4f98c79",
|
||||
"name": "Apply Caption to Image",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
2380,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "multiStep",
|
||||
"operations": {
|
||||
"operations": [
|
||||
{
|
||||
"color": "=#0000008c",
|
||||
"operation": "draw",
|
||||
"endPositionX": "={{ $json.size.width }}",
|
||||
"endPositionY": "={{ $json.size.height }}",
|
||||
"startPositionX": "={{ $json.caption.rectPosX }}",
|
||||
"startPositionY": "={{ $json.caption.rectPosY }}"
|
||||
},
|
||||
{
|
||||
"font": "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
|
||||
"text": "=\"{{ $json.output.caption_title }}\". {{ $json.output.caption_text }}",
|
||||
"fontSize": "={{ $json.caption.fontSize }}",
|
||||
"fontColor": "#FFFFFF",
|
||||
"operation": "text",
|
||||
"positionX": "={{ $json.caption.textPosX }}",
|
||||
"positionY": "={{ $json.caption.textPosY }}",
|
||||
"lineLength": "={{ $json.caption.maxLineLength }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4d569ec8-04c2-4d21-96e1-86543b26892d",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-120,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 423.75,
|
||||
"height": 431.76353488372104,
|
||||
"content": "## Try it out!\n\n### This workflow takes an image and generates a caption for it using AI. The OpenAI node has been able to do this for a while but this workflow demonstrates how to achieve the same with other multimodal vision models such as Google's Gemini.\n\nAdditional, we'll use the Edit Image node to overlay the generated caption onto the image. This can be useful for publications or can be repurposed for copyrights and/or watermarks.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "45d37945-5a7a-42eb-8c8c-5940ea276072",
|
||||
"name": "Merge Image & Caption",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1620,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "53a26842-ad56-4c8d-a59d-4f6d3f9e2407",
|
||||
"name": "Merge Caption & Positions",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
2200,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b6c28913-b16a-4c59-aa49-47e9bb97f86d",
|
||||
"name": "Get Image",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
680,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://images.pexels.com/photos/1267338/pexels-photo-1267338.jpeg?auto=compress&cs=tinysrgb&w=600",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "6c25054d-8103-4be9-bea7-6c3dd47f49a3",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 586.25,
|
||||
"height": 486.25,
|
||||
"content": "## 1. Import an Image \n[Read more about the HTTP request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nFor this demonstration, we'll grab an image off Pexels.com - a popular free stock photography site - by using the HTTP request node to download.\n\nIn your own workflows, this can be replaces by other triggers such as webhooks."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d1b708e2-31c3-4cd1-a353-678bc33d4022",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 888.75,
|
||||
"height": 783.75,
|
||||
"content": "## 2. Using Vision Model to Generate Caption\n[Learn more about the Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nn8n's basic LLM node supports multimodal input by allowing you to specify either a binary or an image url to send to a compatible LLM. This makes it easy to start utilising this powerful feature for visual classification or OCR tasks which have previously depended on more dedicated OCR models.\n\nHere, we've simply passed our image binary as a \"user message\" option, asking the LLM to help us generate a caption title and text which is appropriate for the given subject. Once generated, we'll pass this text along with the image to combine them both."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36a39871-340f-4c44-90e6-74393b9be324",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1880,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 753.75,
|
||||
"height": 635,
|
||||
"content": "## 3. Overlay Caption on Image \n[Read more about the Edit Image node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.editimage)\n\nFinally, we’ll perform some basic calculations to place the generated caption onto the image. With n8n's user-friendly image editing features, this can be done entirely within the workflow!\n\nThe Code node tool is ideal for these types of calculations and is used here to position the caption at the bottom of the image. To create the overlay, the Edit Image node enables us to insert text onto the image, which we’ll use to add the generated caption."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d175fe97-064e-41da-95fd-b15668c330c4",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2660,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 563.75,
|
||||
"height": 411.25,
|
||||
"content": "**FIG 1.** Example input image with AI generated caption\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "23db0c90-45b6-4b85-b017-a52ad5a9ad5b",
|
||||
"name": "Image Captioning Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1280,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Generate a caption for this image.",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=You role is to provide an appropriate image caption for user provided images.\n\nThe individual components of a caption are as follows: who, when, where, context and miscellaneous. For a really good caption, follow this template: who + when + where + context + miscellaneous\n\nGive the caption a punny title."
|
||||
},
|
||||
{
|
||||
"type": "HumanMessagePromptTemplate",
|
||||
"messageType": "imageBinary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Get Info": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Image & Caption",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Image": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Resize For AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get Info",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Resize For AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calculate Positioning": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Caption & Positions",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Image & Caption": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calculate Positioning",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge Caption & Positions",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Image Captioning Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Image & Caption",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Caption & Positions": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Apply Caption to Image",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Image",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
401
OpenAI_and_LLMs/Easy Image Captioning with Gemini 1.5 Pro.txt
Normal file
401
OpenAI_and_LLMs/Easy Image Captioning with Gemini 1.5 Pro.txt
Normal file
@@ -0,0 +1,401 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0b64edf1-57e0-4704-b78c-c8ab2b91f74d",
|
||||
"name": "When clicking ‘Test workflow’",
|
||||
"type": "n8n-nodes-base.manualTrigger",
|
||||
"position": [
|
||||
480,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a875d1c5-ccfe-4bbf-b429-56a42b0ca778",
|
||||
"name": "Google Gemini Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
|
||||
"position": [
|
||||
1280,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"modelName": "models/gemini-1.5-flash"
|
||||
},
|
||||
"credentials": {
|
||||
"googlePalmApi": {
|
||||
"id": "dSxo6ns5wn658r8N",
|
||||
"name": "Google Gemini(PaLM) Api account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "a5e00543-dbaa-4e62-afb0-825ebefae3f3",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
1480,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchemaExample": "{\n\t\"caption_title\": \"\",\n\t\"caption_text\": \"\"\n}"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "bb9af9c6-6c81-4e92-a29f-18ab3afbe327",
|
||||
"name": "Get Info",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1100,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "information"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "8a0dbd5d-5886-484a-80a0-486f349a9856",
|
||||
"name": "Resize For AI",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
1100,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"width": 512,
|
||||
"height": 512,
|
||||
"options": {},
|
||||
"operation": "resize"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d29f254a-5fa3-46fa-b153-19dfd8e8c6a7",
|
||||
"name": "Calculate Positioning",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
2020,
|
||||
720
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "runOnceForEachItem",
|
||||
"jsCode": "const { size, output } = $input.item.json;\n\nconst lineHeight = 35;\nconst fontSize = Math.round(size.height / lineHeight);\nconst maxLineLength = Math.round(size.width/fontSize) * 2;\nconst text = `\"${output.caption_title}\". ${output.caption_text}`;\nconst numLinesOccupied = Math.round(text.length / maxLineLength);\n\nconst verticalPadding = size.height * 0.02;\nconst horizontalPadding = size.width * 0.02;\nconst rectPosX = 0;\nconst rectPosY = size.height - (verticalPadding * 2.5) - (numLinesOccupied * fontSize);\nconst textPosX = horizontalPadding;\nconst textPosY = size.height - (numLinesOccupied * fontSize) - (verticalPadding/2);\n\nreturn {\n caption: {\n fontSize,\n maxLineLength,\n numLinesOccupied,\n rectPosX,\n rectPosY,\n textPosX,\n textPosY,\n verticalPadding,\n horizontalPadding,\n }\n}\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "12a7f2d6-8684-48a5-aa41-40a8a4f98c79",
|
||||
"name": "Apply Caption to Image",
|
||||
"type": "n8n-nodes-base.editImage",
|
||||
"position": [
|
||||
2380,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "multiStep",
|
||||
"operations": {
|
||||
"operations": [
|
||||
{
|
||||
"color": "=#0000008c",
|
||||
"operation": "draw",
|
||||
"endPositionX": "={{ $json.size.width }}",
|
||||
"endPositionY": "={{ $json.size.height }}",
|
||||
"startPositionX": "={{ $json.caption.rectPosX }}",
|
||||
"startPositionY": "={{ $json.caption.rectPosY }}"
|
||||
},
|
||||
{
|
||||
"font": "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
|
||||
"text": "=\"{{ $json.output.caption_title }}\". {{ $json.output.caption_text }}",
|
||||
"fontSize": "={{ $json.caption.fontSize }}",
|
||||
"fontColor": "#FFFFFF",
|
||||
"operation": "text",
|
||||
"positionX": "={{ $json.caption.textPosX }}",
|
||||
"positionY": "={{ $json.caption.textPosY }}",
|
||||
"lineLength": "={{ $json.caption.maxLineLength }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "4d569ec8-04c2-4d21-96e1-86543b26892d",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-120,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"width": 423.75,
|
||||
"height": 431.76353488372104,
|
||||
"content": "## Try it out!\n\n### This workflow takes an image and generates a caption for it using AI. The OpenAI node has been able to do this for a while but this workflow demonstrates how to achieve the same with other multimodal vision models such as Google's Gemini.\n\nAdditional, we'll use the Edit Image node to overlay the generated caption onto the image. This can be useful for publications or can be repurposed for copyrights and/or watermarks.\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "45d37945-5a7a-42eb-8c8c-5940ea276072",
|
||||
"name": "Merge Image & Caption",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1620,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "53a26842-ad56-4c8d-a59d-4f6d3f9e2407",
|
||||
"name": "Merge Caption & Positions",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
2200,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "combine",
|
||||
"options": {},
|
||||
"combineBy": "combineByPosition"
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "b6c28913-b16a-4c59-aa49-47e9bb97f86d",
|
||||
"name": "Get Image",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"position": [
|
||||
680,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"url": "https://images.pexels.com/photos/1267338/pexels-photo-1267338.jpeg?auto=compress&cs=tinysrgb&w=600",
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 4.2
|
||||
},
|
||||
{
|
||||
"id": "6c25054d-8103-4be9-bea7-6c3dd47f49a3",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 586.25,
|
||||
"height": 486.25,
|
||||
"content": "## 1. Import an Image \n[Read more about the HTTP request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nFor this demonstration, we'll grab an image off Pexels.com - a popular free stock photography site - by using the HTTP request node to download.\n\nIn your own workflows, this can be replaces by other triggers such as webhooks."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d1b708e2-31c3-4cd1-a353-678bc33d4022",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
960,
|
||||
140
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 888.75,
|
||||
"height": 783.75,
|
||||
"content": "## 2. Using Vision Model to Generate Caption\n[Learn more about the Basic LLM Chain](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nn8n's basic LLM node supports multimodal input by allowing you to specify either a binary or an image url to send to a compatible LLM. This makes it easy to start utilising this powerful feature for visual classification or OCR tasks which have previously depended on more dedicated OCR models.\n\nHere, we've simply passed our image binary as a \"user message\" option, asking the LLM to help us generate a caption title and text which is appropriate for the given subject. Once generated, we'll pass this text along with the image to combine them both."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "36a39871-340f-4c44-90e6-74393b9be324",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1880,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 753.75,
|
||||
"height": 635,
|
||||
"content": "## 3. Overlay Caption on Image \n[Read more about the Edit Image node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.editimage)\n\nFinally, we’ll perform some basic calculations to place the generated caption onto the image. With n8n's user-friendly image editing features, this can be done entirely within the workflow!\n\nThe Code node tool is ideal for these types of calculations and is used here to position the caption at the bottom of the image. To create the overlay, the Edit Image node enables us to insert text onto the image, which we’ll use to add the generated caption."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "d175fe97-064e-41da-95fd-b15668c330c4",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2660,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"width": 563.75,
|
||||
"height": 411.25,
|
||||
"content": "**FIG 1.** Example input image with AI generated caption\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "23db0c90-45b6-4b85-b017-a52ad5a9ad5b",
|
||||
"name": "Image Captioning Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.chainLlm",
|
||||
"position": [
|
||||
1280,
|
||||
560
|
||||
],
|
||||
"parameters": {
|
||||
"text": "Generate a caption for this image.",
|
||||
"messages": {
|
||||
"messageValues": [
|
||||
{
|
||||
"message": "=You role is to provide an appropriate image caption for user provided images.\n\nThe individual components of a caption are as follows: who, when, where, context and miscellaneous. For a really good caption, follow this template: who + when + where + context + miscellaneous\n\nGive the caption a punny title."
|
||||
},
|
||||
{
|
||||
"type": "HumanMessagePromptTemplate",
|
||||
"messageType": "imageBinary"
|
||||
}
|
||||
]
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.4
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Get Info": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Image & Caption",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Image": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Resize For AI",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Get Info",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Resize For AI": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Calculate Positioning": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Caption & Positions",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Image & Caption": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Calculate Positioning",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Merge Caption & Positions",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Image Captioning Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge Image & Caption",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Gemini Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "Image Captioning Agent",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Merge Caption & Positions": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Apply Caption to Image",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When clicking ‘Test workflow’": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Image",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user