{
  "name": "Automated lead research – from LinkedIn to ready-to-send report",
  "nodes": [
    {
      "id": "26294706-c6b1-452e-a1dc-efa450182cdd",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1940,
        380
      ]
    },
    {
      "id": "a4344c8c-b907-454f-981e-0c00c3ba4c40",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -1040,
        380
      ]
    },
    {
      "id": "6f4dbb06-71b7-4f25-8fb4-d06b4aae4766",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -400,
        60
      ]
    },
    {
      "id": "99087d5c-37fb-420a-85a7-160e2d43b837",
      "name": "check  perplexity research",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -420,
        -100
      ]
    },
    {
      "id": "4f872b82-e780-4890-8a7d-41d8d6c64234",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -380,
        740
      ]
    },
    {
      "id": "64c8e84f-1f53-471f-9641-e377d48c0f53",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        -380,
        1020
      ]
    },
    {
      "id": "b6474b3e-903d-458e-af9a-443334883649",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        640,
        360
      ]
    },
    {
      "id": "77165ac5-db51-4521-9b30-5db198dcbbf4",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -40,
        -100
      ]
    },
    {
      "id": "fb0dfafb-814b-458a-ac4c-610f3e65e36f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        880,
        600
      ]
    },
    {
      "id": "749c577a-7f0b-4fe6-ac66-1c6ff0c5fd55",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1140,
        580
      ]
    },
    {
      "id": "f2ecbb9b-2225-4759-92cc-8ed76c843aed",
      "name": "Analyst of prospect",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        940,
        360
      ]
    },
    {
      "id": "5cf46861-5b6a-4be9-92e7-66cab0b18bf7",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2020,
        620
      ]
    },
    {
      "id": "6b734dbe-c2b9-4881-a8b3-73e4e9ff5b9a",
      "name": "Generate Report",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2040,
        360
      ]
    },
    {
      "id": "700ec879-2401-4b25-8085-df0d7a677520",
      "name": "Get All Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1620,
        380
      ]
    },
    {
      "id": "e8e4e7df-b4bb-4ea1-b683-b6ccdcb62358",
      "name": "Set Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -1380,
        380
      ]
    },
    {
      "id": "c6597dd3-77f2-415f-a775-ca100dc1795d",
      "name": "Personal LinkedIn Account POST",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -640,
        740
      ]
    },
    {
      "id": "e9fab932-c8c8-4eaf-95ca-4a963ec76278",
      "name": "Personal LinkedIn Account GET",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -120,
        740
      ]
    },
    {
      "id": "b7ad91d7-e8da-4706-9409-aed151fd9c68",
      "name": "Company LinkedIn Account POST",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -640,
        1020
      ]
    },
    {
      "id": "07555619-0608-49bf-b0ba-ffdeed961053",
      "name": "Company LinkedIn Account GET",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -120,
        1020
      ]
    },
    {
      "id": "ba71884b-5072-4d5d-bc3a-0b249869c372",
      "name": "Set Results Personal",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        740
      ]
    },
    {
      "id": "e9624562-4b93-4f7d-b5a6-dba93bce4287",
      "name": "Set Results Company",
      "type": "n8n-nodes-base.set",
      "position": [
        180,
        1020
      ]
    },
    {
      "id": "08b6bbd8-9788-4f24-ae7e-0258bf1f677c",
      "name": "Perplexity Search",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -660,
        -100
      ]
    },
    {
      "id": "edea210f-2bff-4323-b6ea-09e5d53a1603",
      "name": "Set if TRUE",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        -120
      ]
    },
    {
      "id": "2be693ef-108d-470c-b40d-ab76c52acb5d",
      "name": "Set if WRONG",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        40
      ]
    },
    {
      "id": "13f1a968-a0ab-4e88-9811-a670da2bda0b",
      "name": "Perplexity Competitor Research",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1580,
        360
      ]
    },
    {
      "id": "94f44462-5e19-4406-95fd-8d9712989441",
      "name": "Add report to doc",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        2820,
        360
      ]
    },
    {
      "id": "9a1cf89f-f974-407f-a127-067567e9387b",
      "name": "Create doc",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        2640,
        360
      ]
    },
    {
      "id": "4f520fc2-3ac5-43ad-affd-326b7992ed27",
      "name": "Add to sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3100,
        360
      ]
    },
    {
      "id": "7fe8d6c7-44ee-402e-a26e-0bb02c227e25",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2020,
        60
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "a5ae4a02-015e-4bb7-9c02-c8d8a7c49938",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        320
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "df56ac90-1e59-4193-aa90-3f9173e38d48",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -460
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "38612702-b7bd-4a6a-9a9c-265fa8ba5a97",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "8795bb9e-3df3-4763-ba78-f900f65cd2a3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "77112353-600a-4c80-a7f4-c17261d87e41",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1380,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "55d86410-dbf3-4fe5-8452-3d2adbb21ff0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2540,
        -100
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "7094b36e-3e59-4389-a1be-e0d8cad5e77f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3520,
        -160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Set if TRUE",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set if WRONG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Personal LinkedIn Account GET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Analyst of prospect",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "Company LinkedIn Account GET",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Data": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create doc": {
      "main": [
        [
          {
            "node": "Add report to doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set if TRUE": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Data": {
      "main": [
        [
          {
            "node": "Set Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set if WRONG": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Report": {
      "main": [
        [
          {
            "node": "Create doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Company LinkedIn Account POST",
            "type": "main",
            "index": 0
          },
          {
            "node": "Perplexity Search",
            "type": "main",
            "index": 0
          },
          {
            "node": "Personal LinkedIn Account POST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add report to doc": {
      "main": [
        [
          {
            "node": "Add to sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyst of prospect",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Perplexity Search": {
      "main": [
        [
          {
            "node": "check  perplexity research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "check  perplexity research",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Analyst of prospect": {
      "main": [
        [
          {
            "node": "Perplexity Competitor Research",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Results Company": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Set Results Personal": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Analyst of prospect",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "check  perplexity research": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company LinkedIn Account GET": {
      "main": [
        [
          {
            "node": "Set Results Company",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Company LinkedIn Account POST": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personal LinkedIn Account GET": {
      "main": [
        [
          {
            "node": "Set Results Personal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Perplexity Competitor Research": {
      "main": [
        [
          {
            "node": "Generate Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personal LinkedIn Account POST": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get All Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}