Sistema automatizado de clasificación y respuesta de correos con Groq AI y Pinecone

Avanzado

Este es unTicket Management, AI Summarizationflujo de automatización del dominio deautomatización que contiene 38 nodos.Utiliza principalmente nodos como Code, Switch, Twitter, EmailSend, HttpRequest. Sistema automatizado de clasificación y respuesta de correos electrónicos usando Groq AI y Pinecone

Requisitos previos
  • Credenciales de API de Twitter
  • Pueden requerirse credenciales de autenticación para la API de destino
  • Clave de API de Pinecone
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "4ec72f345837e652f6ec393f7f7457d09446df2a23a7c6ffddff8265d46e2be9"
  },
  "nodes": [
    {
      "id": "8befe960-178d-4983-b962-7487817baed4",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -1900,
        1100
      ],
      "parameters": {
        "options": {},
        "downloadAttachments": true
      },
      "typeVersion": 2
    },
    {
      "id": "29a32c21-8f26-4d64-9a43-875ddd566c72",
      "name": "Switch1",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1460,
        1016
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "hr",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "bb988e36-c702-4b83-8ec1-f4f585f3b411",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "hr"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "billing",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "06afe4de-1542-46e9-9d57-7775b3b2d185",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "billing"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "complaint",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "069fdd96-983f-46a7-a709-863cdbc6384d",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "complaint"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "feedback",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f3e821fa-8b78-427e-abe4-38ae628624e1",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "feedback"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "inquiry",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "4a46eaa4-e960-4f3b-b23c-b04d9dbb61e0",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "inquiry"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "sales",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f4a3c28e-ca9f-4c7c-aa04-010832d7dab5",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json[\"subject\"] }}",
                    "rightValue": "sales"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "unknown",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "263fd3c7-1e12-4b2e-96b2-0b99e713632d",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$json[\"category\"]}}",
                    "rightValue": "unknown"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "054ce674-7ec3-472c-aece-239291db890c",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        -1680,
        1100
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const subject = $json.subject ? $json.subject.toLowerCase() : \"\";\n\nlet category = \"unknown\";\n\nif (/resume|cv|job/.test(subject)) {\n  category = \"hr\";\n} else if (/invoice|bill/.test(subject)) {\n  category = \"billing\";\n} else if (/complaint|problem|issue/.test(subject)) {\n  category = \"complaint\";\n} else if (/feedback|suggestion/.test(subject)) {\n  category = \"feedback\";\n} else if (/inquiry|open|working|tomorrow|holiday/.test(subject)) {\n  category = \"inquiry\";\n} else if (/sales|offer|quotation/.test(subject)) {\n  category = \"sales\";\n\n}\n\nreturn {\n  json: {\n    ...$json,\n    category\n  }\n};\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "2d3a2fa0-db9c-44e1-89da-0b7a98626bd8",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -860,
        1400
      ],
      "parameters": {
        "text": "=##role\nYou are an email classifier. Given an email's subject and body, return one of these exact categories: [\"hr\", \"billing\", \"complaint\", \"feedback\", \"inquiry\", \"sales\", \"client\"].\n\nOnly return one word from this list. If the email is a bill or invoice, return \"billing\". If it's a job application, return \"hr\". If unsure, return \"inquiry\".\n\nSubject: {{ $json[\"subject\"] }}\nBody: {{ $json[\"body\"] }}\n",
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "2b0efec2-3508-4a37-945c-2085439d05fd",
      "name": "Groq Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -760,
        1620
      ],
      "parameters": {
        "model": "llama-3.3-70b-versatile",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "700feb4d-f5f7-4a64-80cc-e95db99716fc",
      "name": "Groq Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -660,
        1040
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "ce29423e-ea17-4cdd-81cc-16172776bdb9",
      "name": "X",
      "type": "n8n-nodes-base.twitter",
      "position": [
        -140,
        760
      ],
      "parameters": {
        "text": "=Another happy customer said: \" {{ $json.textPlain }}\"\n",
        "additionalFields": {}
      },
      "typeVersion": 2
    },
    {
      "id": "ff416773-6aa0-468a-895b-5970caaf371c",
      "name": "Groq Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        340,
        1280
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "cbe51847-bddb-4169-a9b2-545005416936",
      "name": "Basic LLM Chain1",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -980,
        180
      ],
      "parameters": {
        "text": "=You are an HR assistant.\n\nHere is the job description for the role:\n\n[Insert role details here, e.g., \"Looking for a Python Developer with experience in Django, REST APIs, and SQL.\"]\n\nNow, read the following candidate's email/resume and evaluate if they are a good fit for this role.\n\nIf suitable, respond with:\nACCEPT - and a brief explanation why.\n\nIf not suitable, respond with:\nREJECT - and a brief explanation why.\n\nCandidate's email/resume:\n{{ $json[\"emailText\"] }}\n",
        "promptType": "define"
      },
      "typeVersion": 1.6
    },
    {
      "id": "be7d4f6d-64a0-4be0-b70c-e60abfa610f7",
      "name": "Groq Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        -900,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "d69d1118-5fd7-4e7f-a2c2-8e66d8d40c19",
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "position": [
        -540,
        280
      ],
      "parameters": {
        "jsCode": "const aiResponse = $json[\"text\"] || \"\";  // Adjust key if different\nconst isAccepted = aiResponse.toLowerCase().startsWith(\"accept\");\n\nreturn [{\n  json: {\n    decision: isAccepted ? \"accept\" : \"reject\",\n    aiResponse: aiResponse,\n    candidateEmail: $json[\"candidateEmail\"] || \"\", // get candidate email from previous nodes\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ecd67230-4807-48bf-acf7-70092f4476fd",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -320,
        280
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "accept",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "366a42b8-a4eb-4488-9872-6f1aa097fc48",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json[decision] }}",
                    "rightValue": "accept"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "reject",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6146a9fb-3988-4078-af40-4c87840816a9",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json[decision] }}",
                    "rightValue": "reject"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "ff741958-dfd7-4c46-945d-10cfe521bd7d",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        460,
        1240
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "toolName": "knowlagebase",
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "demokb",
          "cachedResultName": "demokb"
        },
        "toolDescription": "company dock"
      },
      "typeVersion": 1.1
    },
    {
      "id": "97811059-7058-4b93-b62b-d65ac30da74e",
      "name": "Embeddings Cohere",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        600,
        1400
      ],
      "parameters": {
        "modelName": "embed-english-v3.0"
      },
      "typeVersion": 1
    },
    {
      "id": "8fd67212-0a9d-4783-acc1-93c7d86c820b",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1580,
        2060
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d4b781d1-fe8b-414c-b374-c42d97549763",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1360,
        2060
      ],
      "parameters": {
        "url": "https://www.dropbox.com/scl/fo/p05bb9t8o6ech9d1joj7s/AKJmlI3mlt3O8qSjGbroMLc?rlkey=m1h852ks0y2o1gmdmbk3uda1d&st=pk0pq820&dl=1",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0341b254-3ece-450b-aa3b-de531cbfb1f1",
      "name": "Extract from File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -1140,
        2060
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "ffbc75c1-b3ed-4fa6-8cd5-3bbed81c60d1",
      "name": "Code3",
      "type": "n8n-nodes-base.code",
      "position": [
        -920,
        2060
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "\nconst text = $json.extractedText || $json.text || '';\n\n\nconst cleanedText = text.replace(/\\s+/g, ' ').trim();\n\nreturn {\n  json: {\n    original: text,\n    cleaned: cleanedText\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1c00d468-87ec-433c-939e-48049c133130",
      "name": "Pinecone Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        -700,
        2060
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "demokb",
          "cachedResultName": "demokb"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "404e80ef-fb17-4cbd-9198-23b951b36edf",
      "name": "Embeddings Cohere1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsCohere",
      "position": [
        -700,
        2280
      ],
      "parameters": {
        "modelName": "embed-multilingual-v3.0"
      },
      "typeVersion": 1
    },
    {
      "id": "761ca395-d8d9-4ad4-a8de-b741dc8ddef0",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -580,
        2300
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "41b8a97b-7350-4b87-8586-8f558394df54",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -500,
        2480
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "05cfdbad-4dc1-45de-8a25-22762dbf07b7",
      "name": "send email to team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        80,
        860
      ],
      "webhookId": "408004d1-ebdb-4776-a9f8-6a470db658a0",
      "parameters": {
        "text": "=New feedback received:\n\nSubject: {{$json[\"subject\"]}}\n\nContent: {{$json[\"emailContent\"]}}\n\nSentiment: {{$json[\"sentiment\"]}}\n",
        "options": {},
        "subject": "negative feedback",
        "toEmail": "={{ demo_to_email }}",
        "fromEmail": "{{ demo_from_email }",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "42abb326-e9b3-41eb-9840-704b83d3821c",
      "name": "send reply to customer",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        620,
        980
      ],
      "webhookId": "bf79c357-f57f-4851-a8bc-c95602e4c069",
      "parameters": {
        "text": "={{ $json.output }}",
        "options": {},
        "subject": "inqury reply",
        "toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
        "fromEmail": "={{ demo_from_email }",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "7cc49a03-c131-4064-a603-1264b9602060",
      "name": "send to support team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -400,
        600
      ],
      "webhookId": "211a9ca3-9768-486e-aad6-fbb52f6d3b2b",
      "parameters": {
        "text": "=\nA new complaint has been received from {{ $json[\"userName\"] || \"a customer\" }}:\n\n\"{{ $json[\"complaintText\"] }}\"\n\nPlease investigate and resolve this\n",
        "options": {},
        "subject": "New Customer Complaint Received",
        "toEmail": "={{ demo_to_email }}",
        "fromEmail": "={{ demo_from_email }}",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "9b4d7b7e-6a0d-4ba3-bd02-fa86422f7a56",
      "name": "Send to customer",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -640,
        600
      ],
      "webhookId": "1ef34921-41bc-4a94-ab3e-2553e5c1758c",
      "parameters": {
        "text": "=We Received Your Complaint\n\nThank you for reaching out to us. We have received your complaint:\n\n\"{{ $json[\"complaintText\"] }}\"\n\nOur team is currently reviewing it and will get back to you as soon as possible.\n\nWe apologize for any inconvenience caused.\n\nFrom , \nCustomer Support Team\n",
        "options": {},
        "subject": "Complaint Received",
        "toEmail": "={{ $json.from }}",
        "fromEmail": "={{ demo_from_email }}",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "9a536c97-b395-4466-8181-c1569e340a3c",
      "name": "rejection email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -100,
        380
      ],
      "webhookId": "ea634c6c-305a-499e-8773-d539e8489310",
      "parameters": {
        "text": "=Dear Candidate,\n\nThank you for applying. After review, we regret to inform you that you do not fit the requirements at this time.\n\nDetails: {{$json[\"aiResponse\"]}}\n\nBest regards,\nHR Team",
        "options": {},
        "subject": "Job Application Status: Not selected",
        "toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
        "fromEmail": "={{ demo_from_email }}",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "b782474f-4abe-43e5-8e8b-6f9a4c8bc223",
      "name": "to hr",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        120,
        180
      ],
      "webhookId": "1794df4d-7feb-47d6-a8a0-910197e6df62",
      "parameters": {
        "text": "=Hello HR Team,\n\nCandidate {{$json[\"candidate\"]}} has been accepted with a score of {{$json[\"score\"]}}.\n\nPlease proceed with the next steps.",
        "options": {},
        "subject": "=New Candidate Accepted:",
        "toEmail": "={{ demo_to_email }}",
        "fromEmail": "{{ demo_from_email }",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "150f211e-d5f5-4bd3-bc96-fcf662a00f2f",
      "name": "accepted confirm to candidate",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -100,
        180
      ],
      "webhookId": "bc4ad05b-966f-4bf2-bb80-23f996862711",
      "parameters": {
        "text": "=Dear Candidate,\n\nCongratulations! You have been accepted for the role.\n\nDetails: {{$json[\"aiResponse\"]}}\n\nBest regards,\nHR Team\n",
        "options": {},
        "subject": "Job Application Status: Accepted",
        "toEmail": "={{ $('Email Trigger (IMAP)').item.json.from }}",
        "fromEmail": "={{ demo_from_email }}",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "fd02b064-4431-486f-bea3-cb0fd161d7d5",
      "name": "bill send to team",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -960,
        540
      ],
      "webhookId": "91eaac98-671d-4e51-9a36-70a567908385",
      "parameters": {
        "text": "=\n\nA new billing email has been received.\n\nFrom: {{$json[\"from\"]}}\nSubject: {{$json[\"subject\"]}}\n\nEmail content:\n{{$json[\"body\"]}}\n\n",
        "options": {},
        "subject": "NEW BILL",
        "toEmail": "={{ demo_to_email }}",
        "fromEmail": "{{ demo_from_email }",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "88d4ca68-2a8f-4fac-a327-5d34d4cffaf7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1760,
        724
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 620,
        "content": "EMAIL CLASSIFIER USING SWITCH"
      },
      "typeVersion": 1
    },
    {
      "id": "cf112be5-e068-4186-b087-8b8c5f684022",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        1360
      ],
      "parameters": {
        "width": 600,
        "height": 200,
        "content": "USE FOR AI AGENT WHEN SWITCH FAILS"
      },
      "typeVersion": 1
    },
    {
      "id": "51599770-8db8-48d9-aea1-a8866118277b",
      "name": "TO SALES TEAM",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -500,
        1140
      ],
      "webhookId": "d0fbd1fe-eafc-4915-a9d0-699a5676f218",
      "parameters": {
        "text": "= Sales Team\n\nFrom: {{$json[\"from\"]}}\nSubject: {{$json[\"subject\"]}}\n\nEmail content:\n{{$json[\"body\"]}}\n\n",
        "options": {},
        "subject": "sales",
        "toEmail": "={{ demo_to_email }}",
        "fromEmail": "={{ demo_from_email }}",
        "emailFormat": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "eb7bf4f3-b4c1-4a00-99ce-4da22a607f28",
      "name": "CLEAN AI AGENT OUTPUT",
      "type": "n8n-nodes-base.code",
      "position": [
        -420,
        1520
      ],
      "parameters": {
        "jsCode": "const knownCategories = [\n  \"hr\",\n  \"billing\",\n  \"complaint\",\n  \"feedback\",\n  \"inquiry\",\n  \"sales\",\n  \"client\"\n];\n\nconst response = $json[\"category\"] || $json[\"output\"] || $json[\"text\"] || \"\";  // adapt this based on how your LLM responds\n\nconst normalized = response.trim().toLowerCase();\n\nif (knownCategories.includes(normalized)) {\n  return [{ json: { category: normalized } }];\n} else {\n  return [{ json: { category: \"unknown\" } }];\n}\n\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "7686a043-a6a1-4766-b44c-68cd17dd19e4",
      "name": "RAG INQURY REPLY",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        300,
        980
      ],
      "parameters": {
        "text": "=You are a helpful assistant replying to a customer inquiry via email.\n\nUse the following information retrieved from our documents to generate a clear, professional response.\n\nContext:\n{{ $json[\"vectors\"].map(v => v.metadata.text).join(\"\\n\\n\") || \"No context available.\" }}\n\nCustomer's Question:\n{{ $json[\"emailText\"] }}\n\nRespond with a structured and informative email. Summarize any important points about products, services, or team details. Keep the tone polite and helpful.\n\n",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "52d15753-d3bd-40bf-b003-17d55ddb5769",
      "name": "Sentiment Analysis of feedback",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -720,
        860
      ],
      "parameters": {
        "options": {
          "categories": "Positive, Neutral, Negative"
        },
        "inputText": "=\n {{ $json.textPlain }}"
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "a35ed1ad-bbce-4b6d-82e9-a745a54f90e8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -840,
        820
      ],
      "parameters": {
        "width": 500,
        "height": 200,
        "content": "check if feedback is postive or nrgative"
      },
      "typeVersion": 1
    },
    {
      "id": "fada6c17-587e-4b4c-8ff4-6df0e51f747c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1720,
        1960
      ],
      "parameters": {
        "width": 1500,
        "height": 460,
        "content": "details of business in pdf form to vector db"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "054ce674-7ec3-472c-aece-239291db890c": {
      "main": [
        [
          {
            "node": "29a32c21-8f26-4d64-9a43-875ddd566c72",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d69d1118-5fd7-4e7f-a2c2-8e66d8d40c19": {
      "main": [
        [
          {
            "node": "ecd67230-4807-48bf-acf7-70092f4476fd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ffbc75c1-b3ed-4fa6-8cd5-3bbed81c60d1": {
      "main": [
        [
          {
            "node": "1c00d468-87ec-433c-939e-48049c133130",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ecd67230-4807-48bf-acf7-70092f4476fd": {
      "main": [
        [
          {
            "node": "150f211e-d5f5-4bd3-bc96-fcf662a00f2f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "9a536c97-b395-4466-8181-c1569e340a3c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "29a32c21-8f26-4d64-9a43-875ddd566c72": {
      "main": [
        [
          {
            "node": "cbe51847-bddb-4169-a9b2-545005416936",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "fd02b064-4431-486f-bea3-cb0fd161d7d5",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "9b4d7b7e-6a0d-4ba3-bd02-fa86422f7a56",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "52d15753-d3bd-40bf-b003-17d55ddb5769",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "7686a043-a6a1-4766-b44c-68cd17dd19e4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "51599770-8db8-48d9-aea1-a8866118277b",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "2d3a2fa0-db9c-44e1-89da-0b7a98626bd8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d4b781d1-fe8b-414c-b374-c42d97549763": {
      "main": [
        [
          {
            "node": "0341b254-3ece-450b-aa3b-de531cbfb1f1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2d3a2fa0-db9c-44e1-89da-0b7a98626bd8": {
      "main": [
        [
          {
            "node": "eb7bf4f3-b4c1-4a00-99ce-4da22a607f28",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2b0efec2-3508-4a37-945c-2085439d05fd": {
      "ai_languageModel": [
        [
          {
            "node": "2d3a2fa0-db9c-44e1-89da-0b7a98626bd8",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "cbe51847-bddb-4169-a9b2-545005416936": {
      "main": [
        [
          {
            "node": "d69d1118-5fd7-4e7f-a2c2-8e66d8d40c19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "700feb4d-f5f7-4a64-80cc-e95db99716fc": {
      "ai_languageModel": [
        [
          {
            "node": "52d15753-d3bd-40bf-b003-17d55ddb5769",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "ff416773-6aa0-468a-895b-5970caaf371c": {
      "ai_languageModel": [
        [
          {
            "node": "7686a043-a6a1-4766-b44c-68cd17dd19e4",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "be7d4f6d-64a0-4be0-b70c-e60abfa610f7": {
      "ai_languageModel": [
        [
          {
            "node": "cbe51847-bddb-4169-a9b2-545005416936",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "7686a043-a6a1-4766-b44c-68cd17dd19e4": {
      "main": [
        [
          {
            "node": "42abb326-e9b3-41eb-9840-704b83d3821c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9b4d7b7e-6a0d-4ba3-bd02-fa86422f7a56": {
      "main": [
        [
          {
            "node": "7cc49a03-c131-4064-a603-1264b9602060",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "97811059-7058-4b93-b62b-d65ac30da74e": {
      "ai_embedding": [
        [
          {
            "node": "ff741958-dfd7-4c46-945d-10cfe521bd7d",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "0341b254-3ece-450b-aa3b-de531cbfb1f1": {
      "main": [
        [
          {
            "node": "ffbc75c1-b3ed-4fa6-8cd5-3bbed81c60d1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "404e80ef-fb17-4cbd-9198-23b951b36edf": {
      "ai_embedding": [
        [
          {
            "node": "1c00d468-87ec-433c-939e-48049c133130",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "761ca395-d8d9-4ad4-a8de-b741dc8ddef0": {
      "ai_document": [
        [
          {
            "node": "1c00d468-87ec-433c-939e-48049c133130",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "8befe960-178d-4983-b962-7487817baed4": {
      "main": [
        [
          {
            "node": "054ce674-7ec3-472c-aece-239291db890c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "eb7bf4f3-b4c1-4a00-99ce-4da22a607f28": {
      "main": [
        [
          {
            "node": "29a32c21-8f26-4d64-9a43-875ddd566c72",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ff741958-dfd7-4c46-945d-10cfe521bd7d": {
      "ai_tool": [
        [
          {
            "node": "7686a043-a6a1-4766-b44c-68cd17dd19e4",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "150f211e-d5f5-4bd3-bc96-fcf662a00f2f": {
      "main": [
        [
          {
            "node": "b782474f-4abe-43e5-8e8b-6f9a4c8bc223",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "52d15753-d3bd-40bf-b003-17d55ddb5769": {
      "main": [
        [
          {
            "node": "ce29423e-ea17-4cdd-81cc-16172776bdb9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "05cfdbad-4dc1-45de-8a25-22762dbf07b7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "05cfdbad-4dc1-45de-8a25-22762dbf07b7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "41b8a97b-7350-4b87-8586-8f558394df54": {
      "ai_textSplitter": [
        [
          {
            "node": "761ca395-d8d9-4ad4-a8de-b741dc8ddef0",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "8fd67212-0a9d-4783-acc1-93c7d86c820b": {
      "main": [
        [
          {
            "node": "d4b781d1-fe8b-414c-b374-c42d97549763",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Gestión de tickets, Resumen de IA

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos38
Categoría2
Tipos de nodos17
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34