{
  "name": "Automate product training & customer support via WhatsApp, GPT-4 & Google Sheets",
  "nodes": [
    {
      "id": "370611ee-2725-4ee4-a73a-68d4eaabfe3a",
      "name": "WhatsApp Business Cloud",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        1020,
        220
      ]
    },
    {
      "id": "30520fe8-a423-4942-85b2-9e8776b45939",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -20
      ],
      "parameters": {
        "width": 400,
        "height": 440,
        "content": "## 🟡 STEP 1 – Incoming WhatsApp Message\nListens for new WhatsApp messages.\nIf the message starts with train:, it triggers the product training flow.\nOtherwise, it goes to the customer support flow.\n**"
      }
    },
    {
      "id": "d3259e0e-5368-407d-8ac6-993784c939c9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        280
      ],
      "parameters": {
        "width": 1180,
        "height": 420,
        "content": "## 🔵 STEP 3 – Customer Support Flow\nTriggered when the message **does NOT start with `train:`**.\n\n1. **AI Analyzes the Message**  \n   Understands the customer's question or problem.\n\n2. **Fetch Produc"
      }
    },
    {
      "id": "455ce4ab-6d14-4d4e-8ff8-04612cf532b9",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        -400
      ],
      "parameters": {
        "width": 1180,
        "height": 660,
        "content": "## 🔴 STEP 2 – Product Data Training (Triggered by train:)\nTriggered when the message starts with `train:`.\n**OpenAI API keys** : [Here](https://platform.openai.com/api-keys)\n\n\n\n\n\n\n\n\n\n\n\n\n1. **Extract U"
      }
    },
    {
      "id": "15251a04-a139-4a71-9e96-d5ecd9c2e66c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        -20
      ],
      "parameters": {
        "width": 320,
        "height": 440,
        "content": "## 🟢 STEP 4 – Client Response\nFinal step of the flow.\n\n- Sends the AI-generated response back to the customer via WhatsApp.\n- Ensures the message is clear, helpful, and personalized."
      }
    },
    {
      "id": "f028f5a3-fed3-4f90-89cc-2af211da7362",
      "name": "Incoming Message Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -700,
        220
      ]
    },
    {
      "id": "54edaa0c-005e-4810-a2fa-76fbcc009b2b",
      "name": "Check If Training",
      "type": "n8n-nodes-base.switch",
      "position": [
        -520,
        220
      ]
    },
    {
      "id": "b4187b28-efd9-46cb-8d1c-23d89d3f6125",
      "name": "Extract URL from Text",
      "type": "n8n-nodes-base.code",
      "position": [
        -260,
        -320
      ]
    },
    {
      "id": "dbbcc8cf-2544-4de1-bcfd-6292d96a1017",
      "name": "Fetch HTML Page",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -100,
        -320
      ]
    },
    {
      "id": "91e711d0-26c0-41dd-a9c5-28100f0f44f6",
      "name": "Clean HTML Content",
      "type": "n8n-nodes-base.code",
      "position": [
        60,
        -320
      ]
    },
    {
      "id": "7e457450-42ef-417e-b5f9-3248c9c7c2ae",
      "name": "Save Raw Product Info",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        240,
        -320
      ]
    },
    {
      "id": "d3dfa439-4056-4ce9-b874-100500967de6",
      "name": "OpenAI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        320,
        -40
      ]
    },
    {
      "id": "10217317-f6dd-4890-b05d-197d3d2adb79",
      "name": "Short-Term Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        500,
        -40
      ]
    },
    {
      "id": "58ce0f46-fabc-4b6e-97d7-857dc6f1e568",
      "name": "Update Product Sheet",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        680,
        -40
      ]
    },
    {
      "id": "020714ae-5668-4fa5-8ba8-f1e476a8060e",
      "name": "AI Agent -  Customer Support Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        380,
        300
      ]
    },
    {
      "id": "53e49985-e1b9-48fd-9ea8-3352a63484e0",
      "name": "AI Agent - Enhance Product Details",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        420,
        -320
      ]
    },
    {
      "id": "194136b5-872a-492b-882b-d26a2890cbcf",
      "name": "OpenAI Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        220,
        560
      ]
    },
    {
      "id": "efc89a9b-3141-4735-adaf-7b9e2b6879ed",
      "name": "Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        400,
        560
      ]
    },
    {
      "id": "d1a21094-0237-4b17-818c-3af7760b405f",
      "name": "Read Product Sheet",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        560,
        560
      ]
    },
    {
      "id": "2c2dcf9b-5578-4bd4-85b6-27621927a0a0",
      "name": "Log Customer Issues",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        740,
        560
      ]
    }
  ],
  "connections": {
    "OpenAI Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Enhance Product Details",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent -  Customer Support Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch HTML Page": {
      "main": [
        [
          {
            "node": "Clean HTML Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Training": {
      "main": [
        [
          {
            "node": "Extract URL from Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent -  Customer Support Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Short-Term Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent - Enhance Product Details",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Clean HTML Content": {
      "main": [
        [
          {
            "node": "Save Raw Product Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Product Sheet": {
      "ai_tool": [
        [
          {
            "node": "AI Agent -  Customer Support Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent -  Customer Support Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Log Customer Issues": {
      "ai_tool": [
        [
          {
            "node": "AI Agent -  Customer Support Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Product Sheet": {
      "ai_tool": [
        [
          {
            "node": "AI Agent - Enhance Product Details",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Extract URL from Text": {
      "main": [
        [
          {
            "node": "Fetch HTML Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Raw Product Info": {
      "main": [
        [
          {
            "node": "AI Agent - Enhance Product Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Business Cloud": {
      "main": [
        []
      ]
    },
    "Incoming Message Trigger": {
      "main": [
        [
          {
            "node": "Check If Training",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent -  Customer Support Agent": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Enhance Product Details": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}