{
  "name": "UserProfiling",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "06617531-047b-4ea9-82eb-cf73474c4531",
      "name": "When clicking \u2018Execute workflow\u2019"
    },
    {
      "parameters": {
        "fileSelector": "E:/SalesBuddy/Linkedin_scraper/data/taufeeq",
        "options": {}
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        208,
        0
      ],
      "id": "1dcb9085-8b5b-411f-9aa4-1aa95890f9a0",
      "name": "Read/Write Files from Disk"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=You are an intelligent assistant.\n\nRead the following JSON object extracted from a LinkedIn company profile, and generate a very concise summary for company profiling.\n\nIt should only include:\n- company_name\n- industry\n- company_size\n- specialties (list of core focus areas)\n- key_markets (few major countries or regions where they operate)\n- linkedin_summary (one sentence summary of their typical activity or positioning)\n\nReturn the output in this JSON format only:\n{\n  \"company_name\": \"\",\n  \"industry\": \"\",\n  \"company_size\": \"\",\n  \"specialties\": [],\n  \"key_markets\": [],\n  \"linkedin_summary\": \"\"\n}\n\nHere\u2019s the data:\n{{ JSON.stringify($json) }}",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        672,
        0
      ],
      "id": "259ea986-47f0-4393-9ec1-01eb390d95bb",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        672,
        272
      ],
      "id": "88c2b15a-2ba1-4ac4-8d83-1b1f8edb2722",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "fromJson",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        448,
        0
      ],
      "id": "705505d2-a10d-484f-8d57-f118cbabd9a0",
      "name": "Extract from File"
    },
    {
      "parameters": {
        "operation": "insert",
        "collection": "leads",
        "fields": "=output, {{ $json.output }}",
        "options": {}
      },
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1.2,
      "position": [
        1072,
        0
      ],
      "id": "ac67660b-1815-424c-867b-a6f962420945",
      "name": "MongoDB",
      "credentials": {
        "mongoDb": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"company_name\": { \"type\": \"string\" },\n    \"industry\": { \"type\": \"string\" },\n    \"company_size\": { \"type\": \"string\" },\n    \"specialties\": {\n      \"type\": \"array\",\n      \"items\": { \"type\": \"string\" }\n    },\n    \"key_markets\": {\n      \"type\": \"array\",\n      \"items\": { \"type\": \"string\" }\n    },\n    \"linkedin_summary\": { \"type\": \"string\" },\n    \"website_link\": { \"type\": \"string\" }\n  },\n  \"required\": [\n    \"company_name\",\n    \"industry\",\n    \"company_size\",\n    \"specialties\",\n    \"key_markets\",\n    \"linkedin_summary\",\n    \"website_link\"\n  ]\n}",
        "autoFix": true
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        832,
        224
      ],
      "id": "5a31be9d-df21-4b77-81bf-aeb892c8dab6",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "modelName": "models/gemini-2.5-flash-lite-preview-06-17",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        912,
        448
      ],
      "id": "ebd43eb8-fbe4-42f6-9f28-d5f678a9a403",
      "name": "Google Gemini Chat Model1",
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Extract from File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract from File": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "MongoDB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d5eb19b3-676d-470f-be33-181ada4a4547",
  "id": "U9sCQhStsL5hU32Y",
  "tags": []
}