{
  "id": "iYX4vUmfNoVCA86T",
  "meta": {
    "instanceId": "1037e065dca107c3c15857d49fe150792779e136a3c579aed02192a2b3d2a396",
    "templateCredsSetupCompleted": true
  },
  "name": "🤖 Smart Customer Support AI Agent",
  "tags": [],
  "nodes": [
    {
      "id": "696a1b2e-8f22-46ec-8fdd-3c7bb25f8429",
      "name": "📋 Workflow Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        660
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 1040,
        "content": "## 🤖 Smart Customer Support AI Agent\n\n**Who is this for?**\nSmall to medium businesses, e-commerce stores, SaaS companies, and service providers who want to automate their customer support while maintaining a personal touch.\n\n**What problem does this solve?**\n- Reduces response time to customer inquiries\n- Handles repetitive questions automatically\n- Provides 24/7 customer support coverage\n- Maintains consistent brand voice across channels\n- Escalates complex issues to human agents\n\n**What this workflow does:**\n1. Monitors Gmail and Telegram for customer messages\n2. Uses AI to understand customer intent and context\n3. Accesses your knowledge base (Google Sheets) for accurate responses\n4. Sends personalized, contextual replies\n5. Escalates complex issues to human agents\n6. Logs all interactions for analysis\n\n**FIXES APPLIED:**\n- Separated Gmail and Telegram processing paths\n- Individual AI agents for each channel\n- Proper conversation memory management\n- Channel-specific response handling\n\n**Setup Instructions:**\n1. Configure Gmail OAuth2 credentials\n2. Set up Telegram bot token\n3. Create your knowledge base in Google Sheets\n4. Add your OpenAI API key\n5. Customize the AI prompts for your business\n6. Test with sample customer inquiries\n\n**Customization Tips:**\n- Update the knowledge base with your FAQs\n- Modify AI prompts to match your brand voice\n- Add more communication channels as needed\n- Set up escalation rules for complex cases"
      },
      "typeVersion": 1
    },
    {
      "id": "47324b70-8be7-4e92-a739-2ff60f37d14a",
      "name": "💬 Telegram Customer Message Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        1500,
        1220
      ],
      "webhookId": "customer-support-telegram",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "credential-id",
          "name": "telegramApi Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "23ce0479-3ab0-4150-b893-3e08ed83fd73",
      "name": "📋 Process Telegram Message",
      "type": "n8n-nodes-base.set",
      "position": [
        1780,
        1240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "channel",
              "name": "channel",
              "type": "string",
              "value": "telegram"
            },
            {
              "id": "customer_name",
              "name": "customer_name",
              "type": "string",
              "value": "={{ $json.message.from.first_name }} {{ $json.message.from.last_name }}"
            },
            {
              "id": "customer_id",
              "name": "customer_id",
              "type": "string",
              "value": "={{ $json.message.from.id }}"
            },
            {
              "id": "chat_id",
              "name": "chat_id",
              "type": "string",
              "value": "={{ $json.message.chat.id }}"
            },
            {
              "id": "message_content",
              "name": "message_content",
              "type": "string",
              "value": "={{ $json.message.text }}"
            },
            {
              "id": "message_id",
              "name": "message_id",
              "type": "string",
              "value": "={{ $json.message.message_id }}"
            },
            {
              "id": "subject",
              "name": "subject",
              "type": "string",
              "value": "Customer Support Inquiry"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "686affeb-1afb-45cf-b9b0-f3ba6c6ffb94",
      "name": "🤖 Telegram AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2080,
        1180
      ],
      "parameters": {
        "text": "={{ $json.message_content}}",
        "options": {
          "systemMessage": "You are a helpful and professional customer support AI assistant for Telegram inquiries. Your role is to:\n\n1. Understand customer inquiries and provide accurate, helpful responses\n2. Use the knowledge base tool to find relevant information\n3. Maintain a friendly, professional tone that matches the company brand\n4. If you cannot fully resolve an issue, escalate it appropriately\n5. Always aim to provide value and resolve customer concerns\n\nImportant guidelines:\n- Be empathetic and understanding\n- Provide clear, actionable responses\n- Use the customer's name when possible\n- If information is not in the knowledge base, say so honestly\n- For complex technical issues, recommend escalation to human support\n\nCompany context: You represent a professional service business focused on customer satisfaction and quality support via Telegram."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "a5e67d73-73c2-4756-9c82-9c05c1dbc36a",
      "name": "🧠 OpenAI Chat Model - Telegram",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1900,
        1420
      ],
      "parameters": {
        "options": {
          "maxTokens": 100,
          "temperature": 0.3
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "bfa0f8a9-58cc-4c15-8d7e-d633c23e10a6",
      "name": "🧠 Telegram Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2080,
        1440
      ],
      "parameters": {
        "sessionKey": "telegram_{{ $json.customer_id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "64a05368-29f5-4333-b881-b0ba73e424cb",
      "name": "💬 Send Telegram Reply",
      "type": "n8n-nodes-base.telegram",
      "position": [
        2460,
        1120
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('📋 Process Telegram Message').item.json.chat_id }}",
        "additionalFields": {
          "parse_mode": "Markdown",
          "reply_to_message_id": "={{ $('📋 Process Telegram Message').item.json.message_id }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "credential-id",
          "name": "telegramApi Credential"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "64c36c02-b56d-45dd-b3bf-4f49b3e14b5c",
      "name": "📧 Gmail Customer Inquiry Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        1540,
        720
      ],
      "parameters": {
        "filters": {
          "labelIds": [
            "INBOX",
            "CATEGORY_PERSONAL"
          ],
          "readStatus": "unread"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "baf01d18-d626-4b5c-bbc9-ac45c83b8e0b",
      "name": "📋 Process Gmail Message",
      "type": "n8n-nodes-base.set",
      "position": [
        1740,
        720
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "channel",
              "name": "channel",
              "type": "string",
              "value": "gmail"
            },
            {
              "id": "customer_email",
              "name": "customer_email",
              "type": "string",
              "value": "={{ $json[\"From\"].match(/<(.*?)>/)?.[1] || $json[\"From\"] }}"
            },
            {
              "id": "customer_name",
              "name": "customer_name",
              "type": "string",
              "value": "={{ $json[\"From\"].split(\" <\")[0] }}"
            },
            {
              "id": "subject",
              "name": "subject",
              "type": "string",
              "value": "={{ $json.Subject }}"
            },
            {
              "id": "message_content",
              "name": "message_content",
              "type": "string",
              "value": "={{ $json.text || $json.snippet }}"
            },
            {
              "id": "message_id",
              "name": "message_id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "thread_id",
              "name": "thread_id",
              "type": "string",
              "value": "={{ $json.threadId }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4d1c0b8a-9fed-4977-8ec4-91cb4460c2b6",
      "name": "🤖 Gmail AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1940,
        720
      ],
      "parameters": {
        "text": "={{ $json.message_content}}",
        "options": {
          "systemMessage": "You are a helpful and professional customer support AI assistant for Email inquiries. Your role is to:\n\n1. Understand customer inquiries and provide accurate, helpful responses\n2. Use the knowledge base tool to find relevant information\n3. Maintain a friendly, professional tone that matches the company brand\n4. If you cannot fully resolve an issue, escalate it appropriately\n5. Always aim to provide value and resolve customer concerns\n\nImportant guidelines:\n- Be empathetic and understanding\n- Provide clear, actionable responses\n- Use the customer's name when possible\n- If information is not in the knowledge base, say so honestly\n- For complex technical issues, recommend escalation to human support\n- Format responses appropriately for email\n\nCompany context: You represent a professional service business focused on customer satisfaction and quality support via Email."
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "8da4c0b1-86b7-436b-8d73-e96d3777be29",
      "name": "🧠 OpenAI Chat Model - Gmail",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1900,
        900
      ],
      "parameters": {
        "options": {
          "maxTokens": 1000,
          "temperature": 0.3
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "credential-id",
          "name": "openAiApi Credential"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "b4cb3e8b-3d5c-49fb-9cc2-f46ffe4cd683",
      "name": "🧠 Gmail Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        2040,
        980
      ],
      "parameters": {
        "sessionKey": "gmail_{{ $json.customer_email }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "442e8879-e6c3-4cd6-8f3b-3f64879047c1",
      "name": "📧 Send Gmail Reply",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2240,
        720
      ],
      "webhookId": "c09e3c26-5430-4b47-864d-2344b636fa4e",
      "parameters": {
        "message": "={{ $json.output }}",
        "options": {
          "ccList": "",
          "bccList": "",
          "replyToSenderOnly": true
        },
        "messageId": "={{ $('📋 Process Gmail Message').item.json.message_id }}",
        "operation": "reply"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "668afdd0-f68b-45cb-afde-93ebaf7627d3",
      "name": "✅ Mark Gmail as Read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2480,
        620
      ],
      "webhookId": "3bae576f-ba6e-4ee2-a389-82171a9101d8",
      "parameters": {
        "messageId": "={{ $('📋 Process Gmail Message').item.json.message_id }}",
        "operation": "markAsRead"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "credential-id",
          "name": "gmailOAuth2 Credential"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2233ac1c-b704-4485-a4dd-3d873fb04538",
      "name": "📊 Log Gmail Interaction",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2540,
        820
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Completed",
            "Channel": "Email",
            "Timestamp": "={{ new Date().toISOString() }}",
            "AI_Response": "={{ $('🤖 Gmail AI Agent').item.json.output }}",
            "Customer_Name": "={{ $('📋 Process Gmail Message').item.json.customer_name }}",
            "Response_Time": "={{ new Date().toISOString() }}",
            "Inquiry_Subject": "={{ $json.subject || 'General Inquiry' }}",
            "Customer_Contact": "={{ $('📋 Process Gmail Message').item.json.customer_email }}",
            "Customer_Message": "={{ $('📋 Process Gmail Message').item.json.message_content }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Channel",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Channel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Contact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Contact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Inquiry_Subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Inquiry_Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Message",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI_Response",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "AI_Response",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Response_Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Response_Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1087576053,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=1087576053",
          "cachedResultName": "AI_Responses"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6e641113-9da3-430c-873d-59fd0c2997fb",
      "name": "📊 Log Telegram Interaction",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2760,
        960
      ],
      "parameters": {
        "columns": {
          "value": {
            "Status": "Completed",
            "Channel": "={{ $('📋 Process Telegram Message').item.json.channel }}",
            "Timestamp": "={{ new Date().toISOString() }}",
            "AI_Response": "={{ $json.output }}",
            "Customer_Name": "={{ $('📋 Process Telegram Message').item.json.customer_name }}",
            "Response_Time": "={{ new Date().toISOString() }}",
            "Inquiry_Subject": "={{ $('📋 Process Telegram Message').item.json.subject }}",
            "Customer_Contact": "={{ $('📋 Process Telegram Message').item.json.customer_id }}",
            "Customer_Message": "={{ $('📋 Process Telegram Message').item.json.message_content }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Channel",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Channel",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Contact",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Contact",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Inquiry_Subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Inquiry_Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Customer_Message",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Customer_Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "AI_Response",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "AI_Response",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Response_Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Response_Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1087576053,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=1087576053",
          "cachedResultName": "AI_Responses"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "50ded0f7-2513-4515-8843-e24cb50c89ae",
      "name": "⚠️ Error Handling Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3100,
        980
      ],
      "parameters": {
        "width": 300,
        "height": 280,
        "content": "## 🚨 Error Handling\n\nThis section handles any errors that occur during the workflow execution and notifies the admin team.\n\n**Features:**\n- Captures all workflow errors\n- Sends notifications to admin\n- Logs errors for debugging\n- Provides fallback responses"
      },
      "typeVersion": 1
    },
    {
      "id": "8634105f-1844-4e58-97f3-07697d86ac48",
      "name": "🚨 Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        2760,
        1300
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "807781dc-c1ac-4bca-b298-420a3a3d5c2c",
      "name": "📢 Notify Admin of Error",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3020,
        1300
      ],
      "parameters": {
        "url": "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "🚨 Customer Support AI Error Alert\n\nWorkflow: Smart Customer Support AI\nError: {{ $json.error.message }}\nNode: {{ $json.error.node.name }}\nTime: {{ new Date().toISOString() }}\n\nPlease check the workflow execution for details."
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4581974a-7e7c-4b61-b5c7-a6023ef931d0",
      "name": "Gmail Escalation Logger",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2300,
        920
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1478316494,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=1478316494",
          "cachedResultName": "Customer_Inquiries"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "d9f13fc4-0a68-4bee-a36f-67e779bef7fe",
      "name": "knowledge base",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2180,
        1000
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=0",
          "cachedResultName": "Knowledge_Base"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "dfaba1db-fc45-4c09-b83d-2413086f52d8",
      "name": "knowledge base1",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2240,
        1440
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=0",
          "cachedResultName": "Knowledge_Base"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "a79e16e6-409a-47b1-a7f9-60de7aac1700",
      "name": "Telegram Escalation Logger",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        2420,
        1400
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1478316494,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit#gid=1478316494",
          "cachedResultName": "Customer_Inquiries"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rEZ1A0Gd5ejT_b2F5tcYy9Xk4i0JvTrjss_oolf6WD8/edit?usp=drivesdk",
          "cachedResultName": "customer_support_knowledge_base"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "credential-id",
          "name": "googleSheetsOAuth2Api Credential"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "791294ac-b7d5-45f8-951a-7146057b58f7",
  "connections": {
    "knowledge base": {
      "ai_tool": [
        [
          {
            "node": "🤖 Gmail AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "knowledge base1": {
      "ai_tool": [
        [
          {
            "node": "🤖 Telegram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "🧠 Gmail Memory": {
      "ai_memory": [
        [
          {
            "node": "🤖 Gmail AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "🚨 Error Trigger": {
      "main": [
        [
          {
            "node": "📢 Notify Admin of Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🤖 Gmail AI Agent": {
      "main": [
        [
          {
            "node": "📧 Send Gmail Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧠 Telegram Memory": {
      "ai_memory": [
        [
          {
            "node": "🤖 Telegram AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "📧 Send Gmail Reply": {
      "main": [
        [
          {
            "node": "✅ Mark Gmail as Read",
            "type": "main",
            "index": 0
          },
          {
            "node": "📊 Log Gmail Interaction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🤖 Telegram AI Agent": {
      "main": [
        [
          {
            "node": "💬 Send Telegram Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Escalation Logger": {
      "ai_tool": [
        [
          {
            "node": "🤖 Gmail AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "💬 Send Telegram Reply": {
      "main": [
        [
          {
            "node": "📊 Log Telegram Interaction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Escalation Logger": {
      "ai_tool": [
        [
          {
            "node": "🤖 Telegram AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "📋 Process Gmail Message": {
      "main": [
        [
          {
            "node": "🤖 Gmail AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📋 Process Telegram Message": {
      "main": [
        [
          {
            "node": "🤖 Telegram AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🧠 OpenAI Chat Model - Gmail": {
      "ai_languageModel": [
        [
          {
            "node": "🤖 Gmail AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "🧠 OpenAI Chat Model - Telegram": {
      "ai_languageModel": [
        [
          {
            "node": "🤖 Telegram AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "📧 Gmail Customer Inquiry Trigger": {
      "main": [
        [
          {
            "node": "📋 Process Gmail Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "💬 Telegram Customer Message Trigger": {
      "main": [
        [
          {
            "node": "📋 Process Telegram Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}