{
  "name": "Generate personalized cold email icebreakers from LinkedIn or website data with GPT-4",
  "nodes": [
    {
      "id": "748963d2-6626-4ef7-b620-068dbca762d2",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        32,
        912
      ]
    },
    {
      "id": "77cf3150-4ea2-4103-b688-9b748e10cd8f",
      "name": "Fetch Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        256,
        912
      ]
    },
    {
      "id": "f6967a00-0be5-424b-a258-6ff273bb58b6",
      "name": "Loop Over Leads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        512,
        912
      ]
    },
    {
      "id": "067f5962-a56e-48a3-8226-794a2dcf81c8",
      "name": "Posts Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        1184,
        912
      ]
    },
    {
      "id": "615740e7-8d9b-47a6-bab7-a9690c266f54",
      "name": "Apify LinkedIn Scraper",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        960,
        912
      ]
    },
    {
      "id": "0eb67acc-77cd-469b-8792-a6c951eb3fc0",
      "name": "Aggregate Posts",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1472,
        1056
      ]
    },
    {
      "id": "35dc437d-07f2-471b-bb2a-a20271551475",
      "name": "Analyze LinkedIn Context",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1712,
        1056
      ]
    },
    {
      "id": "a3d999d6-5210-40db-9e79-0e0cf5a8b4da",
      "name": "Map Lead Data",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        912
      ]
    },
    {
      "id": "d841b947-b72d-43da-9884-db6bfebbafdc",
      "name": "Pass-through (Website)",
      "type": "n8n-nodes-base.set",
      "position": [
        2672,
        880
      ]
    },
    {
      "id": "ccce2cd3-2c25-4d7d-a76c-f1fa94f49ff0",
      "name": "Pass-through (LinkedIn)",
      "type": "n8n-nodes-base.set",
      "position": [
        2672,
        1056
      ]
    },
    {
      "id": "cdb9f77b-540a-4aaf-8e90-fe655ea595e7",
      "name": "Merge Loops",
      "type": "n8n-nodes-base.merge",
      "position": [
        2896,
        1040
      ]
    },
    {
      "id": "279e02ae-d53a-4df8-8225-4b1ee72b05cf",
      "name": "Scrape Company Website",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1424,
        880
      ]
    },
    {
      "id": "4aa07f39-e4ff-46e6-8246-963ef6f40342",
      "name": "Convert HTML to Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        1584,
        880
      ]
    },
    {
      "id": "573fbdb4-8a89-4159-b16e-e5877854ea22",
      "name": "Update Row (Website Data)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2464,
        880
      ]
    },
    {
      "id": "6758366e-31eb-483a-8cff-53a4aeb6d670",
      "name": "Analyze Website Context",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1712,
        880
      ]
    },
    {
      "id": "e49de41f-1746-48d6-a087-d421f2a87719",
      "name": "Write Email Copy (Website Context)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2080,
        880
      ]
    },
    {
      "id": "44336798-7e59-4a07-b670-21fca6e89458",
      "name": "Write Email Copy (LinkedIn Context)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2080,
        1056
      ]
    },
    {
      "id": "28bfb7e7-b32a-4ed3-9d0d-ea1f447121a7",
      "name": "Update Row (LinkedIn Data)",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2464,
        1056
      ]
    },
    {
      "id": "e4a53fdc-2243-4933-a5c1-94f50151242d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        608
      ],
      "parameters": {
        "width": 313,
        "height": 218,
        "content": "## 1. Input Data\nConfigure your Google Sheet.\n**Requirements:**\n- `email_final`\n- `linkedin_url`\n- `companyWebsite`"
      }
    },
    {
      "id": "65ecd3b1-12c4-4563-8549-e8fe409edf9c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        608
      ],
      "parameters": {
        "width": 544,
        "height": 220,
        "content": "## 2. Scraping Logic\nFirst, we attempt to scrape LinkedIn posts via Apify. \n\n**If Posts Found:** We generate personalization based on recent content.\n\n**If No Posts:** We fallback to scraping the comp"
      }
    },
    {
      "id": "18a1acb3-733e-411d-9c5a-f7c4863be1fc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        656
      ],
      "parameters": {
        "width": 820,
        "height": null,
        "content": "## 3. Website Fallback Branch\nIf LinkedIn fails, we convert the website HTML to Markdown and use GPT-4 to find unique angles."
      }
    },
    {
      "id": "93d9c975-672c-47bf-a5ce-ed583217106c",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1280
      ],
      "parameters": {
        "width": 820,
        "height": null,
        "content": "## 4. LinkedIn Branch\nIf posts exist, we aggregate them and use GPT-4 to write an icebreaker referencing specific post content."
      }
    },
    {
      "id": "68327f1e-4416-4a58-bb4d-f57014a919e7",
      "name": "Header Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        624
      ],
      "parameters": {
        "width": 600,
        "height": 544,
        "content": "# 🤖 Multi-Channel Cold Email Generator\n\n**Overview:** \nThis workflow personalizes cold emails by checking a lead's LinkedIn activity. If they have recent posts, it writes an icebreaker about them. If "
      }
    }
  ],
  "connections": {
    "Fetch Leads": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Loops": {
      "main": [
        [
          {
            "node": "Loop Over Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Posts Found?": {
      "main": [
        [
          {
            "node": "Scrape Company Website",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Aggregate Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Lead Data": {
      "main": [
        [
          {
            "node": "Apify LinkedIn Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Posts": {
      "main": [
        [
          {
            "node": "Analyze LinkedIn Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Leads": {
      "main": [
        [],
        [
          {
            "node": "Map Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Apify LinkedIn Scraper": {
      "main": [
        [
          {
            "node": "Posts Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass-through (Website)": {
      "main": [
        [
          {
            "node": "Merge Loops",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Company Website": {
      "main": [
        [
          {
            "node": "Convert HTML to Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Website Context": {
      "main": [
        [
          {
            "node": "Write Email Copy (Website Context)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass-through (LinkedIn)": {
      "main": [
        [
          {
            "node": "Merge Loops",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Analyze LinkedIn Context": {
      "main": [
        [
          {
            "node": "Write Email Copy (LinkedIn Context)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert HTML to Markdown": {
      "main": [
        [
          {
            "node": "Analyze Website Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Row (Website Data)": {
      "main": [
        [
          {
            "node": "Pass-through (Website)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Row (LinkedIn Data)": {
      "main": [
        [
          {
            "node": "Pass-through (LinkedIn)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Email Copy (Website Context)": {
      "main": [
        [
          {
            "node": "Update Row (Website Data)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Email Copy (LinkedIn Context)": {
      "main": [
        [
          {
            "node": "Update Row (LinkedIn Data)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}