{
  "name": "Create an automated customer support assistant with GPT-4o and GoHighLevel SMS",
  "nodes": [
    {
      "id": "11fb91ab-7dc6-4cc9-ad1d-d6f10b8b94cc",
      "name": "HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        -2120,
        -40
      ]
    },
    {
      "id": "3f207160-f88c-499a-b7a6-2d46fca4ca08",
      "name": "Simple Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -640,
        -640
      ]
    },
    {
      "id": "1e9f2063-8d90-4550-854a-b4b44d030440",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -600,
        -420
      ]
    },
    {
      "id": "30f62b01-9ca9-4ba2-beb5-3475ddb7f728",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -480,
        -420
      ]
    },
    {
      "id": "fa91d999-2caf-47e5-8bb3-1d25ea7cabe5",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -440,
        -300
      ]
    },
    {
      "id": "392f3e86-e3df-418d-824d-d34e42194609",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2080,
        1200
      ]
    },
    {
      "id": "6bf869cc-f9b0-411a-abe9-f47798785128",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2140,
        1420
      ]
    },
    {
      "id": "cf57c3ed-735b-4406-9ea1-933e29ff1e76",
      "name": "Simple Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -1900,
        1420
      ]
    },
    {
      "id": "e66e902d-015e-4ac7-83c3-0440fd8c2976",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -1780,
        1580
      ]
    },
    {
      "id": "ba793e78-c740-43f9-8e12-089897f2b38e",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1580,
        500
      ]
    },
    {
      "id": "0446402d-cfd3-4e14-a40c-55432c39afdf",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1400,
        500
      ]
    },
    {
      "id": "6edec18d-b589-4394-93e5-48b42b90bb17",
      "name": "HTML1",
      "type": "n8n-nodes-base.html",
      "position": [
        360,
        560
      ]
    },
    {
      "id": "5f777051-9643-4656-9030-c78efcf2d07a",
      "name": "Redis Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "position": [
        -2020,
        1420
      ]
    },
    {
      "id": "ba32dc25-b25a-4694-9b38-85b2d51968cc",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -3200,
        -40
      ]
    },
    {
      "id": "e96c0daf-52c6-42f2-94b9-96794b0e29da",
      "name": "BrightData",
      "type": "n8n-nodes-brightdata.brightData",
      "position": [
        -2320,
        -40
      ]
    },
    {
      "id": "a0ae9df5-d272-4e63-a7ff-a829b3273672",
      "name": "Set Website URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -2760,
        -40
      ]
    },
    {
      "id": "702aa89b-97ba-48df-a1af-4e6757ac120a",
      "name": "BrightData1",
      "type": "n8n-nodes-brightdata.brightData",
      "position": [
        180,
        560
      ]
    },
    {
      "id": "20e30736-6407-4a80-a773-7a82ed85ccbe",
      "name": "Send SMS via GHL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1640,
        1200
      ]
    },
    {
      "id": "c45c8576-2ad5-494b-9f02-f8fcd70890b7",
      "name": "Webhook from GHL - SMS Reply Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2960,
        1220
      ]
    },
    {
      "id": "b635091f-ec49-43f0-9630-33dff88d5ecf",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        860,
        780
      ]
    },
    {
      "id": "c5038c4d-6527-48f3-bdf0-afc64affc7aa",
      "name": "Simple Vector Store2",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        540,
        560
      ]
    },
    {
      "id": "70926e4b-6f62-4f8f-9460-1a506270ce86",
      "name": "Set Website URL1",
      "type": "n8n-nodes-base.set",
      "position": [
        -2280,
        1200
      ]
    },
    {
      "id": "f3e71cf8-06ec-4ae9-8678-5c9d23d8e13d",
      "name": "Look Up GHL Contact by ID",
      "type": "n8n-nodes-base.highLevel",
      "position": [
        -2560,
        1200
      ]
    },
    {
      "id": "f8db6542-0032-45f1-8e86-981e95ab1c83",
      "name": "Direct API access via HTTP",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2320,
        160
      ]
    },
    {
      "id": "3fa901bf-f2cf-4b69-89c5-55715940f062",
      "name": "Direct API access via HTTP1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        180,
        760
      ]
    },
    {
      "id": "4af4ebd0-3d39-4e12-a063-2ce74731f769",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -2780,
        1220
      ]
    },
    {
      "id": "6ad6a06c-2512-40cc-9be6-00b5c873ac6a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3020,
        1040
      ],
      "parameters": {
        "width": 640,
        "height": 400,
        "content": "## Webhook from GoHighlevel \n\nSet the webhook events from your GoHighLevel Marketplace app, copy the webhook the node, then paste it in app's setting in the GHL app. To learn more about setting up GHL"
      }
    },
    {
      "id": "19685364-38c7-4a43-bdeb-4bf6283d4e42",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2420,
        -180
      ],
      "parameters": {
        "width": 500,
        "height": 540,
        "content": "## Scrape the home page\n\nIf you are using N8N cloud version, you may replace Bright Data node with the HTTP request node and rewire it."
      }
    },
    {
      "id": "10d3250e-39e4-4a48-a206-3473f23036f2",
      "name": "Get XML file",
      "type": "n8n-nodes-base.xml",
      "position": [
        -1420,
        80
      ]
    },
    {
      "id": "84246cd0-53e5-40aa-9b1d-98c35971258a",
      "name": "Split out links",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -1280,
        80
      ]
    },
    {
      "id": "818840f8-2c73-4fb4-86b3-3288c0b5cb70",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2880,
        -180
      ],
      "parameters": {
        "width": 380,
        "height": 540,
        "content": "## Set the website URL"
      }
    },
    {
      "id": "e0df1684-9775-4283-8736-0d6f7eac6c6f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -780
      ],
      "parameters": {
        "width": 600,
        "height": 660,
        "content": "## Store into a vector database\n\nWarning: This will only save into N8N's memory and it will not be a good in production use. Please consider moving the a dedicated vector database such as Pinecone, Su"
      }
    },
    {
      "id": "95354954-9d89-4ac9-8a4b-0c75c108e1ba",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1660,
        -40
      ],
      "parameters": {
        "width": 760,
        "height": 320,
        "content": "## Get the website's sitemap\n\nSitemap may not work on all of the website. The alternative is to scrape all the links in a website as shown below. If the sitemap is not working, it will go empty as an "
      }
    },
    {
      "id": "ded3c52e-a153-4746-b06c-941bdaee33d3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1660,
        340
      ],
      "parameters": {
        "width": 600,
        "height": 400,
        "content": "## Extract Links from the homepage\n\nIf the sitemap above is not working, please loop this step for the sub pages\n\n"
      }
    },
    {
      "id": "64c8af28-45c8-4143-9fe0-c5a8f4a6e41e",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -640,
        300
      ]
    },
    {
      "id": "1d2e604b-cfff-4773-a264-c68e1af058e6",
      "name": "Remove Duplicates1",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        -440,
        300
      ]
    },
    {
      "id": "ff96e735-6779-466c-9ba0-baa7e12ec16c",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -20,
        540
      ]
    },
    {
      "id": "dd90fd8d-b1e3-4659-950e-30d0f7be91e0",
      "name": "Edit Links",
      "type": "n8n-nodes-base.set",
      "position": [
        -1240,
        500
      ]
    },
    {
      "id": "90c8f4bb-a394-466e-97c6-8f7edec738c4",
      "name": "Edit Links1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1100,
        80
      ]
    },
    {
      "id": "d0c09704-e158-421e-a463-6e12160371b6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        160
      ],
      "parameters": {
        "width": 580,
        "height": 340,
        "content": "## Merge the links from the sitemap and the extracted links from the webpage\nIf the sitemap is not working, remove the merge node or set the node's input into 1.\n"
      }
    },
    {
      "id": "fd4a351a-6bfa-4a94-9d3f-7ef2a6cbc3f0",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        420
      ],
      "parameters": {
        "width": 1200,
        "height": 620,
        "content": "## Scrape each links by batch"
      }
    },
    {
      "id": "4c850725-4d09-4a21-bd45-777f4d091a3b",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2340,
        1040
      ],
      "parameters": {
        "width": 900,
        "height": 700,
        "content": "## AI Agent then send the output via SMS in GHL"
      }
    },
    {
      "id": "6a622f9d-e4cf-45af-b125-750fc74a6707",
      "name": "Get sitemap",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1600,
        140
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Look Up GHL Contact by ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML": {
      "main": [
        [
          {
            "node": "Simple Vector Store",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get sitemap",
            "type": "main",
            "index": 0
          },
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML1": {
      "main": [
        [
          {
            "node": "Simple Vector Store2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Remove Duplicates1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Edit Links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send SMS via GHL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BrightData": {
      "main": [
        [
          {
            "node": "HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Links": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "BrightData1": {
      "main": [
        [
          {
            "node": "HTML1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Links1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get sitemap": {
      "main": [
        [
          {
            "node": "Get XML file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get XML file": {
      "main": [
        [
          {
            "node": "Split out links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "BrightData1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Website URL": {
      "main": [
        [
          {
            "node": "BrightData",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split out links": {
      "main": [
        [
          {
            "node": "Edit Links1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Website URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Website URL1": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Simple Vector Store",
            "type": "ai_embedding",
            "index": 0
          },
          {
            "node": "Simple Vector Store2",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Simple Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Simple Vector Store",
            "type": "ai_document",
            "index": 0
          },
          {
            "node": "Simple Vector Store2",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store2": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Look Up GHL Contact by ID": {
      "main": [
        [
          {
            "node": "Set Website URL1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Webhook from GHL - SMS Reply Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}