feat: add folder support for workflows (fixes #70)

This commit is contained in:
Praveen Mudalgeri
2025-08-05 09:40:47 +05:30
parent 307d530f9b
commit c4885eee92
2057 changed files with 985290 additions and 974268 deletions

View File

@@ -0,0 +1,93 @@
{
"nodes": [
{
"name": "Gmail1",
"type": "n8n-nodes-base.gmail",
"position": [
-34.5,
449.5
],
"parameters": {
"resource": "message",
"operation": "getAll",
"additionalFields": {
"format": "resolved",
"labelIds": [
"Label_1819449526183990002"
]
}
},
"credentials": {
"gmailOAuth2": "Gmail"
},
"typeVersion": 1
},
{
"name": "Upload File1",
"type": "n8n-nodes-base.googleDrive",
"position": [
115.5,
449.5
],
"parameters": {
"name": "={{$binary.attachment_0.fileName}}",
"parents": [
"1I-tBNWFhH2FwcyiKeBOcGseWktF-nXBr"
],
"binaryData": true,
"resolveData": true,
"authentication": "oAuth2",
"binaryPropertyName": "attachment_0"
},
"credentials": {
"googleDriveOAuth2Api": "Google Drive OAuth2 API"
},
"typeVersion": 1
},
{
"name": "Get attachment Link",
"type": "n8n-nodes-base.set",
"position": [
280,
450
],
"parameters": {
"values": {
"string": [
{
"name": "mp4_attachment",
"value": "={{$json[\"webViewLink\"]}}"
}
]
},
"options": {},
"keepOnlySet": true
},
"typeVersion": 1
}
],
"connections": {
"Gmail1": {
"main": [
[
{
"node": "Upload File1",
"type": "main",
"index": 0
}
]
]
},
"Upload File1": {
"main": [
[
{
"node": "Get attachment Link",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,92 @@
{
"nodes": [
{
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"notes": "Get email with JSON file",
"position": [
620,
140
],
"parameters": {
"limit": 1,
"operation": "getAll",
"additionalFields": {}
},
"credentials": {
"gmailOAuth2": {
"id": "16",
"name": "gmail"
}
},
"notesInFlow": true,
"typeVersion": 1
},
{
"name": "write spreadsheet file",
"type": "n8n-nodes-base.spreadsheetFile",
"position": [
980,
140
],
"parameters": {
"options": {
"fileName": "users_spreadsheet.csv"
},
"operation": "toFile",
"fileFormat": "csv"
},
"typeVersion": 1
},
{
"name": "move binary data ",
"type": "n8n-nodes-base.moveBinaryData",
"position": [
800,
140
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"name": "Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
200,
160
],
"parameters": {
"width": 320,
"height": 80,
"content": "## JSON file > Sheets"
},
"typeVersion": 1
}
],
"connections": {
"Gmail": {
"main": [
[
{
"node": "move binary data ",
"type": "main",
"index": 0
}
]
]
},
"move binary data ": {
"main": [
[
{
"node": "write spreadsheet file",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,303 @@
{
"meta": {
"instanceId": "408f9fb9940c3cb18ffdef0e0150fe342d6e655c3a9fac21f0f644e8bedabcd9",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "eaa31cde-3017-400d-aac8-999def8cc227",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-340,
-780
],
"parameters": {
"width": 617,
"height": 490,
"content": "## Check if incoming email is about appointment\nWe use LLM to check subject and body of the email and determine if it's an appointment request. "
},
"typeVersion": 1
},
{
"id": "b03d3f72-d1d8-49a7-bcc1-a476fd5c4ad7",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
400,
-780
],
"parameters": {
"width": 796,
"height": 482,
"content": "## Get calendar availability and compose a response\nMake sure to update the Workflow ID if you are running this as 2 workflows"
},
"typeVersion": 1
},
{
"id": "29ce0093-c4c8-41cc-be69-334de3a1d1a2",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-60,
-460
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "5176f475-704b-446e-b368-ffa395bb089e",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
480,
-460
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8gccIjcuf3gvaoEr",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "0e8a75dd-ce68-46c3-972c-32b15e04b254",
"name": "Send reply",
"type": "n8n-nodes-base.gmail",
"position": [
940,
-660
],
"webhookId": "0f18d414-1b14-4d2e-9fc2-d2d302372dc6",
"parameters": {
"message": "={{ $json.output }}",
"options": {},
"messageId": "={{ $('Gmail Trigger').first().json.id }}",
"operation": "reply"
},
"credentials": {
"gmailOAuth2": {
"id": "Sf5Gfl9NiFTNXFWb",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "bf154384-274a-4cdd-977d-890220948a9d",
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
-280,
-640
],
"parameters": {
"filters": {
"readStatus": "unread",
"includeSpamTrash": false
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "Sf5Gfl9NiFTNXFWb",
"name": "Gmail account"
}
},
"typeVersion": 1.2
},
{
"id": "5a268b34-38ea-4e55-87ab-8a616e2aa1fa",
"name": "Classify appointment",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
-60,
-640
],
"parameters": {
"options": {
"fallback": "discard"
},
"inputText": "=Please evaluate the following email to determine if it suggests scheduling a meeting or a call:\nSubject: {{ $json.Subject }}\nSnippet: {{ $json.snippet }}",
"categories": {
"categories": [
{
"category": "is_appointment",
"description": "email Is requesting an appointment"
}
]
}
},
"typeVersion": 1
},
{
"id": "7b5a8468-09e5-4575-97cb-9175ee02b19d",
"name": "Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
500,
-660
],
"parameters": {
"text": "=Sender: {{ $('Gmail Trigger').first().json.From }}\nSubject: {{ $('Gmail Trigger').first().json.Subject }}\nEmail Text: {{ $('Gmail Trigger').first().json.snippet }}",
"options": {
"systemMessage": "=You are an email scheduling assistant. Based on the received email, check my availability and propose an appropriate response. \nAim to get a specific time, rather than just a day. When checking my availability, make sure that there's enough time in between meetings.\nIf I'm not available, ALWAYS propose a new time based on my availability. When proposing a new time, always leave 15 minutes buffer from previous meeting.\nToday date and time is: {{ $now.toISO() }}."
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "b61e8061-5719-4c30-97da-e306e7b79b76",
"name": "Google Calendar",
"type": "n8n-nodes-base.googleCalendarTool",
"position": [
680,
-460
],
"parameters": {
"options": {},
"timeMax": "={{ $now.plus(1, 'month').toISO() }}",
"timeMin": "={{ $now.minus(1, 'day').toISO() }}",
"calendar": {
"__rl": true,
"mode": "id",
"value": "your_email@gmail.com"
},
"operation": "getAll",
"returnAll": true
},
"credentials": {
"googleCalendarOAuth2Api": {
"id": "kWMxmDbMDDJoYFVK",
"name": "Google Calendar account"
}
},
"typeVersion": 1.3
},
{
"id": "47e07b6c-d432-4111-b33e-56d6c305c40c",
"name": "Mark as read",
"type": "n8n-nodes-base.gmail",
"position": [
940,
-480
],
"webhookId": "7e2d851b-c9f3-471c-875d-0da7c2c3b561",
"parameters": {
"messageId": "={{ $('Gmail Trigger').first().json.id }}",
"operation": "markAsRead"
},
"credentials": {
"gmailOAuth2": {
"id": "Sf5Gfl9NiFTNXFWb",
"name": "Gmail account"
}
},
"typeVersion": 2.1
}
],
"pinData": {},
"connections": {
"Agent": {
"main": [
[
{
"node": "Send reply",
"type": "main",
"index": 0
},
{
"node": "Mark as read",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "Classify appointment",
"type": "main",
"index": 0
}
]
]
},
"Google Calendar": {
"ai_tool": [
[
{
"node": "Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Classify appointment",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Classify appointment": {
"main": [
[
{
"node": "Agent",
"type": "main",
"index": 0
}
],
[]
]
}
}
}

View File

@@ -0,0 +1,101 @@
{
"meta": {
"instanceId": "1a23006df50de49624f69e85993be557d137b6efe723a867a7d68a84e0b32704"
},
"nodes": [
{
"id": "3c7ae816-6ce2-4b6b-893e-75c6b8756555",
"name": "Trigger - New Email",
"type": "n8n-nodes-base.gmailTrigger",
"notes": "has:attachment",
"position": [
680,
300
],
"parameters": {
"simple": false,
"filters": {
"q": "has:attachment"
},
"options": {
"downloadAttachments": true
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"notesInFlow": true,
"typeVersion": 1.1
},
{
"id": "b87b2211-03d3-4742-98c9-977ae4a8d581",
"name": "attach binary data outputs",
"type": "n8n-nodes-base.function",
"position": [
900,
300
],
"parameters": {
"functionCode": "let results = [];\n\nfor (item of items) {\n for (key of Object.keys(item.binary)) {\n results.push({\n json: {\n fileName: item.binary[key].fileName\n },\n binary: {\n data: item.binary[key],\n }\n });\n }\n}\n\nreturn results;"
},
"typeVersion": 1
},
{
"id": "f8e19c97-0983-4365-bc63-179605050ef2",
"name": "upload files to google drive",
"type": "n8n-nodes-base.googleDrive",
"position": [
1140,
300
],
"parameters": {
"name": "={{ $json.fileName.split(\".\")[0] + \"-\" + $('Trigger - New Email').item.json.from.value[0].address + \".\" + $json.fileName.split(\".\")[1]}}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "root",
"cachedResultUrl": "https://drive.google.com/drive",
"cachedResultName": "/ (Root folder)"
}
},
"typeVersion": 3
}
],
"pinData": {},
"connections": {
"Trigger - New Email": {
"main": [
[
{
"node": "attach binary data outputs",
"type": "main",
"index": 0
}
]
]
},
"attach binary data outputs": {
"main": [
[
{
"node": "upload files to google drive",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,286 @@
{
"meta": {
"instanceId": "ddc2592f2c048b3a9255de9457632cead183ed1f8d682593ea74c5b20f968a76",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "53cc8017-5310-4205-85e0-8cc839693601",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
720,
400
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"name\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"email\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"linkedin\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n \"score\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t\t\n\t}\n}"
},
"typeVersion": 1.2
},
{
"id": "ea0c00d3-25c8-4523-88ff-d61d6665ecf7",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-760,
160
],
"parameters": {
"width": 480,
"height": 260,
"content": "## Resume Screener from Gmail to Sheets\n\n### 📃Before you get started, you'll need:\n- [n8n installation](https://n8n.partnerlinks.io/n8nTTVideoGenTemplate) \n- [OpenAI API Key](https://platform.openai.com/api-keys)\n- Google Sheets API enabled in [Google Cloud Console](https://console.cloud.google.com/apis/api/sheets.googleapis.com/overview)\n- Google Drive API enabled in [Google Cloud Console](https://console.cloud.google.com/apis/api/drive.googleapis.com/overview)\n- OAuth 2.0 Client ID and Client Secret from your [Google Cloud Console Credentials](https://console.cloud.google.com/apis/credentials)\n"
},
"typeVersion": 1
},
{
"id": "e4f3aef9-750a-48bb-899b-bd4a810032f2",
"name": "Extract text from PDF File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
320,
180
],
"parameters": {
"options": {},
"operation": "pdf",
"binaryPropertyName": "attachment_0"
},
"typeVersion": 1
},
{
"id": "5418cfae-25da-4f58-99ef-d6957d8819a8",
"name": "AI Agent to evaluate Resume",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
540,
180
],
"parameters": {
"text": "=Here is the resume:\n\n{{ $json.text }}",
"options": {
"systemMessage": "You are an invaluable assistant. You were given a resume. You have to help me analyze the resume and give it a score based on the details available in the resume. Also, extract the name, email, and LinkedIn profile from the resume."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.8
},
{
"id": "dce8e431-9d5c-4aa1-a0eb-c2a27de2d7f9",
"name": "OpenAI Chat Model (GPT 4o-mini)",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
520,
400
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "PMxepoh6OuVxbpg1",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "e7fdaf75-11ad-40c2-84a0-13c52f6f2eb1",
"name": "Add Resume Evaluation to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
920,
180
],
"parameters": {
"columns": {
"value": {
"Name": "={{ $json.output.name }}",
"Email": "={{ $json.output.email }}",
"Score": "={{ $json.output.score }}",
"LinkedIn": "={{ $json.output.linkedin }}",
"Resume text": "={{ $('Extract text from PDF File').item.json.text }}"
},
"schema": [
{
"id": "Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Email",
"type": "string",
"display": true,
"required": false,
"displayName": "Email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LinkedIn",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "LinkedIn",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Score",
"type": "string",
"display": true,
"required": false,
"displayName": "Score",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Resume text",
"type": "string",
"display": true,
"required": false,
"displayName": "Resume text",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {
"useAppend": true
},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 781640061,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SGYsuJI2YJVztZZmSLsFZ0lbUHnxm0V9r3c8S5-2q74/edit#gid=781640061",
"cachedResultName": "Resume Score"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1SGYsuJI2YJVztZZmSLsFZ0lbUHnxm0V9r3c8S5-2q74",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SGYsuJI2YJVztZZmSLsFZ0lbUHnxm0V9r3c8S5-2q74/edit?usp=drivesdk",
"cachedResultName": "Lead Generation"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "kzZGQmdAV5cPfymZ",
"name": "Google Sheets (server@hic)"
}
},
"typeVersion": 4.5
},
{
"id": "0ad65e2b-665d-4b77-a941-b15a7ffbfb89",
"name": "Trigger on new Email Received",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
60,
180
],
"parameters": {
"simple": false,
"filters": {
"q": "has:attachment",
"labelIds": [
"UNREAD"
],
"readStatus": "unread"
},
"options": {
"downloadAttachments": true
},
"pollTimes": {
"item": [
{
"mode": "everyHour",
"minute": 1
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "tPOAqAl9y3adqJD6",
"name": "Gmail account (hire@hic)"
}
},
"typeVersion": 1.2
}
],
"pinData": {},
"connections": {
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent to evaluate Resume",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Extract text from PDF File": {
"main": [
[
{
"node": "AI Agent to evaluate Resume",
"type": "main",
"index": 0
}
]
]
},
"AI Agent to evaluate Resume": {
"main": [
[
{
"node": "Add Resume Evaluation to Google Sheets",
"type": "main",
"index": 0
}
]
]
},
"Trigger on new Email Received": {
"main": [
[
{
"node": "Extract text from PDF File",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model (GPT 4o-mini)": {
"ai_languageModel": [
[
{
"node": "AI Agent to evaluate Resume",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,341 @@
{
"id": "aOQANirVMuWrH0ZD",
"meta": {
"instanceId": "b78ce2d06ac74b90a581919cf44503cf07404c11eda5c3847597226683145618"
},
"name": "Gmail AI auto-responder: create draft replies to incoming emails",
"tags": [],
"nodes": [
{
"id": "2a9ff08f-919a-41a8-980b-8c2bca3059e4",
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
-332.809175564116,
566.0845437534399
],
"parameters": {
"simple": false,
"filters": {
"q": "-from:me"
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "ofvBTX8A0aWfQb2O",
"name": "Gmail account"
}
},
"typeVersion": 1
},
{
"id": "3ef14615-0045-404f-a21b-2c65a52f4be8",
"name": "If Needs Reply",
"type": "n8n-nodes-base.if",
"position": [
240,
560
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "53849246-ad32-4845-9976-9f9688f5a6f2",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.needsReply }}",
"rightValue": "true"
}
]
}
},
"typeVersion": 2
},
{
"id": "36968dd5-8d51-4184-a05a-587b6c95aa82",
"name": "JSON Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
100,
720
],
"parameters": {
"jsonSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"needsReply\": {\n \"type\": \"boolean\"\n }\n },\n \"required\": [\"needsReply\"]\n}\n"
},
"typeVersion": 1
},
{
"id": "2a64dce8-e2f0-475e-a366-a02084293aad",
"name": "OpenAI Chat",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-92.809175564116,
726.0845437534399
],
"parameters": {
"model": "gpt-4o",
"options": {
"temperature": 0,
"responseFormat": "json_object"
}
},
"credentials": {
"openAiApi": {
"id": "13ffkrNMlQMfvbZy",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "be892ff8-0981-4b34-9c93-7674ddd90360",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-429.809175564116,
461.08454375343996
],
"parameters": {
"width": 304.10628068244364,
"height": 394.42512272977456,
"content": "## When I receive an Email\n"
},
"typeVersion": 1
},
{
"id": "9d92839a-9ff2-436c-8abb-2f43e07c1ace",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-112.809175564116,
460.08454375343996
],
"parameters": {
"width": 556,
"height": 397,
"content": "## ... that Needs a Reply\n"
},
"typeVersion": 1
},
{
"id": "3cd77609-684c-44e2-9cdc-9479cfd836bd",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
460,
460
],
"parameters": {
"width": 333.19082443588354,
"height": 400.08454375343996,
"content": "## Generate a Reply"
},
"typeVersion": 1
},
{
"id": "b123cf31-767d-48bb-a0ba-79a69f6da585",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
807.190824435884,
461.08454375343996
],
"parameters": {
"width": 326,
"height": 395,
"content": "## ...as a Draft in the conversation"
},
"typeVersion": 1
},
{
"id": "1a87c416-6b1c-4526-a2b6-20468c95ea0e",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
480,
680
],
"parameters": {
"model": "gpt-4-turbo",
"options": {}
},
"credentials": {
"openAiApi": {
"id": "13ffkrNMlQMfvbZy",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "84b4d516-252e-444e-b998-2d4aa0f89653",
"name": "Gmail - Create Draft",
"type": "n8n-nodes-base.gmail",
"position": [
900,
560
],
"parameters": {
"message": "={{ $json.text.replace(/\\n/g, \"<br />\\n\") }}",
"options": {
"sendTo": "={{ $('Gmail Trigger').item.json.headers.from }}",
"threadId": "={{ $('Gmail Trigger').item.json.threadId }}"
},
"subject": "=Re: {{ $('Gmail Trigger').item.json.headers.subject }}",
"resource": "draft",
"emailType": "html"
},
"credentials": {
"gmailOAuth2": {
"id": "ofvBTX8A0aWfQb2O",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "86017ff4-9c57-4b2a-9cd9-f62571a05ffd",
"name": "Assess if message needs a reply",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
-92.809175564116,
566.0845437534399
],
"parameters": {
"prompt": "=Subject: {{ $json.subject }}\nMessage:\n{{ $json.textAsHtml }} ",
"messages": {
"messageValues": [
{
"message": "Your task is to assess if the message requires a response. Return in JSON format true if it does, false otherwise.\nMarketing emails don't require a response."
}
]
}
},
"typeVersion": 1.3
},
{
"id": "cab1e7e5-93dc-4850-a471-e285cdbe2058",
"name": "Generate email reply",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
500,
520
],
"parameters": {
"text": "=Subject: {{ $('Gmail Trigger').item.json.subject }}\nMessage: {{ $('Gmail Trigger').item.json.textAsHtml }}",
"messages": {
"messageValues": [
{
"message": "You're a helpful personal assistant and your task is to draft replies on my behalf to my incoming emails. Whenever I provide some text from an email, return an appropriate draft reply for it and nothing else.\nEnsure that the reply is suitable for a professional email setting and addresses the topic in a clear, structured, and detailed manner.\nDo not make things up.\n\nDetailed instructions:\n- Be concise and maintain a business casual tone.\n- Start with \"Hello,\", and end with \"Best,\"\n- When replying to yes-no questions, draft 2 responses: one affirmative and one negative separated by \" - - - - - - - OR - - - - - - - \"\n- If you don't know an answer, you can leave placeholders like \"[YOUR_ANSWER_HERE]\".\n- Don't use any special formatting, only plain text.\n- Reply in the same language as the inbound email."
}
]
},
"promptType": "define"
},
"typeVersion": 1.4
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c4448c34-1f75-4479-805e-20d8a69a7e00",
"connections": {
"JSON Parser": {
"ai_outputParser": [
[
{
"node": "Assess if message needs a reply",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"OpenAI Chat": {
"ai_languageModel": [
[
{
"node": "Assess if message needs a reply",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "Assess if message needs a reply",
"type": "main",
"index": 0
}
]
]
},
"If Needs Reply": {
"main": [
[
{
"node": "Generate email reply",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Generate email reply",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Generate email reply": {
"main": [
[
{
"node": "Gmail - Create Draft",
"type": "main",
"index": 0
}
]
]
},
"Assess if message needs a reply": {
"main": [
[
{
"node": "If Needs Reply",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,227 @@
{
"id": "NPGAfBzz4nv8lTpl",
"meta": {
"instanceId": "d40a25503b797861fe81ffcf2649da2a83b8677ac1ef2ee6b6872aa9b52454b8",
"templateCredsSetupCompleted": true
},
"name": "Save New Sales Opportunities",
"tags": [],
"nodes": [
{
"id": "64b02b70-e7f2-4df0-852f-b6959af8d8c5",
"name": "Received Emails with Sales Label",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
760,
540
],
"parameters": {
"simple": false,
"filters": {
"labelIds": [
"Label_8035866011660570111"
]
},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyHour"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "hCIbT7XsRrtmzCCJ",
"name": "Gmail account"
}
},
"typeVersion": 1.1
},
{
"id": "6dca3c61-98ba-4d18-bc5c-9c762e12f13b",
"name": "Odoo - Create Opportunity",
"type": "n8n-nodes-base.odoo",
"position": [
1500,
540
],
"parameters": {
"resource": "opportunity",
"opportunityName": "={{ $('Received Emails with Sales Label').item.json.headers.subject }}",
"additionalFields": {
"email_from": "={{ $('Received Emails with Sales Label').item.json.from.value[0].address }}",
"description": "={{ $json.response.text }}"
}
},
"credentials": {
"odooApi": {
"id": "5XAxrqqPxY5dzcoP",
"name": "Odoo account"
}
},
"typeVersion": 1
},
{
"id": "a57e0e51-50d3-49de-8dc6-6fe592604765",
"name": "OpenAI Model",
"type": "@n8n/n8n-nodes-langchain.lmOpenAi",
"position": [
1040,
720
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-3.5-turbo-instruct"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "8F3dAS1qjFM6mYbD",
"name": "OpenAi account"
}
},
"typeVersion": 1
},
{
"id": "a6de25a3-3967-4957-bc98-4cb774a53dda",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
700,
220
],
"parameters": {
"width": 446.44549763033154,
"height": 261.8821936357484,
"content": "## Summarize emails and save them as notes on sales opportunity in Odoo\n\nSet up steps:\n* Configure Google Cloud credentials with Gmail access\n* Configure OpenAI credentials\n* Configure Odoo credentials\n "
},
"typeVersion": 1
},
{
"id": "8705b4de-1334-4ff2-8d5d-60ec96cfb8cd",
"name": "Summarize Email Content",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
1060,
540
],
"parameters": {
"options": {
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following sales inquiry:\n\" {{ $json.text }}\"\nInclude structured information such as project budget, timelines, industry and a general summary\n\nCONCISE SUMMARY: \n",
"combineMapPrompt": "=Write a concise summary of the following sales inquiry:\n\"{{ $json.text }}\"\nExtract information such as project budget, timelines and a general summary.\n\nCONCISE SUMMARY: \n"
}
}
}
},
"typeVersion": 2
}
],
"active": false,
"pinData": {
"Summarize Email Content": [
{
"json": {
"response": {
"text": "Mihai Farcas, Procurement Manager at Innovative Solutions Inc, is interested in incorporating CloudConnect Pro platform into their upcoming projects. They are impressed by its capabilities in cloud integration, data management, and flexibility. They request detailed information on pricing, implementation options, support services, and case studies for enterprise-level deployments. They are eager to learn more and hope for a mutually beneficial partnership. "
}
}
}
],
"Received Emails with Sales Label": [
{
"json": {
"id": "1903f41a3a4813f4",
"to": {
"html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Mihai Farcas</span> &lt;<a href=\"mailto:farcasmihai91@gmail.com\" class=\"mp_address_email\">farcasmihai91@gmail.com</a>&gt;</span>",
"text": "\"Mihai Farcas\" <farcasmihai91@gmail.com>",
"value": [
{
"name": "Mihai Farcas",
"address": "farcasmihai91@gmail.com"
}
]
},
"date": "2024-06-22T09:23:01.000Z",
"from": {
"html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Mihai Farcas</span> &lt;<a href=\"mailto:contact@mihai.ltd\" class=\"mp_address_email\">contact@mihai.ltd</a>&gt;</span>",
"text": "\"Mihai Farcas\" <contact@mihai.ltd>",
"value": [
{
"name": "Mihai Farcas",
"address": "contact@mihai.ltd"
}
]
},
"html": "<div dir=\"ltr\"><p>Dear Alex,</p><p>I hope this email finds you well.</p><p>My name is Mihai Farcas, and I&#39;m the Procurement Manager at Innovative Solutions Inc. We are a leading provider of cutting-edge technological solutions for businesses across various industries.</p><p>I&#39;m reaching out to you today to express our strong interest in your company&#39;s CloudConnect Pro platform. We&#39;ve been thoroughly impressed by its capabilities in cloud integration, data management, and overall flexibility. Our research indicates that it could be an excellent fit for our clients&#39; needs, particularly in the areas of streamlining workflows and enhancing data accessibility.</p><p>We are currently exploring the possibility of incorporating CloudConnect Pro into our upcoming projects. To this end, we would appreciate it if you could provide us with detailed information on pricing, implementation options, and support services for enterprise-level deployments. Additionally, any case studies or testimonials from companies similar to ours would be most welcome.</p><p>Given the urgency of our projects, a prompt response would be greatly appreciated. We are eager to learn more about how CloudConnect Pro can contribute to our success and look forward to the possibility of a mutually beneficial partnership.</p><p>Thank you for your time and consideration.</p><p><br></p><p>Sincerely,</p><p>Mihai Farcas</p><p>Procurement Manager</p><p>Innovative Solutions Inc.</p></div>\n",
"text": "Dear Alex,\n\nI hope this email finds you well.\n\nMy name is Mihai Farcas, and I'm the Procurement Manager at Innovative\nSolutions Inc. We are a leading provider of cutting-edge technological\nsolutions for businesses across various industries.\n\nI'm reaching out to you today to express our strong interest in your\ncompany's CloudConnect Pro platform. We've been thoroughly impressed by its\ncapabilities in cloud integration, data management, and overall\nflexibility. Our research indicates that it could be an excellent fit for\nour clients' needs, particularly in the areas of streamlining workflows and\nenhancing data accessibility.\n\nWe are currently exploring the possibility of incorporating CloudConnect\nPro into our upcoming projects. To this end, we would appreciate it if you\ncould provide us with detailed information on pricing, implementation\noptions, and support services for enterprise-level deployments.\nAdditionally, any case studies or testimonials from companies similar to\nours would be most welcome.\n\nGiven the urgency of our projects, a prompt response would be greatly\nappreciated. We are eager to learn more about how CloudConnect Pro can\ncontribute to our success and look forward to the possibility of a mutually\nbeneficial partnership.\n\nThank you for your time and consideration.\n\n\nSincerely,\n\nMihai Farcas\n\nProcurement Manager\n\nInnovative Solutions Inc.\n",
"headers": {
"to": "To: Mihai Farcas <farcasmihai91@gmail.com>",
"date": "Date: Sat, 22 Jun 2024 12:23:01 +0300",
"from": "From: Mihai Farcas <contact@mihai.ltd>",
"subject": "Subject: Urgent Inquiry for CloudConnect Pro Integration",
"message-id": "Message-ID: <CAGDzDQR5BWWjU40G26dg4AZuiMKZ5b0GtdUyn-2FbfMFs2yJwg@mail.gmail.com>",
"content-type": "Content-Type: multipart/alternative; boundary=\"00000000000064dc5b061b7718a6\"",
"mime-version": "MIME-Version: 1.0"
},
"subject": "Urgent Inquiry for CloudConnect Pro Integration",
"labelIds": [
"Label_8035866011660570111",
"IMPORTANT",
"SENT",
"INBOX"
],
"threadId": "1903f3f36f29657c",
"messageId": "<CAGDzDQR5BWWjU40G26dg4AZuiMKZ5b0GtdUyn-2FbfMFs2yJwg@mail.gmail.com>",
"textAsHtml": "<p>Dear Alex,</p><p>I hope this email finds you well.</p><p>My name is Mihai Farcas, and I&apos;m the Procurement Manager at Innovative<br/>Solutions Inc. We are a leading provider of cutting-edge technological<br/>solutions for businesses across various industries.</p><p>I&apos;m reaching out to you today to express our strong interest in your<br/>company&apos;s CloudConnect Pro platform. We&apos;ve been thoroughly impressed by its<br/>capabilities in cloud integration, data management, and overall<br/>flexibility. Our research indicates that it could be an excellent fit for<br/>our clients&apos; needs, particularly in the areas of streamlining workflows and<br/>enhancing data accessibility.</p><p>We are currently exploring the possibility of incorporating CloudConnect<br/>Pro into our upcoming projects. To this end, we would appreciate it if you<br/>could provide us with detailed information on pricing, implementation<br/>options, and support services for enterprise-level deployments.<br/>Additionally, any case studies or testimonials from companies similar to<br/>ours would be most welcome.</p><p>Given the urgency of our projects, a prompt response would be greatly<br/>appreciated. We are eager to learn more about how CloudConnect Pro can<br/>contribute to our success and look forward to the possibility of a mutually<br/>beneficial partnership.</p><p>Thank you for your time and consideration.</p><p>Sincerely,</p><p>Mihai Farcas</p><p>Procurement Manager</p><p>Innovative Solutions Inc.</p>",
"sizeEstimate": 3554
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "8c905538-5613-464b-b5a0-87e266a507c7",
"connections": {
"OpenAI Model": {
"ai_languageModel": [
[
{
"node": "Summarize Email Content",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Summarize Email Content": {
"main": [
[
{
"node": "Odoo - Create Opportunity",
"type": "main",
"index": 0
}
]
]
},
"Received Emails with Sales Label": {
"main": [
[
{
"node": "Summarize Email Content",
"type": "main",
"index": 0
}
]
]
}
}
}

View File

@@ -0,0 +1,402 @@
{
"id": "m8gr0YZgCx5Qrsia",
"meta": {
"instanceId": "b795c85ef5703ecdc784a39956949c45a099b0c52b9adbeeed744965b5aed696",
"templateCredsSetupCompleted": true
},
"name": "(G) - Email Classification",
"tags": [],
"nodes": [
{
"id": "0226578d-4741-42f2-8a7b-c750f75be78d",
"name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
0,
0
],
"parameters": {
"simple": false,
"filters": {},
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "YNdPYS7HyXbJjy7l",
"name": "Gmail account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 1.2
},
{
"id": "48d0ee27-d4d6-4db4-843c-d9c18b934945",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
220,
320
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash-001"
},
"credentials": {
"googlePalmApi": {
"id": "ZK3aD9k31PG9XVBd",
"name": "Guitar's Gemini (babystoreroom@gmail.com)"
}
},
"typeVersion": 1
},
{
"id": "d7e8bed4-cadc-41e3-b793-cc8affb177cc",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"disabled": true,
"position": [
1420,
60
],
"parameters": {
"text": "=Here's the email context: {{ $('Classification Agent').item.json.text }}",
"options": {
"systemMessage": "You are my personal assistant for Kajonkietsuksa School.\nYour role is to help me with any work-related tasks.\nOne of your main responsibilities is to write professional and polite reply emails whenever I receive an email in my inbox. Act as me, don't include something like \"here's a potential reply email or other\"\n\nWhen writing a reply email:\n\nStart by acknowledging the sender's message.\n\nAnswer their questions or address their requests clearly and directly.\n\nMaintain a polite, professional, and helpful tone.\n\nKeep the language simple and easy to understand.\n\nIf additional action is required from me, mention that I will get back to them soon.\n\nAlways end the email with a courteous closing line, such as \"Thank you\" or \"Best regards.\"\n\nKeep your writing style consistent with a warm yet formal communication style that reflects the reputation of Kajonkietsuksa School.\n\n"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "3b5cabb7-346f-4b69-b3f4-c61e78e2d8c7",
"name": "Groq Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"disabled": true,
"position": [
1440,
180
],
"parameters": {
"model": "meta-llama/llama-4-scout-17b-16e-instruct",
"options": {}
},
"credentials": {
"groqApi": {
"id": "ssFnosV0K9CllUnY",
"name": "(G) Groq account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 1
},
{
"id": "43984fb2-7a26-4e13-95ee-c29f0d9f2f24",
"name": "Gmail3",
"type": "n8n-nodes-base.gmail",
"disabled": true,
"position": [
1780,
60
],
"webhookId": "64df877a-5475-447d-860b-b62d4418d841",
"parameters": {
"message": "={{ $json.output }}",
"options": {},
"subject": "=Re: {{ $('Gmail Trigger').item.json.headers.subject }}",
"resource": "draft"
},
"credentials": {
"gmailOAuth2": {
"id": "YNdPYS7HyXbJjy7l",
"name": "Gmail account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 2.1
},
{
"id": "c269ec5e-f882-4458-ab52-46b719731309",
"name": "Classification Agent",
"type": "@n8n/n8n-nodes-langchain.textClassifier",
"position": [
240,
0
],
"parameters": {
"options": {
"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."
},
"inputText": "={{ $json.text || $json.html }}",
"categories": {
"categories": [
{
"category": "High Priority",
"description": "Emails requiring immediate attention or action, typically from key stakeholders, clients, or decision-makers. These emails often contain time-sensitive requests, deadlines, or escalated issues. Keywords: urgent, ASAP, immediate, deadline, action required, high priority"
},
{
"category": "KS Work Related",
"description": "Anything related to my school or education. Keyword: Kajonkietsuksa School, Kajonkietsuksa, School"
},
{
"category": "Promotion",
"description": "Anything related to updating on promotions. Keywords: newsletter, promotion, offer, sale, campaign, marketing, launch"
},
{
"category": "Other",
"description": "If you don't know what category is this email."
}
]
}
},
"typeVersion": 1
},
{
"id": "17be38df-c225-4d19-81ec-e205ff4b9f3c",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
260
],
"parameters": {
"color": 4,
"width": 300,
"height": 80,
"content": "### 2) Change to your desire LLMs"
},
"typeVersion": 1
},
{
"id": "3e8ac267-c2ac-49cb-ad53-536510faa1a4",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-60
],
"parameters": {
"color": 4,
"content": "### 1) Change to your gmail's credential"
},
"typeVersion": 1
},
{
"id": "f5e2c92d-3335-4ed0-915e-f7edeb0b5a92",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
-380
],
"parameters": {
"color": 4,
"width": 340,
"content": "### 3) Login to your gmail inbox\n* Create a label with \"+\" icon\n* Change the color of your choice"
},
"typeVersion": 1
},
{
"id": "4a8a7424-f9dd-42b1-b803-5d0dbe076956",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
220,
-160
],
"parameters": {
"color": 4,
"width": 320,
"content": "### 4) Agent instruction\n* Input the category name that you just created in gmail.\n* Description = Tell agent about how should it classify your email. Keywords can be useful to let your agent classify the email context."
},
"typeVersion": 1
},
{
"id": "24c7ef4e-7a68-4240-980b-02b994300084",
"name": "Add Label Promotion",
"type": "n8n-nodes-base.gmail",
"position": [
700,
200
],
"webhookId": "4e089f5f-58ea-4c8d-8870-3d155a81f0b7",
"parameters": {
"labelIds": [
"Label_4917715854276709190"
],
"messageId": "={{ $json.id }}",
"operation": "addLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "YNdPYS7HyXbJjy7l",
"name": "Gmail account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 2.1
},
{
"id": "759f8cbe-4674-49e5-a52b-2acf208ffb22",
"name": "Add Label (KS Work Related)",
"type": "n8n-nodes-base.gmail",
"position": [
700,
0
],
"webhookId": "4e089f5f-58ea-4c8d-8870-3d155a81f0b7",
"parameters": {
"labelIds": [
"Label_4956837555783205638"
],
"messageId": "={{ $json.id }}",
"operation": "addLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "YNdPYS7HyXbJjy7l",
"name": "Gmail account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 2.1
},
{
"id": "d07fe962-16c0-401a-b194-5ce7e6ad9746",
"name": "Add Label (High Priority)",
"type": "n8n-nodes-base.gmail",
"position": [
700,
-200
],
"webhookId": "4e089f5f-58ea-4c8d-8870-3d155a81f0b7",
"parameters": {
"labelIds": [
"Label_3750994713301985229"
],
"messageId": "={{ $json.id }}",
"operation": "addLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "YNdPYS7HyXbJjy7l",
"name": "Gmail account (jkp@kajonkietsuksa.ac.th)"
}
},
"typeVersion": 2.1
},
{
"id": "7d0c9bd5-6150-4afa-9344-8bb3c1a6b01c",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
-320
],
"parameters": {
"color": 4,
"width": 320,
"content": "### 5) Add Label Nodes\n* In this option \"Label Names or IDs\" -> Select the category to match with the Classification Agent Node."
},
"typeVersion": 1
},
{
"id": "d57ecacb-a479-4bf7-b9b4-b9e14e30dcd7",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
980,
60
],
"parameters": {
"color": 4,
"width": 220,
"content": "### 6) Add-on\n* You can add more category of your choice!"
},
"typeVersion": 1
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "c94df4ec-be75-449f-82fa-4e1f8878104a",
"connections": {
"AI Agent": {
"main": [
[
{
"node": "Gmail3",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "Classification Agent",
"type": "main",
"index": 0
}
]
]
},
"Groq Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Classification Agent": {
"main": [
[
{
"node": "Add Label (High Priority)",
"type": "main",
"index": 0
}
],
[
{
"node": "Add Label (KS Work Related)",
"type": "main",
"index": 0
}
],
[
{
"node": "Add Label Promotion",
"type": "main",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "Classification Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Add Label (KS Work Related)": {
"main": [
[]
]
}
}
}