{
  "name": "Community insights using Qdrant, Python and Information Extractor",
  "nodes": [
    {
      "id": "5961a808-a873-497e-bc42-5b760ded1571",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        380,
        360
      ]
    },
    {
      "id": "7fa03eaa-7865-46ce-9f58-7e19fc0ec89b",
      "name": "Hacker News",
      "type": "n8n-nodes-base.hackerNews",
      "position": [
        1200,
        400
      ]
    },
    {
      "id": "82675738-9df7-47a3-8363-264bb09255f4",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1560,
        400
      ]
    },
    {
      "id": "6800be57-40da-4d80-ac35-304403423263",
      "name": "Get Comments",
      "type": "n8n-nodes-base.set",
      "position": [
        1380,
        400
      ]
    },
    {
      "id": "18e1b980-1d98-4a89-8cc6-f4793c004d9f",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1960,
        320
      ]
    },
    {
      "id": "c4ce1342-1460-4650-8338-055979339f46",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1960,
        480
      ]
    },
    {
      "id": "00301fd6-8766-40f7-99eb-7f8af9a51b29",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        2080,
        480
      ]
    },
    {
      "id": "c76d3aea-0906-4ed4-a828-47ad5775364c",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        2080,
        620
      ]
    },
    {
      "id": "50735ca9-90eb-408a-9bca-97eea1a310d1",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        620,
        360
      ]
    },
    {
      "id": "376a1a66-1d22-4969-af11-d1a9d474b67b",
      "name": "Clear Existing Comments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        860,
        360
      ]
    },
    {
      "id": "e8bcf7d8-aa25-499e-a64f-4d20caf1d6d4",
      "name": "Get Payload of Points",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1822,
        1100
      ]
    },
    {
      "id": "57cbc8e5-dd89-4c2a-9906-2bd0c2bbdede",
      "name": "Clusters To List",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1602,
        1100
      ]
    },
    {
      "id": "20b76291-f8fa-4aa7-8f1a-ff423ac3cb7f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2242,
        1320
      ]
    },
    {
      "id": "07fc19b3-33b4-42be-bda9-f1436d4e9e6f",
      "name": "Only Clusters With 3+ points",
      "type": "n8n-nodes-base.filter",
      "position": [
        1602,
        1260
      ]
    },
    {
      "id": "80583492-c454-4b9d-8df9-ded7d50930f2",
      "name": "Set Variables1",
      "type": "n8n-nodes-base.set",
      "position": [
        582,
        1200
      ]
    },
    {
      "id": "2cfb3a7a-01d2-4eee-b9f8-d19e81829882",
      "name": "Prep Output For Export",
      "type": "n8n-nodes-base.set",
      "position": [
        2842,
        1200
      ]
    },
    {
      "id": "ade302fd-93ad-4d96-9852-e4108ba435af",
      "name": "Export To Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3062,
        1200
      ]
    },
    {
      "id": "22d54081-7a52-40f2-837c-0c8df05e1fe4",
      "name": "Execute Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        382,
        1200
      ]
    },
    {
      "id": "b1e6eb2b-4627-4c69-a2ce-6bb8451d6359",
      "name": "Trigger Insights",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        2780,
        360
      ]
    },
    {
      "id": "f25e8b2a-5ce4-4e02-8e08-e3dd98072d0e",
      "name": "Prep Values For Trigger",
      "type": "n8n-nodes-base.set",
      "position": [
        2580,
        360
      ]
    },
    {
      "id": "d0270fa8-5ebc-4573-b070-05d19dd3302a",
      "name": "Find Comments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        982,
        1160
      ]
    },
    {
      "id": "ca3c040e-bfe1-4f4d-9c4e-154c2010f89b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2440,
        160
      ],
      "parameters": {
        "width": 595.5213902293318,
        "height": 429.11782776909047,
        "content": "## Step 4. Trigger Insights SubWorkflow\n[Learn more about Workflow Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow)\n\nA subworkflow is used to trigger the a"
      }
    },
    {
      "id": "cdf04343-abfa-4705-9828-e246c96ffa2a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1780,
        60
      ],
      "parameters": {
        "width": 638.5221986278162,
        "height": 741.0186923170972,
        "content": "## Step 3. Store Comments in Qdrant\n[Learn more about the Qdrant Vector Store](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant/)\n\nVector databas"
      }
    },
    {
      "id": "14f6872b-1c51-4359-a39f-cc6ba2ff29fb",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        200
      ],
      "parameters": {
        "width": 656.0317138444963,
        "height": 441.0753369736108,
        "content": "## Step 2. Using HN API to get Comments\n[Read more about HTTP Request Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.hackernews)\n\nWe'll scrape all the comments for the HN stor"
      }
    },
    {
      "id": "62935316-310a-4ce9-ac5f-8820666e2290",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        180
      ],
      "parameters": {
        "width": 787.3314861380661,
        "height": 465.52420584035275,
        "content": "## Step 1. Starting Fresh\nFor this demo, we'll clear any existing records in our Qdrant vector store for the selected HN story. We do this using the Qdrant's delete points API."
      }
    },
    {
      "id": "a5e93a02-555c-48a3-afae-344a4884908b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        269,
        1005
      ],
      "parameters": {
        "width": 551.2710561574413,
        "height": 407.9295477646979,
        "content": "## Step 5. The Insight Subworkflow\n[Learn more about Workflow Triggers](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflowtrigger)\n\nThis subworkflow takes the Story ID "
      }
    },
    {
      "id": "37217a2d-aca4-499b-9d6b-a1d4c6684194",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        920
      ],
      "parameters": {
        "width": 600.1809497875241,
        "height": 482.99934349707576,
        "content": "## Step 6. Apply Clustering Algorithm to Comments\n[Read more about using Python in n8n](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code)\n\nWe'll retrieve our vectors embeddings "
      }
    },
    {
      "id": "fcccc9a8-ee9f-41b7-b7d6-e8fbbe19dfa3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1466,
        880
      ],
      "parameters": {
        "width": 598.5585287222906,
        "height": 605.9905193915599,
        "content": "## Step 7. Fetch Comment Contents By Cluster\n[Learn more about using the Code Node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/)\n\nWith the Qdrant point IDs grouped and ret"
      }
    },
    {
      "id": "78e9cd03-dea4-4b11-947f-a00d7bb5f8cf",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2086,
        929
      ],
      "parameters": {
        "width": 587.6069484146701,
        "height": 583.305275883189,
        "content": "## Step 8. Getting Insights from Grouped Comments\n[Read more about using the Information Extractor Node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.informati"
      }
    },
    {
      "id": "d5427741-6015-4af5-8e45-f6fc6f5c4133",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2706,
        940
      ],
      "parameters": {
        "width": 572.5638733479158,
        "height": 464.4019616956416,
        "content": "## Step 9. Write To Insights Sheet\nFinally, our completed insights to appended to the Insights Sheet we created earlier in the workflow.\n\nYou can find a sample sheet here: https://docs.google.com/spre"
      }
    },
    {
      "id": "a66b7e6d-0602-4f6b-a9f6-76a63d590956",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        313.32160655630304
      ],
      "parameters": {
        "width": 226.36363118160727,
        "height": 296.5755172289686,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨 Set Story ID here!\nMust be a valid HN story ID"
      }
    },
    {
      "id": "42f93189-4bd8-4487-975a-f1c8f8365242",
      "name": "Apply K-means Clustering Algorithm",
      "type": "n8n-nodes-base.code",
      "position": [
        1202,
        1160
      ]
    },
    {
      "id": "4ddeab09-e401-41ad-861f-560b9e92bf89",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        40
      ],
      "parameters": {
        "width": 400.381109509268,
        "height": 612.855812336249,
        "content": "## Try It Out!\n\n### This workflow generates highly-detailed community insights from HN Story comments. Works best when dealing with a large number of comments.\n\n* Import HN Story comments and vectoris"
      }
    },
    {
      "id": "eea1b301-f030-48a9-bcfc-63fe3e1aac0d",
      "name": "Information Extractor",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        2260,
        1140
      ]
    },
    {
      "id": "bee4dd57-c907-418f-ad87-21c6ce4e6698",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        660
      ],
      "parameters": {
        "width": 323.2987132716669,
        "height": 80,
        "content": "### Run this once! \nIf for any reason you need to run more than once, be sure to clear the existing data first."
      }
    },
    {
      "id": "429e080d-5a94-442c-a2b0-6a12f03a8a98",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        1440
      ],
      "parameters": {
        "width": 323.2987132716669,
        "height": 110.05160146874424,
        "content": "### First Time Running?\nThere is a slight delay on first run because the code node has to download the required packages."
      }
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hacker News": {
      "main": [
        [
          {
            "node": "Get Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Comments": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Comments": {
      "main": [
        [
          {
            "node": "Apply K-means Clustering Algorithm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Clear Existing Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables1": {
      "main": [
        [
          {
            "node": "Find Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clusters To List": {
      "main": [
        [
          {
            "node": "Only Clusters With 3+ points",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "main": [
        [
          {
            "node": "Prep Values For Trigger",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Payload of Points": {
      "main": [
        [
          {
            "node": "Information Extractor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Information Extractor": {
      "main": [
        [
          {
            "node": "Prep Output For Export",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Output For Export": {
      "main": [
        [
          {
            "node": "Export To Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear Existing Comments": {
      "main": [
        [
          {
            "node": "Hacker News",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Values For Trigger": {
      "main": [
        [
          {
            "node": "Trigger Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Set Variables1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Only Clusters With 3+ points": {
      "main": [
        [
          {
            "node": "Get Payload of Points",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apply K-means Clustering Algorithm": {
      "main": [
        [
          {
            "node": "Clusters To List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}