{
  "name": "Automate LinkedIn profile research & email outreach with Apify, Gemini & Sheets",
  "nodes": [
    {
      "id": "ecbfc577-7f4d-448c-8c70-4c6a80ba7629",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1792,
        336
      ]
    },
    {
      "id": "efe97c07-f2d4-4f90-9f21-a503ebbd4103",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        -1360,
        320
      ]
    },
    {
      "id": "4f2e62e8-7e5e-434b-80f7-c2197ad1950c",
      "name": "Get dataset items",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -944,
        320
      ]
    },
    {
      "id": "b8bdd09a-1e75-4a13-9fee-75ffc305fa67",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -672,
        320
      ]
    },
    {
      "id": "0d58b6ca-bd4d-442b-958a-6e54c8fcb9b0",
      "name": "Get row(s) in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -400,
        320
      ]
    },
    {
      "id": "0ca835dc-bc3f-49bf-85d8-08a8d41d3502",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        240,
        512
      ]
    },
    {
      "id": "d1412a37-4f94-4efa-aac8-ba7f129b2bb7",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        64,
        512
      ]
    },
    {
      "id": "6e9c4aac-17fc-4b21-a832-038b6571a52e",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2000,
        336
      ]
    },
    {
      "id": "27f7cb9e-f89a-4496-b2ff-0cd8fb0cf6af",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2048,
        80
      ],
      "parameters": {
        "width": 384,
        "height": 416,
        "content": "## ⏰ Schedule Trigger & 📄 Google Sheets (Input)\nThis part of the workflow runs every 2 minutes.  \nIt fetches new rows (LinkedIn URLs and lead data) from the CRM sheet.  \nOnly leads without Profile Dat"
      }
    },
    {
      "id": "20b443fd-25df-4397-b167-cfa1ae1616fc",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1616,
        80
      ],
      "parameters": {
        "width": 384,
        "height": 416,
        "content": "## 🔍 If Check & ⚖️ Limit\n1. The **If node** ensures only leads missing Profile Data and Subject are processed.  \n\n2. The **Limit node** controls batch size to prevent Apify overload or LinkedIn blocks"
      }
    },
    {
      "id": "fd519317-971a-4cbf-a891-dcb61965c30f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        80
      ],
      "parameters": {
        "width": 384,
        "height": 416,
        "content": "## 🤖 Apify Actor & 📂 Dataset\n1. Runs the **LinkedIn Profile Scraper** actor on Apify for each LinkedIn URL.  \n\n2. The Dataset node fetches structured results (About, Experience, Roles, Companies).  \n\n"
      }
    },
    {
      "id": "5b2af68b-9acb-4021-9211-ea9f947cffbf",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        64
      ],
      "parameters": {
        "width": 288,
        "height": 432,
        "content": "## 💾 Google Sheets (Profile Data)\nAppends enriched profile details into the \"Profile Data\" column in Google Sheets.  \nNow each lead row includes About + Experience insights, ready for email personalis"
      }
    },
    {
      "id": "5fbf3fc9-7a32-46b3-92a1-95758b9a1337",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        80
      ],
      "parameters": {
        "width": 368,
        "height": 384,
        "content": "## 📄 Get Rows Again & 🔍 If Check (Email)\n1. Pulls updated rows after scraping.  \n\n2. Checks if Profile Data exists but \nSubject + Email Body are still empty.  \n\nEnsures only complete profiles go into "
      }
    },
    {
      "id": "6b63c91d-a436-4c1d-8d1c-3e5b3f84194e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 368,
        "height": 464,
        "content": "## 🧠 LLM Chain (Gemini via LangChain)\n1. Gemini is instructed to act as an expert B2B cold email copywriter.  \n\n2. It generates personalised subject lines & email bodies using career insights, achieve"
      }
    },
    {
      "id": "36ffcba7-23b8-45fc-b7dd-612f8537c293",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        80
      ],
      "parameters": {
        "width": 320,
        "height": 384,
        "content": "## 💾 Google Sheets (Final Email)\nFinal email drafts are stored in Google Sheets alongside LinkedIn URL & Profile Data.  \nEach lead row is now fully ready for outreach 🚀.\n"
      }
    },
    {
      "id": "6bcd2902-cf7c-4235-ad92-d8ea28392af4",
      "name": "Check Profiles with no Data",
      "type": "n8n-nodes-base.if",
      "position": [
        -1568,
        336
      ]
    },
    {
      "id": "77f3dbf8-9218-44cf-a03f-feacfa4a1906",
      "name": "Runs Profile Extraction Actor",
      "type": "@apify/n8n-nodes-apify.apify",
      "position": [
        -1152,
        320
      ]
    },
    {
      "id": "02725c27-8264-4b8d-a725-18947a0c8b6b",
      "name": "Check Profiles with No Email Drafts",
      "type": "n8n-nodes-base.if",
      "position": [
        -208,
        320
      ]
    },
    {
      "id": "f81e7880-4ae7-4f32-864a-05bb176a9e58",
      "name": "Hyper Personalised Email Generator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        80,
        304
      ]
    },
    {
      "id": "556499f4-f086-45bf-aad7-90e78c4dfc5b",
      "name": "Final Output",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        512,
        304
      ]
    }
  ],
  "connections": {
    "Limit": {
      "main": [
        [
          {
            "node": "Runs Profile Extraction Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get dataset items": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Check Profiles with no Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet1": {
      "main": [
        [
          {
            "node": "Check Profiles with No Email Drafts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Hyper Personalised Email Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Hyper Personalised Email Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check Profiles with no Data": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Runs Profile Extraction Actor": {
      "main": [
        [
          {
            "node": "Get dataset items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hyper Personalised Email Generator": {
      "main": [
        [
          {
            "node": "Final Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Profiles with No Email Drafts": {
      "main": [
        [
          {
            "node": "Hyper Personalised Email Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}