{
  "name": "Automate customer support with Gmail, Google Sheets, ERP data & GPT-4o AI",
  "nodes": [
    {
      "id": "b617607e-61ae-4107-a72e-2a23b5a57c75",
      "name": "📋 Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 450,
        "height": 760,
        "content": "# 🌐 AI Customer Support Assistant - Cloud Version\n\n## What this workflow does:\nThis AI-powered customer support automation processes incoming support requests via email or chat, analyzes them using AI"
      }
    },
    {
      "id": "918dd7a6-1c69-43ed-872d-052ebf20a396",
      "name": "📧 Email Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        300
      ],
      "parameters": {
        "width": 280,
        "height": 320,
        "content": "## 📧 Email Trigger\n\n**Purpose**: Monitors Gmail for incoming customer support requests\n\n**How it works**:\n• Polls Gmail every minute for new emails\n• Filters can be configured for specific labels/crit"
      }
    },
    {
      "id": "cd753c63-7f5f-4e44-901a-d23eca0cb8e9",
      "name": "📧 Support Email Received",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        620,
        660
      ]
    },
    {
      "id": "175a7569-f8d5-49b6-95ca-a83026b2aea4",
      "name": "💬 Chat Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        1160
      ],
      "parameters": {
        "width": 280,
        "height": 320,
        "content": "## 💬 Chat Trigger\n\n**Purpose**: Provides a real-time chat interface for testing\n\n**How it works**:\n• Creates a webhook URL for chat interactions\n• Ideal for demos and testing scenarios\n• Processes mes"
      }
    },
    {
      "id": "f9f43182-9113-4ba0-b2a9-b82f3f9b5d46",
      "name": "🧠 AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        300
      ],
      "parameters": {
        "width": 300,
        "height": 380,
        "content": "## 🧠 AI Information Extractor\n\n**Purpose**: Analyzes customer messages with AI to extract structured data\n\n**Extracts**:\n• Category (technical, billing, sales, etc.)\n• Urgency level (low, medium, high"
      }
    },
    {
      "id": "99ce470b-9c71-4303-a515-d197bfbf2d78",
      "name": "🤖 OpenAI Model (Extractor)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        980
      ]
    },
    {
      "id": "e55da351-bb97-49a8-bbe7-f9f5814f7874",
      "name": "📊 Context Data",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1540,
        300
      ],
      "parameters": {
        "width": 300,
        "height": 380,
        "content": "## 📊 Historical Support Data\n\n**Purpose**: Retrieves previous support cases for context\n\n**Data Source**: Google Sheets with historical customer interactions\n\n**Contains**:\n• Previous questions & answ"
      }
    },
    {
      "id": "aaf740e0-d78b-41d3-ba92-811c32b06f76",
      "name": "📊 Historical Support Cases",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1540,
        780
      ]
    },
    {
      "id": "16e63750-b911-458d-b18d-7ced534dbc44",
      "name": "📋 Aggregate Support Data",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1740,
        780
      ]
    },
    {
      "id": "00c1c023-982b-49f7-a422-f02a3aa1c2a7",
      "name": "📚 Knowledge Base",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        980
      ],
      "parameters": {
        "width": 300,
        "height": 440,
        "content": "## 📚 Product Knowledge Base\n\n**Purpose**: Accesses comprehensive product documentation\n\n**Data Source**: Google Drive (Primotech Manual PDF)\n\n**Contains**:\n• Technical specifications\n• Operating instr"
      }
    },
    {
      "id": "d4689f32-4c6c-4fab-94ef-4631b7b07632",
      "name": "📚 Download Product Manual",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1540,
        1140
      ]
    },
    {
      "id": "c291af40-8db0-4050-ad29-17774465cdb0",
      "name": "📄 Extract PDF Content",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        1740,
        1140
      ]
    },
    {
      "id": "e9a2cbd2-07eb-41a3-9333-2a3d4b936fe2",
      "name": "🏢 ERP Integration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1500,
        1700
      ],
      "parameters": {
        "width": 440,
        "height": 360,
        "content": "## 🏢 ERP System Integration\n\n**Purpose**: Retrieves customer & inventory data\n\n**Data Source**: Mock ERP API (demo purposes)\n\n**Provides**:\n• Customer account information\n• Order history\n• Product ava"
      }
    },
    {
      "id": "861dd2a5-b3ad-463c-aa19-f79c7b51c424",
      "name": "🏢 Check ERP System",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1560,
        1500
      ]
    },
    {
      "id": "578d7499-4c72-4181-b1c8-89b05d3bdae0",
      "name": "🤖 AI Response Generation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        1020
      ],
      "parameters": {
        "width": 320,
        "height": 400,
        "content": "## 🤖 Response Generation\n\n**Purpose**: Creates professional customer responses using AI\n\n**AI Model**: OpenAI GPT-4o-mini\n\n**Input Context**:\n• Customer's original message\n• Extracted information (sen"
      }
    },
    {
      "id": "9858ac0e-2f3a-4476-a892-25c51b6dd654",
      "name": "🤖 Generate Customer Response",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1960,
        1500
      ]
    },
    {
      "id": "263a08b7-c29a-4556-af0d-2a42c7981f0f",
      "name": "🤖 OpenAI Model (Generator)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1980,
        1680
      ]
    },
    {
      "id": "769b302a-63b2-4801-9b0c-bb25d1f3e432",
      "name": "👥 Quality Control",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2420,
        900
      ],
      "parameters": {
        "width": 320,
        "height": 460,
        "content": "## 👥 Human-in-the-Loop Approval\n\n**Purpose**: Ensures quality control before sending responses\n\n**Process**:\n1. AI-generated response is sent to support agent\n2. Agent reviews and can approve/reject/m"
      }
    },
    {
      "id": "33aa86d8-f613-4d9b-921c-781c796b23d1",
      "name": "📧 Email or Chat?",
      "type": "n8n-nodes-base.if",
      "position": [
        2280,
        1500
      ]
    },
    {
      "id": "8eee920b-1a44-4a8a-8db9-6ca32d9d0083",
      "name": "📧 Request Approval (Email)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2460,
        1400
      ]
    },
    {
      "id": "eee108b0-2d0d-4140-b298-ac0a6bb4422e",
      "name": "📤 Send Response to Customer",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2680,
        1400
      ]
    },
    {
      "id": "b6bb5258-6b1b-48b1-994b-9dbed3062559",
      "name": "📝 Format Chat Response",
      "type": "n8n-nodes-base.set",
      "position": [
        2460,
        1600
      ]
    },
    {
      "id": "3815458b-3b11-472f-9718-f9fd523b3325",
      "name": "Chat Message Received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        620,
        1020
      ]
    },
    {
      "id": "9f6013c5-f25f-4134-b9b3-9eed10e10db8",
      "name": "AI Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        940,
        780
      ]
    },
    {
      "id": "7fc3e443-9653-4706-a612-413fb6df1e23",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        800
      ],
      "parameters": {
        "width": 440,
        "height": 200,
        "content": "## How to run a demo\n- add google / openai credentials\n- change email of approver to something you can access"
      }
    }
  ],
  "connections": {
    "📧 Email or Chat?": {
      "main": [
        [
          {
            "node": "📧 Request Approval (Email)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "📝 Format Chat Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Message Received": {
      "main": [
        [
          {
            "node": "AI Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🏢 Check ERP System": {
      "main": [
        [
          {
            "node": "🤖 Generate Customer Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Information Extractor": {
      "main": [
        [
          {
            "node": "📊 Historical Support Cases",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📄 Extract PDF Content": {
      "main": [
        [
          {
            "node": "🏢 Check ERP System",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📋 Aggregate Support Data": {
      "main": [
        [
          {
            "node": "📚 Download Product Manual",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📧 Support Email Received": {
      "main": [
        [
          {
            "node": "AI Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📚 Download Product Manual": {
      "main": [
        [
          {
            "node": "📄 Extract PDF Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📊 Historical Support Cases": {
      "main": [
        [
          {
            "node": "📋 Aggregate Support Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📧 Request Approval (Email)": {
      "main": [
        [
          {
            "node": "📤 Send Response to Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🤖 OpenAI Model (Extractor)": {
      "ai_languageModel": [
        [
          {
            "node": "AI Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "🤖 OpenAI Model (Generator)": {
      "ai_languageModel": [
        [
          {
            "node": "🤖 Generate Customer Response",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "🤖 Generate Customer Response": {
      "main": [
        [
          {
            "node": "📧 Email or Chat?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}