Inbox manager that handles sales, HR, customer support and job application emails. A developer built an inbox manager using n8n that handles sales, HR, customer support, and job application emails. The workflow uses a Gmail trigger, OpenAI's GPT-4o-mini to classify and route emails, and sends messages to appropriate Slack channels or replies via Gmail. It also logs data to a Google Sheets CRM. | { | | | "name": "Inbox manager portfolio", | | | "nodes": | | | { | | | "parameters": { | | | "pollTimes": { | | | "item": | | | { | | | "mode": "everyMinute" | | | } | | | | | | }, | | | "simple": false, | | | "filters": {}, | | | "options": { | | | "downloadAttachments": true | | | } | | | }, | | | "type": "n8n-nodes-base.gmailTrigger", | | | "typeVersion": 1.3, | | | "position": | | | -608, | | | 192 | | | , | | | "id": "aadfafd4-237d-403a-93d8-f164e1cf32ca", | | | "name": "Gmail Trigger", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "model": { | | | " rl": true, | | | "value": "gpt-4o-mini", | | | "mode": "list", | | | "cachedResultName": "gpt-4o-mini" | | | }, | | | "builtInTools": {}, | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | | | "typeVersion": 1.3, | | | "position": | | | -96, | | | 160 | | | , | | | "id": "533962df-b0fa-4b49-bb8e-f117cd72e985", | | | "name": "OpenAI Chat Model", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "select": "channel", | | | "channelId": { | | | " rl": true, | | | "value": "C0ATKRURALD", | | | "mode": "list", | | | "cachedResultName": "marketing" | | | }, | | | "text": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Message Text', Message to the sales team channel , 'string' }}", | | | "otherOptions": { | | | "includeLinkToWorkflow": false | | | } | | | }, | | | "type": "n8n-nodes-base.slackTool", | | | "typeVersion": 2.3, | | | "position": | | | 992, | | | -528 | | | , | | | "id": "3df8c748-fab4-4abe-9633-37e95d156c9c", | | | "name": "Send a message in Slack", | | | "webhookId": "2363c252-de28-401a-adfc-d7c792c65c47", | | | "credentials": { | | | "slackApi": { | | | "id": "btscN09atAYZQ9Ol", | | | "name": "Slack account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "model": { | | | " rl": true, | | | "value": "gpt-4o-mini", | | | "mode": "list", | | | "cachedResultName": "gpt-4o-mini" | | | }, | | | "builtInTools": {}, | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | | | "typeVersion": 1.3, | | | "position": | | | 832, | | | -528 | | | , | | | "id": "d762fbf6-868f-4bd8-978f-1977521caee5", | | | "name": "OpenAI Chat Model1", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "reply", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "emailType": "text", | | | "message": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Message', Reply to the email , 'string' }}", | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.gmailTool", | | | "typeVersion": 2.1, | | | "position": | | | 1152, | | | -528 | | | , | | | "id": "3420bcf3-c3dc-4637-ae23-b46c31fd41ca", | | | "name": "Reply to a message in Gmail", | | | "webhookId": "8e39d350-1cac-481e-a694-c847d9b57e55", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "append", | | | "documentId": { | | | " rl": true, | | | "value": "1qgjy4pRGsH5i5xdUuJB 4SvoRwfI2Rp7jasIlUqGNaU", | | | "mode": "list", | | | "cachedResultName": "CRM", | | | "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qgjy4pRGsH5i5xdUuJB 4SvoRwfI2Rp7jasIlUqGNaU/edit?usp=drivesdk" | | | }, | | | "sheetName": { | | | " rl": true, | | | "value": "gid=0", | | | "mode": "list", | | | "cachedResultName": "Sheet1", | | | "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1qgjy4pRGsH5i5xdUuJB 4SvoRwfI2Rp7jasIlUqGNaU/edit gid=0" | | | }, | | | "columns": { | | | "mappingMode": "defineBelow", | | | "value": { | | | "Name": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Name', Name of lead sender , 'string' }}", | | | "Phone number": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Phone number', Phone number of the lead , 'string' }}", | | | "Email": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Email', Email address of the lead , 'string' }}", | | | "Company": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Company', Company of the lead , 'string' }}", | | | "Role of sender": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Role of sender', Role of the sender of the email , 'string' }}", | | | "Summary": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Summary', Summary of lead email and query , 'string' }}", | | | "AI reply": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'AI reply', AI reply to the lead summary , 'string' }}", | | | "Urgency": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Urgency', Urgency of the lead nurturing , 'string' }}", | | | "Value": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Value', Value of the lead , 'string' }}", | | | "Follow Up": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Follow Up', Has the lead been followed up? , 'string' }}" | | | }, | | | "matchingColumns": , | | | "schema": | | | { | | | "id": "Name", | | | "displayName": "Name", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Phone number", | | | "displayName": "Phone number", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Email", | | | "displayName": "Email", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Company", | | | "displayName": "Company", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Role of sender", | | | "displayName": "Role of sender", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Summary", | | | "displayName": "Summary", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "AI reply", | | | "displayName": "AI reply", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Urgency", | | | "displayName": "Urgency", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Value", | | | "displayName": "Value", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Follow Up", | | | "displayName": "Follow Up", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | } | | | , | | | "attemptToConvertTypes": false, | | | "convertFieldsToString": false | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleSheetsTool", | | | "typeVersion": 4.7, | | | "position": | | | 1344, | | | -528 | | | , | | | "id": "50d05670-7e6e-4491-a2d0-0023420ebcf0", | | | "name": "Append row in sheet in Google Sheets", | | | "credentials": { | | | "googleSheetsOAuth2Api": { | | | "id": "LeA6NUlWCbFLw52s", | | | "name": "Google Sheets account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "addLabels", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "labelIds": | | | "Label 4666528328732920534" | | | | | | }, | | | "type": "n8n-nodes-base.gmail", | | | "typeVersion": 2.1, | | | "position": | | | 640, | | | -224 | | | , | | | "id": "f9c8f253-81e4-408b-950c-5e923720b06f", | | | "name": "Add label to message1", | | | "webhookId": "b337ed06-f43a-477b-8a80-ffcd01a0ccc2", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "model": { | | | " rl": true, | | | "value": "gpt-4o-mini", | | | "mode": "list", | | | "cachedResultName": "gpt-4o-mini" | | | }, | | | "builtInTools": {}, | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | | | "typeVersion": 1.3, | | | "position": | | | 848, | | | -128 | | | , | | | "id": "6dd26ed1-935a-4e52-b51a-fdb5411d0219", | | | "name": "OpenAI Chat Model2", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "select": "user", | | | "user": { | | | " rl": true, | | | "value": "U0ATM5XUHHC", | | | "mode": "list", | | | "cachedResultName": "meeramnoor16" | | | }, | | | "text": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Message Text', The message to the manager , 'string' }}", | | | "otherOptions": { | | | "includeLinkToWorkflow": false | | | } | | | }, | | | "type": "n8n-nodes-base.slackTool", | | | "typeVersion": 2.3, | | | "position": | | | 992, | | | -96 | | | , | | | "id": "a6f1e48a-cbc2-4007-b7e9-b9b782a8bdc1", | | | "name": "Send a message in Slack1", | | | "webhookId": "ebb30a62-0767-4b37-b59f-126fbb88dcaf", | | | "credentials": { | | | "slackApi": { | | | "id": "btscN09atAYZQ9Ol", | | | "name": "Slack account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "calendar": { | | | " rl": true, | | | "value": "meeramnoor16@gmail.com", | | | "mode": "list", | | | "cachedResultName": "meeramnoor16@gmail.com" | | | }, | | | "additionalFields": { | | | "description": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Description', Title or description of event created , 'string' }}" | | | } | | | }, | | | "type": "n8n-nodes-base.googleCalendarTool", | | | "typeVersion": 1.3, | | | "position": | | | 1168, | | | -96 | | | , | | | "id": "716a934d-dbc9-4bef-96ee-1c677cac5c7e", | | | "name": "Create an event in Google Calendar", | | | "credentials": { | | | "googleCalendarOAuth2Api": { | | | "id": "Y0kgU0lG6T1AvFft", | | | "name": "calender" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "reply", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "emailType": "text", | | | "message": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Message', Reply message to the sender , 'string' }}", | | | "options": { | | | "appendAttribution": false | | | } | | | }, | | | "type": "n8n-nodes-base.gmailTool", | | | "typeVersion": 2.1, | | | "position": | | | 1360, | | | -96 | | | , | | | "id": "f0533d8a-4a11-4e4a-944e-b8bac0d625d1", | | | "name": "Reply to a message in Gmail1", | | | "webhookId": "3457a378-24d9-4b70-a31d-aa6d594c1697", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "pollTimes": { | | | "item": | | | { | | | "mode": "everyMinute" | | | } | | | | | | }, | | | "triggerOn": "specificFolder", | | | "folderToWatch": { | | | " rl": true, | | | "value": "1mnO7dI6Auz7cO 9cDt02yPyOeAL cS5q", | | | "mode": "list", | | | "cachedResultName": "FAQ final", | | | "cachedResultUrl": "https://drive.google.com/drive/folders/1mnO7dI6Auz7cO 9cDt02yPyOeAL cS5q" | | | }, | | | "event": "fileCreated", | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleDriveTrigger", | | | "typeVersion": 1, | | | "position": | | | 1936, | | | 80 | | | , | | | "id": "9c00c88e-1a7a-413e-b361-9095676dc01c", | | | "name": "Google Drive Trigger", | | | "credentials": { | | | "googleDriveOAuth2Api": { | | | "id": "U1yKfJ4IijdxLIPz", | | | "name": "Google Drive account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "download", | | | "fileId": { | | | " rl": true, | | | "value": "={{ $json.id }}", | | | "mode": "id" | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleDrive", | | | "typeVersion": 3, | | | "position": | | | 2160, | | | 80 | | | , | | | "id": "6a96857d-b889-4064-ba8a-9ed158e9881d", | | | "name": "Download file", | | | "credentials": { | | | "googleDriveOAuth2Api": { | | | "id": "U1yKfJ4IijdxLIPz", | | | "name": "Google Drive account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", | | | "typeVersion": 1.2, | | | "position": | | | 2384, | | | 304 | | | , | | | "id": "36f27abb-ca56-4661-ae96-74ee0f359b74", | | | "name": "Embeddings OpenAI", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "dataType": "binary", | | | "textSplittingMode": "custom", | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader", | | | "typeVersion": 1.1, | | | "position": | | | 2512, | | | 304 | | | , | | | "id": "e2d18f6b-9477-45b1-8a30-38dbb0b41f36", | | | "name": "Default Data Loader" | | | }, | | | { | | | "parameters": { | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter", | | | "typeVersion": 1, | | | "position": | | | 2592, | | | 512 | | | , | | | "id": "a6f437ff-07cd-4553-8bca-f1f05ca4c106", | | | "name": "Recursive Character Text Splitter" | | | }, | | | { | | | "parameters": { | | | "operation": "addLabels", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "labelIds": | | | "Label 7061222631030730076" | | | | | | }, | | | "type": "n8n-nodes-base.gmail", | | | "typeVersion": 2.1, | | | "position": | | | 640, | | | 288 | | | , | | | "id": "c064ae19-b49f-4bb6-b46f-c5a8ac1ee0fb", | | | "name": "Add label to message2", | | | "webhookId": "cb776359-4d92-420a-a31f-7d7377c8ef27", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "model": { | | | " rl": true, | | | "value": "gpt-4o-mini", | | | "mode": "list", | | | "cachedResultName": "gpt-4o-mini" | | | }, | | | "builtInTools": {}, | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | | | "typeVersion": 1.3, | | | "position": | | | 912, | | | 304 | | | , | | | "id": "1f530471-fd53-4385-9a70-4c130ba0ff90", | | | "name": "OpenAI Chat Model3", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "mode": "retrieve-as-tool", | | | "toolDescription": "Call this tool to get document information", | | | "pineconeIndex": { | | | " rl": true, | | | "value": "faqs", | | | "mode": "list", | | | "cachedResultName": "faqs" | | | }, | | | "options": { | | | "pineconeNamespace": "faqs" | | | } | | | }, | | | "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone", | | | "typeVersion": 1.3, | | | "position": | | | 1040, | | | 304 | | | , | | | "id": "8eda8253-0774-42ad-9a8e-ceae995c548c", | | | "name": "Pinecone Vector Store1", | | | "credentials": { | | | "pineconeApi": { | | | "id": "DPKrupDsD9Ug00gi", | | | "name": "PineconeApi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi", | | | "typeVersion": 1.2, | | | "position": | | | 1120, | | | 512 | | | , | | | "id": "96ee73ef-6df8-46a5-abeb-64c8aa3b98d9", | | | "name": "Embeddings OpenAI1", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "reply", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "emailType": "text", | | | "message": "={{ $json.output }}", | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.gmail", | | | "typeVersion": 2.1, | | | "position": | | | 1584, | | | 80 | | | , | | | "id": "237cacc4-d629-475b-aa61-e61e963ad4b6", | | | "name": "Reply to a message", | | | "webhookId": "459b4a22-93aa-4ff8-adff-f1068cba25b2", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "conditions": { | | | "options": { | | | "caseSensitive": true, | | | "leftValue": "", | | | "typeValidation": "strict", | | | "version": 2 | | | }, | | | "conditions": | | | { | | | "id": "fa343d59-916a-4835-983d-aa532ea65895", | | | "leftValue": "attachment 0", | | | "rightValue": "", | | | "operator": { | | | "type": "string", | | | "operation": "exists", | | | "singleValue": true | | | } | | | } | | | , | | | "combinator": "and" | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.if", | | | "typeVersion": 2.2, | | | "position": | | | -384, | | | 336 | | | , | | | "id": "a88bd84a-6f4f-4f9e-977a-5160b87179af", | | | "name": "If" | | | }, | | | { | | | "parameters": { | | | "operation": "addLabels", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "labelIds": | | | "Label 8907525291464628931" | | | | | | }, | | | "type": "n8n-nodes-base.gmail", | | | "typeVersion": 2.1, | | | "position": | | | 640, | | | 800 | | | , | | | "id": "a5b96688-0a78-4fe3-afe3-65d14d329eab", | | | "name": "Add label to message3", | | | "webhookId": "e0e5d1ce-41ea-4f56-b1d2-26e1a9418d3a", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "model": { | | | " rl": true, | | | "value": "gpt-4o-mini", | | | "mode": "list", | | | "cachedResultName": "gpt-4o-mini" | | | }, | | | "builtInTools": {}, | | | "options": {} | | | }, | | | "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", | | | "typeVersion": 1.3, | | | "position": | | | 864, | | | 1024 | | | , | | | "id": "b7c2be35-97d0-4162-8537-0f34c05e015c", | | | "name": "OpenAI Chat Model4", | | | "credentials": { | | | "openAiApi": { | | | "id": "rrlPPu9r54pJDwtt", | | | "name": "OpenAi account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "getAll", | | | "calendar": { | | | " rl": true, | | | "value": "meeramnoor16@gmail.com", | | | "mode": "list", | | | "cachedResultName": "meeramnoor16@gmail.com" | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleCalendarTool", | | | "typeVersion": 1.3, | | | "position": | | | 992, | | | 1024 | | | , | | | "id": "817da78f-ee70-4055-b30c-cdaac41db6a0", | | | "name": "Check available times", | | | "credentials": { | | | "googleCalendarOAuth2Api": { | | | "id": "Y0kgU0lG6T1AvFft", | | | "name": "calender" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "sendTo": "={{ $ 'Get details' .item.json.sender email }}", | | | "subject": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Subject', Subject of the Email , 'string' }}", | | | "emailType": "text", | | | "message": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Message', Email body to be sent , 'string' }}", | | | "options": { | | | "appendAttribution": false | | | } | | | }, | | | "type": "n8n-nodes-base.gmailTool", | | | "typeVersion": 2.1, | | | "position": | | | 1120, | | | 1024 | | | , | | | "id": "92430338-7487-4aec-bbfd-944da32861b5", | | | "name": "Interview Email", | | | "webhookId": "95329790-9d36-4e73-985e-9b909b57c10a", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "operation": "append", | | | "documentId": { | | | " rl": true, | | | "value": "1NkQ8qh0D3lbZW392h61ipH0Ed3AQtXTsVTH6zNG1tmE", | | | "mode": "list", | | | "cachedResultName": "Interview lists", | | | "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkQ8qh0D3lbZW392h61ipH0Ed3AQtXTsVTH6zNG1tmE/edit?usp=drivesdk" | | | }, | | | "sheetName": { | | | " rl": true, | | | "value": "gid=0", | | | "mode": "list", | | | "cachedResultName": "Sheet1", | | | "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkQ8qh0D3lbZW392h61ipH0Ed3AQtXTsVTH6zNG1tmE/edit gid=0" | | | }, | | | "columns": { | | | "mappingMode": "defineBelow", | | | "value": { | | | "Name": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Name', the name of the sender , 'string' }}", | | | "email": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'email', The email of the sender , 'string' }}", | | | "Job Role": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Job Role', The job role for which he/she applied , 'string' }}", | | | "Interview planned on": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Interview planned on', Interview date and time set , 'string' }}", | | | "CV link": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'CV link', CV of the sender , 'string' }}", | | | "Status": "={{ / n8n-auto-generated-fromAI-override / $fromAI 'Status', Interviewed or pending interview , 'string' }}" | | | }, | | | "matchingColumns": , | | | "schema": | | | { | | | "id": "Name", | | | "displayName": "Name", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "email", | | | "displayName": "email", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Job Role", | | | "displayName": "Job Role", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Interview planned on", | | | "displayName": "Interview planned on", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "CV link", | | | "displayName": "CV link", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | }, | | | { | | | "id": "Status", | | | "displayName": "Status", | | | "required": false, | | | "defaultMatch": false, | | | "display": true, | | | "type": "string", | | | "canBeUsedToMatch": true | | | } | | | , | | | "attemptToConvertTypes": false, | | | "convertFieldsToString": false | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleSheetsTool", | | | "typeVersion": 4.7, | | | "position": | | | 1248, | | | 1024 | | | , | | | "id": "f966630e-6686-48ed-95a4-3338b7845785", | | | "name": "Interview Candidates", | | | "credentials": { | | | "googleSheetsOAuth2Api": { | | | "id": "LeA6NUlWCbFLw52s", | | | "name": "Google Sheets account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "jsCode": "const item = $input.first .json;\n\nreturn {\n json: {\n subject: item.subject,\n sender email: item.from.value 0 .address,\n sender name: item.from.value 0 .name,\n body: item.text\n }\n} ;" | | | }, | | | "type": "n8n-nodes-base.code", | | | "typeVersion": 2, | | | "position": | | | -384, | | | 48 | | | , | | | "id": "0697847e-ddf5-4c29-9c95-4831450c523d", | | | "name": "Get details" | | | }, | | | { | | | "parameters": { | | | "promptType": "define", | | | "text": "=Subject:{{ $json.subject }}\n\nBody:{{ $json.body }}", | | | "options": { | | | "systemMessage": "=You are an expert email classifier. You will receive the input of an email subject and body and your job is to classify it into one of the four categories:\n1. Customer support\n2. HR\n3. Sales\n4. Job application\nYou will be given descriptions of each of the following categories. You can read the email subject and body, then classify it, output it, and just the category, nothing else. No explanation, nothing, just the category name.\n\nSales Description:\nCategory: Sales / Lead Inquiry\nSender Type: Potential Customer / Business Lead\nIntent: Interested in services & pricing\nPriority: Medium–High\nRequired Action: Sales follow-up + send proposal/info\n\nCustomer support description:\nCategory: Customer Support\nSender Type: Existing Customer\nIntent: Technical issue / troubleshooting\nPriority: High\nRequired Action: Support ticket or troubleshooting response\n\n\nHR description:\nCategory: HR Internal Complaint\nSender Type: Employee\nIntent: Workplace issue / workload concern\nPriority: High\nRequired Action: HR review + managerial escalation\n\nJob application description:\nCategory: Job Application\nSender Type: Candidate\nIntent: Apply for job role\nPriority: Medium\nRequired Action: HR screening + resume evaluation" | | | } | | | }, | | | "type": "@n8n/n8n-nodes-langchain.agent", | | | "typeVersion": 3, | | | "position": | | | -160, | | | -64 | | | , | | | "id": "1cc45097-bb92-4abe-a072-91daac8b2827", | | | "name": "Classify" | | | }, | | | { | | | "parameters": { | | | "assignments": { | | | "assignments": | | | { | | | "id": "798042b6-ea7d-4de6-ad6b-3956402245a7", | | | "name": "Category", | | | "value": "={{ $json.output }}", | | | "type": "string" | | | } | | | | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.set", | | | "typeVersion": 3.4, | | | "position": | | | 192, | | | 48 | | | , | | | "id": "50faea61-cb31-4fc3-9bea-858dd32d6316", | | | "name": "Set info" | | | }, | | | { | | | "parameters": { | | | "inputDataFieldName": "attachment 0", | | | "name": "=CV: {{ $json.from.value 0 .name }}", | | | "driveId": { | | | " rl": true, | | | "mode": "list", | | | "value": "My Drive" | | | }, | | | "folderId": { | | | " rl": true, | | | "value": "1KEqWz2b22ATDEJlp2ANxWHulmKEbMvOF", | | | "mode": "list", | | | "cachedResultName": "Invoices", | | | "cachedResultUrl": "https://drive.google.com/drive/folders/1KEqWz2b22ATDEJlp2ANxWHulmKEbMvOF" | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.googleDrive", | | | "typeVersion": 3, | | | "position": | | | -96, | | | 320 | | | , | | | "id": "f36af291-8cc0-44d8-8f4e-661a557afd75", | | | "name": "CVs", | | | "credentials": { | | | "googleDriveOAuth2Api": { | | | "id": "U1yKfJ4IijdxLIPz", | | | "name": "Google Drive account" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "rules": { | | | "values": | | | { | | | "conditions": { | | | "options": { | | | "caseSensitive": true, | | | "leftValue": "", | | | "typeValidation": "strict", | | | "version": 2 | | | }, | | | "conditions": | | | { | | | "leftValue": "={{ $json.Category }}", | | | "rightValue": "Sales", | | | "operator": { | | | "type": "string", | | | "operation": "equals" | | | }, | | | "id": "63cd2c21-b4b6-4223-88cd-48ab1fef3a4e" | | | } | | | , | | | "combinator": "and" | | | }, | | | "renameOutput": true, | | | "outputKey": "Sales" | | | }, | | | { | | | "conditions": { | | | "options": { | | | "caseSensitive": true, | | | "leftValue": "", | | | "typeValidation": "strict", | | | "version": 2 | | | }, | | | "conditions": | | | { | | | "id": "5e5a1e84-803b-4fd5-94d8-acd40e443301", | | | "leftValue": "={{ $json.Category }}", | | | "rightValue": "HR", | | | "operator": { | | | "type": "string", | | | "operation": "equals" | | | } | | | } | | | , | | | "combinator": "and" | | | }, | | | "renameOutput": true, | | | "outputKey": "HR" | | | }, | | | { | | | "conditions": { | | | "options": { | | | "caseSensitive": true, | | | "leftValue": "", | | | "typeValidation": "strict", | | | "version": 2 | | | }, | | | "conditions": | | | { | | | "id": "863d83ce-1197-4890-952b-9e65548b10fc", | | | "leftValue": "={{ $json.Category }}", | | | "rightValue": "Customer support", | | | "operator": { | | | "type": "string", | | | "operation": "equals" | | | } | | | } | | | , | | | "combinator": "and" | | | }, | | | "renameOutput": true, | | | "outputKey": "Customer support" | | | }, | | | { | | | "conditions": { | | | "options": { | | | "caseSensitive": true, | | | "leftValue": "", | | | "typeValidation": "strict", | | | "version": 2 | | | }, | | | "conditions": | | | { | | | "id": "6f0bdc7c-a25b-4bac-be08-11c80592b016", | | | "leftValue": "={{ $json.Category }}", | | | "rightValue": "Job Application", | | | "operator": { | | | "type": "string", | | | "operation": "equals" | | | } | | | } | | | , | | | "combinator": "and" | | | }, | | | "renameOutput": true, | | | "outputKey": "Job application" | | | } | | | | | | }, | | | "options": {} | | | }, | | | "type": "n8n-nodes-base.switch", | | | "typeVersion": 3.3, | | | "position": | | | 416, | | | 16 | | | , | | | "id": "107aaa5c-2d2f-47e4-89fa-2c887cc61249", | | | "name": "Route to" | | | }, | | | { | | | "parameters": { | | | "operation": "addLabels", | | | "messageId": "={{ $ 'Gmail Trigger' .item.json.id }}", | | | "labelIds": | | | "Label 3731949293815751242" | | | | | | }, | | | "type": "n8n-nodes-base.gmail", | | | "typeVersion": 2.1, | | | "position": | | | 640, | | | -624 | | | , | | | "id": "ed1bac9e-5a3e-4f88-8b5a-22e91c02cbfc", | | | "name": "Sales", | | | "webhookId": "ca9b672c-b430-4a32-9b78-d822ab75e947", | | | "credentials": { | | | "gmailOAuth2": { | | | "id": "S5dxycQTXjdVeyg7", | | | "name": "Gmail credential" | | | } | | | } | | | }, | | | { | | | "parameters": { | | | "promptType": "define", | | | "text": "={{ $ 'Get details' .item.json.subject }}\n{{ $ 'Get details' .item.json.body }}\n\nEmail of sender:{{ $ 'Get details' .item.json.sender email }}", | | | "options": { | | | "systemMessage": "= Overview\nYou are an AI agent responsible for managing qualified sales leads received from a Gmail node. Your role is to extract structured lead data, generate a high-quality response, update a Google Sheets CRM, and prepare a Slack notification for the sales team.\n\n---\n\n Context\n- Emails are already pre-qualified as leads before reaching this agent.\n- Each email contains a potential business opportunity with varying levels of detail.\n- The agent must intelligently extract available information without assuming missing data.\n- All outputs must support sales follow-up and CRM tracking.\n- Tone of communication must be warm, friendly, and professional.\n- Technical details should be included when relevant.\n- No pricing information, no calendar scheduling, and no meeting links should be included.\n- The agent may suggest scheduling a meeting in general terms without specifying time slots.\n\n---\n\n Instructions\n\n 1. Email Processing\n1. Read the incoming email subject and body.\n2. Extract all available lead information:\n - Name if available \n - Email address\n - Phone number if available \n - Company name if available \n - Role/title if available \n - Lead request or intent\n - Any contextual signals budget, urgency, company size, buying intent \n\n---\n\n 2. Lead Value & Urgency Assessment\n1. Assign a lead value based on:\n - Mention of budget or buying intent\n - Company size e.g., multinational, enterprise, startup \n - Urgency indicators e.g., “asap”, “urgent”, time-sensitive project \n2. Classify urgency as:\n - Low\n - Medium\n - High\n3. If information is missing, infer conservatively from context without guessing specifics.\n\n---\n\n 3. AI Reply Generation\n1. Generate a warm, friendly, and helpful response.\n2. Ensure the reply:\n - Directly addresses the lead’s request\n - Includes relevant technical clarification if needed\n - Does NOT include pricing\n - Does NOT include scheduling times or calendar links\n - May invite the lead to continue the conversation or suggest arranging a meeting in general terms\n3. Keep tone professional but approachable.\n4. Sign off the email by MN techbite.\n---\n\n 4. Google Sheets CRM Update\nUpdate the CRM with available information. Only fill fields that are present.\n\n Fields: \n- Lead Name\n- Lead Email from which the email came from\n- Phone Number\n- Company Name\n- Role / Position if available \n- Lead Request\n- AI Reply\n- Lead Value Low / Medium / High based on context \n- Urgency Level Low / Medium / High \n- Follow-up Required Yes / No \n\n Rules: \n- Do not overwrite existing data unless explicitly provided as an update.\n- Leave fields blank if information is not available.\n- Ensure structured and clean data entry.\n\n---\n\n 5. Slack Notification Preparation\n1. Prepare a pre-formatted message for the sales team Slack channel.\n2. Include:\n - Lead summary\n - Company if available \n - Lead request summary\n - Urgency level\n - Lead value\n - Short version of AI reply\n3. Do not send directly; only output the message content for the Slack node.\n4. Slack channel name will be provided externally as a variable.\n\n Reply to the lead via Gmail tool\nRead the incoming email and curate a reply for the lead send it via Gmail tool and sign off as MN techbite and if necessary tell them that if they wanna book a call with the company you can assist them\n\n---\n\n Tools\n\n- Gmail Node Input source for email subject and body \n- Google Sheets CRM Tool for structured lead storage \n- Slack Notify Tool for sending prepared summary message \n- Structured Output Parser for mapping extracted fields to CRM columns \n\n---\n\n Examples\n\n Input Email\nSubject: Enterprise API integration inquiry \nBody: We are a multinational company looking to integrate your API. Budget is flexible. Urgent requirement.\n\n Output Extraction\n- Name: Not provided\n- Email: john@company.com\n- Company: GlobalTech Inc.\n- Role: CTO\n- Lead Request: API integration inquiry for enterprise system\n- Urgency: High\n- Lead Value: High\n\n AI Reply\nThank you for reaching out. We appreciate your interest in integrating our API into your systems. Based on your requirements, we can support enterprise-grade integrations and would be happy to explore your technical setup in more detail. Let us know how you'd like to proceed, and we can continue the conversation further.\n\n Slack Message\nNew High-Value Lead \nCompany: GlobalTech Inc. \nRequest: API integration inquiry \nUrgency: High \nSummary: Enterprise interested in API integration with flexible budget \nAI Response: Replied with technical overview and next-step engagement\n\n---\n\n SOP Standard Operating Procedure \n\n1. Receive email from Gmail node pre-qualified lead .\n2. Parse subject and body content.\n3. Extract all available lead information.\n4. Evaluate urgency and lead value using contextual signals.\n5. Generate a warm, compliant AI response.\n6. Populate Google Sheets CRM with available data only.\n7. Prepare structured Slack notification message.\n8. Output structured data for downstream automation tools.\n\n---\n\n Final Notes\n\n- Never assume missing data.\n- Never include pricing or scheduling links.\n- Always prioritize clarity and professionalism.\n- Keep outputs structured and automation-ready.\n- Ensure Slack message is concise and sales-action oriented." | | | } | | | }, | | | "type": "@n8n/n8n-nodes-langchain.agent", | | | "typeVersion": 3, | | | "position": | | | 992, | | | -720 | | | , | | | "id": "4fac1b6b-df09-4695-8966-131a9addf9e0", | | | "name": "Sales Agent" | | | }, | | | { | | | "parameters": { | | | "promptType": "define", | | | "text": "=Subject:{{ $ 'Get details' .item.json.subject }}\nBody:{{ $ 'Get details' .item.json.body }}\nSender:{{ $ 'Get details' .item.json.sender email }}\nSender Name:{{ $ 'Get details' .item.json.sender name }}", | | | "options": { | | | "systemMessage": "= Overview\n\nYou are an AI HR Assistant for MN TechByte responsible for managing incoming HR-related emails. Your responsibilities include analyzing employee emails, determining their intent, coordinating with managers when required, preparing meetings, generating professional email responses, and preparing Slack notifications for internal communication.\n\n---\n\n Context\n\n- Incoming emails are received from a Gmail node.\n- The AI agent should classify each email based on its content.\n- The agent should only use information explicitly available in the email.\n- All communication should be professional, empathetic, confidential, and supportive.\n- The company calendar, Slack, and email reply actions are handled by downstream workflow nodes.\n- The AI agent prepares the content and structured data required for these actions.\n\n---\n\n Instructions\n\n 1. Process the Email\n\nRead the incoming email and extract:\n\n- Sender Name\n- Sender Email\n- Email Subject\n- Email Body\n\nClassify the email into one of the following categories:\n\n- Complaint\n- Concern\n- Review / Feedback\n- General HR Inquiry\n- Other\n\nIf the category is uncertain, choose the closest matching classification based on the email context.\n\n---\n\n 2. Complaint Workflow\n\nIf the email is classified as a Complaint:\n\n1. Prepare a notification for the employee's manager.\n2. Prepare a calendar meeting using calender tool between:\n - Manager\n - Employee\n -HR\n3. Generate an empathetic email reply that:\n - Acknowledges the complaint\n - Apologizes for the employee's experience\n - Assures them the matter will be investigated\n - Explains that HR has initiated the appropriate internal process\n4. Prepare a Slack message notifying the manager that:\n - A complaint has been received\n - A meeting has been scheduled\n - Immediate attention is recommended\n\n---\n\n 3. Concern or Review Workflow\n\nIf the email is classified as a Concern or Review:\n\n1.Create meeting between manager, employee and HR.\n2. Notify the appropriate manager.\nby Preparing a Slack notification summarizing:\n - Employee\n - Email category\n - Summary of the issue\n - Recommended follow-up\n\n3. Generate an email reply that:\n - Thanks the employee\n - Acknowledges their feedback or concern\n - Assures them their message has been shared with the appropriate manager\n\n\n\n---\n\n 4. General HR Inquiry\n\nIf the email is a general HR question:\n\n1. Generate a helpful and professional response.\n2. Answer using available company knowledge if possible.\n3. If additional HR review is required, indicate that the HR team will follow up.\n4. No meeting is required unless explicitly requested.\n\n---\n\n 5. Email Reply Requirements\n\nEvery email reply must:\n\n- Be warm and professional\n- Show empathy where appropriate\n- Avoid making promises that HR cannot guarantee\n- Be concise and respectful\n- End with:\n\nRegards,\n\nMN TechByte HR\n\n---\n\n 6. Slack Message Requirements\n\nSlack messages should include:\n\n- Employee Name\n- Email Category\n- Short Summary\n- Required Action\n- Meeting Status if applicable \n\nEvery Slack message must end with:\n\nHR\n\n---\n\n 7. Calendar Meeting Preparation\nCreate meeting events in calender if necessary to discuss it with the employee or manager or both\nPrepare:\nDo not assign a specific date or time unless provided by another workflow node.\n\n---\n\n Structured Outputs\n\n Employee Information\n\n- Employee Name\n- Employee Email\n\n Email Information\n\n- Subject\n- Body\n- Category\n\n Calendar\n\n- Create Meeting Yes/No \n- Participants\n- Meeting Title\n- Purpose\n\n Email Reply\n\n- Subject\n- Reply Body\n\n Slack Notification\n\n- Manager\n- Summary\n- Action Required\n\n---\n\n Tools\n\nThe AI agent has access to the following tools:\n\n Gmail\n\n- Read incoming email\n- Reply to email\n\n Company Calendar\n\n- Create meeting\n\n\n Slack\n\n- Send notification to manager\n\n Structured Output Parser\n\nGenerate structured JSON for downstream workflow nodes.\n\n---\n\n Examples\n\n Example 1\n\nInput:\n\nSubject:\nWorkplace Harassment Concern\n\nBody:\nI would like to report repeated inappropriate behavior from a colleague. This situation has made me uncomfortable.\n\nClassification:\n\nComplaint\n\nActions:\n\n- Notify manager\n- Prepare meeting\n- Generate apology email\n- Prepare Slack notification\n\n---\n\n Example 2\n\nInput:\n\nSubject:\nSuggestion for Hybrid Work Policy\n\nBody:\nI believe allowing one additional remote work day would improve productivity.\n\nClassification:\n\nReview\n\nActions:\n\n- Notify manager\n- Thank employee\n- Prepare Slack summary\n\n---\n\n Example 3\n\nInput:\n\nSubject:\nQuestion About Leave Balance\n\nBody:\nCould you please let me know how many annual leave days I have remaining?\n\nClassification:\n\nGeneral HR Inquiry\n\nActions:\n\n- Generate informative reply\n- No meeting\n- No manager notification unless required\n\n---\n\n SOP Standard Operating Procedure \n\n1. Receive email from Gmail.\n2. Extract sender information.\n3. Analyze subject and body.\n4. Classify email type.\n5. Determine required workflow.\n6. Generate email response.\n7. Prepare manager Slack notification if required.\n8. Prepare calendar meeting if required.\n9. Return structured outputs for downstream automation.\n\n---\n\n Final Notes\n\n- Maintain employee confidentiality.\n- Never disclose sensitive information in Slack messages.\n- Use a respectful, empathetic, and professional tone.\n- Do not fabricate information that is not present in the email.\n- Calendar meetings should only be prepared for complaint-related cases unless explicitly requested.\n- Always ensure email replies end with:\n\nRegards,\n\nMN TechByte HR\n\n- Always ensure Slack messages end with:\n\nHR" | | | } | | | }, | | | "type": "@n8n/n8n-nodes-langchain.agent", | | | "typeVersion": 3, | | | "position": | | | 992, | | | -320 | | | , | | | "id": "5d2a7423-48a9-4e05-9d35-79ce46f03681", | | | "name": "HR agent" | | | }, | | | { | | | "parameters": { | | | "promptType": "define", | | | "text": "=Subject:{{ $ 'Get details' .item.json.subject }}\nBody:{{ $ 'Get details' .item.json.body }}\nSender:{{ $ 'Get details' .item.json.sender name }}\nEmail of sender: {{ $ 'Get details' .item.json.sender email }}", | | | "options": { | | | "systemMessage": "= Overview\n\nYou are an AI Customer Support Agent for MN TechByte. Your role is to resolve customer issues using the Pinecone Vector Store and generate a high-quality reply message for a Gmail REPLY node.\n\nYou are NOT responsible for sending emails directly. You ONLY generate the reply body.\n\n---\n\n Context\n\n- Incoming email data is already provided via Gmail node:\n - Sender Name\n - Sender Email\n - Subject\n - Body\n\n- The Gmail tool is configured as a REPLY node:\n - It automatically handles recipient\n - It automatically handles subject and thread\n - You MUST NOT generate subject or email metadata\n\n- Your only output is the EMAIL BODY content.\n\n---\n\n Instructions\n\n 1. Understand the Email\n\nExtract and analyze:\n\n- Customer name\n- Issue or question\n- Context of the problem\n- Any error messages or technical details\n\n---\n\n 2. Knowledge Base Search MANDATORY \n\nUse Pinecone Vector Store to retrieve relevant documentation.\n\nSearch using:\n- Issue description\n- Keywords\n- Error messages\n- Workflow types\n- Symptoms\n\nRules:\n- Pinecone is the ONLY source of truth\n- Do NOT guess or hallucinate solutions\n\n---\n\n 3. Build Response Using Documentation\n\nYour response must:\n\n- Be fully based on Pinecone knowledge base\n- Include correct troubleshooting steps\n- Be simple, structured, and easy to follow\n- Be accurate and actionable\n\nIf no relevant data is found:\n- Inform the user politely\n- Recommend escalation to support team\n- Do NOT invent solutions\n\n---\n\n 4. Response Style Rules\n\nTone must be:\n\n- Warm\n- Friendly\n- Professional\n- Helpful\n- Reassuring\n\nFormatting:\n\n- Use short paragraphs\n- Use bullet points for steps\n- Avoid jargon unless necessary\n- Always encourage follow-up questions\n\n---\n\n 5. Escalation Rules\n\nEscalate if:\n\n- Issue matches escalation guidelines in knowledge base\n- Problem persists after standard steps\n- Customer mentions data loss or critical failure\n- Authentication or API issues cannot be resolved\n\nIf escalation is needed:\n- Ask only relevant diagnostic details:\n - Workflow name\n - Execution ID\n - Error message\n - Screenshots if needed \n- Do NOT promise resolution time\n\n---\n\n 6. OUTPUT FORMAT CRITICAL \n\nYou MUST output ONLY the email body text.\n\nNO JSON\nNO subject\nNO \"to\"\nNO explanations\nNO markdown code blocks\n\n---\n\n 7. EMAIL BODY STRUCTURE\n\nYour response should follow this structure:\n\n1. Greeting\n2. Acknowledgment of the issue\n3. Explanation based on Pinecone docs \n4. Step-by-step solution\n5. Additional help offer\n\n---\n\n Example Output\n\nHello,\n\nThank you for reaching out to MN TechByte Support.\n\nBased on your issue, it appears that your workflow may not be triggering due to incorrect configuration or inactive status.\n\nPlease try the following steps:\n\n• Ensure the workflow is activated \n• Verify your trigger configuration \n• Check if authentication is still valid \n• Review execution history for errors \n• Test the trigger using a sample event \n\nIf the issue persists, please share your workflow name and any error messages so we can investigate further.\n\nWe’re here to help if you need anything else.\n\nBest regards, \nMN TechByte Customer Support\n\n---\n\n Tools\n\n Pinecone Vector Store MANDATORY \n\n- Use for all troubleshooting and answers\n- Never respond without querying it first\n\n Gmail Reply Node\n\n- Sends the email automatically\n- Uses your generated body as reply content\n\n---\n\n SOP\n\n1. Receive email from Gmail node\n2. Extract issue details\n3. Query Pinecone Vector Store\n4. Retrieve relevant troubleshooting steps\n5. Construct response based ONLY on documentation\n6. Format response as plain email body\n7. Return output to Gmail reply node\n\n---\n\n Final Notes\n\n- You are ONLY responsible for the email body\n- Gmail handles sender, subject, and threading\n- Pinecone is the only knowledge source\n- Never hallucinate fixes\n- Keep responses clear, structured, and helpful" | | | } | | | }, | | | "type": "@n8n/n8n-nodes-langchain.agent", | | | "typeVersion": 3, | | | "position": | | | 944, | | | 80 | | | , | | | "id": "4c222a9d-a99e-47c9-9b3e-18870a7ce598", | | | "name": "Customer support agent" | | | }, | | | { | | | "parameters": { | | | "promptType": "define", | | | "text": "=Subject:{{ $ 'Get details' .item.json.subject }}\nBody:{{ $ 'Get details' .item.json.body }}\nSender:{{ $ 'Get details' .item.json.sender name }}\nSender Email:{{ $ 'Get details' .item.json.sender email }}", | | | "options": { | | | "systemMessage": "= Overview\n\nYou are an AI Recruitment Automation Agent for MN TechByte. Your job is to screen candidates for AI/Automation roles, schedule interviews ONLY for qualified candidates, and manage interview records in Google Sheets.\n\nYou operate as a strict role-based hiring automation system.\n\n---\n\n Context\n\nYou receive incoming emails containing:\n\n- Sender Name\n- Sender Email\n- Subject\n- Email Body\n\nYou have access to:\n\n1. Calendar Tool: \"Check Available Time\"\n - Used to find interview slots Monday–Friday only \n\n2. Google Sheets Tool:\n - Stores ONLY qualified candidates who are scheduled for interviews\n\n3. Send Email Tool:\n - Sends interview or rejection emails\n\n---\n\n CRITICAL BUSINESS RULE\n\n Qualification is STRICTLY ROLE-BASED\n\nA candidate is QUALIFIED ONLY IF they are applying for or clearly match:\n\n- AI Automation Engineer\n- AI Automation Specialist\n- AI Engineer\n- AI Voice Agent Developer\n- LLM / AI Integration Engineer\n- Workflow Automation Engineer Zapier, Make, n8n \n\n If NOT related to these roles:\n- Candidate is NOT qualified\n- MUST send rejection email\n- MUST NOT schedule interview\n- MUST NOT store in Google Sheets\n\n---\n\n Instructions\n\n 1. Parse Incoming Email\n\nExtract:\n\n- Candidate Name\n- Candidate Email\n- Job Role Applied For\n- Skills / Tools Mentioned\n- Intent of application\n\n---\n\n 2. STEP 1: ROLE QUALIFICATION CHECK MANDATORY \n\nDetermine if the candidate is applying for a VALID ROLE.\n\n QUALIFIED:\n- AI Automation Engineer\n- AI Engineer\n- AI Automation Specialist\n- AI Voice / LLM Engineer\n- Workflow Automation Zapier / Make / n8n \n\n NOT QUALIFIED:\n- Any unrelated role\n- Generic applications with no AI/automation relevance\n\n---\n\n 3. DECISION LOGIC STRICT \n\n IF NOT QUALIFIED:\n\n- Send rejection email immediately using Send Email tool\n- STOP workflow\n- DO NOT check calendar\n- DO NOT use Google Sheets\n\n---\n\n IF QUALIFIED:\n\nYou MUST always schedule an interview.\n\nEven if availability is in the future — NEVER reject due to timing.\n\n---\n\n 4. INTERVIEW SCHEDULING Calendar Tool \n\nFor QUALIFIED candidates:\n\n1. Use \"Check Available Time\"\n2. Find earliest available slot\n3. Constraints:\n - Monday–Friday only\n - Choose earliest possible slot even if later in time \n\n---\n\n 5. INTERVIEW GUARANTEE RULE CRITICAL \n\nIf candidate is qualified:\n\n- You MUST ALWAYS schedule an interview\n- NEVER reject due to no immediate availability\n- If no early slot exists:\n - select next available future slot automatically\n\n---\n\n 6. EMAIL SENDING Send Email Tool – MANDATORY \n\n IF QUALIFIED → INTERVIEW EMAIL\n\nSend using Send Email tool:\n\n- to: Candidate Email\n- subject: \"Interview Scheduled – MN TechByte\"\n- body MUST include:\n\n Required content:\n- Warm greeting\n- Confirmation of interview selection\n- EXACT interview date and time from calendar tool \n- Statement:\n \"Your interview has been scheduled for