{
  "name": "AI Cold Email Icebreaker Generator",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "a5bd6937-e326-4374-b5e6-e71a6d51c5ee",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "icebreaker"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        220,
        0
      ],
      "id": "6028e403-49b6-4f71-a390-b63dfd36c8a3",
      "name": "Google Sheets"
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4.1-mini",
          "mode": "list",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "messages": {
          "values": [
            {
              "content": "You are a helpful, intelligent writing assistant.",
              "role": "system"
            },
            {
              "content": "Your task is to take, as input, a bunch of information about a prospect, and then generate a customized, one-line email icebreaker to imply that the rest of my communique is personalized.\n\nYou'll return your icebreakers in the following JSON format:\n\n{\"verdict\":\"true or false, string\",\"icebreaker\":\"Hey {firstName}. Love {thing}—also work in {paraphrasedIndustry}. Wanted to run something by you.\", \"shortenedCompanyName\":\"Shortened version of company name (more on this in a moment)\"}\n\nRules:\n- Write in a spartan/laconic tone of voice.\n- Make sure to use the above format when constructing your icebreakers.\n- Sometimes, the data provided will not be of a person. Instead, it will be of a company. If this is the case, return a \"false\" string for \"verdict\"\n- Shorten the company name wherever possible (say, \"XYZ\" instead of \"XYZ Agency\"). More examples: \"Love AMS\" instead of \"Love AMS Professional Services\", \"Love Mayo\" instead of \"Love Mayo Inc.\", etc.\n- Do the same with locations. \"San Fran\" instead of \"San Francisco\", \"BC\" instead of \"British Columbia\", etc."
            },
            {
              "content": "Sam Carter, Owner - Harbour Lane Bakery, food & beverages, Newcastle, Australia"
            },
            {
              "content": "{\"verdict\": \"true\", \"icebreaker\": \"Hey Sam,\\n\\nLove what you're doing at Harbour Lane. Also work with local food businesses, wanted to run something by you.\", \"shortenedCompanyName\": \"Harbour Lane\"}",
              "role": "assistant"
            },
            {
              "content": "Priya Nair, Clinic Director | Sports & Running Physio, Coastline Physio, health & wellness, Perth, Australia"
            },
            {
              "content": "{\"verdict\": \"true\", \"icebreaker\": \"Hey Priya,\\n\\nLove what you're doing at Coastline (the running clinic in particular). Also work with clinics, wanted to run something by you.\", \"shortenedCompanyName\": \"Coastline\"}",
              "role": "assistant"
            },
            {
              "content": "={{ $json['first name'] }}, {{ $json['last name'] }}, {{ $json['headline'] }} {{ $json['industry'] }}, {{ $json['organization_name'] }}, {{ $json['location'] }}, {{ $json['email'] }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        720,
        0
      ],
      "id": "66ae233d-33bd-43ef-8bd5-d6430963f5b7",
      "name": "OpenAI"
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_GOOGLE_SHEET_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Leads"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "last name": "={{ $('Google Sheets').item.json['last name'] }}",
            "icebreaker": "={{ $json.message.content.icebreaker }}",
            "shortenedCompanyName": "={{ $json.message.content.shortenedCompanyName }}"
          },
          "matchingColumns": [
            "last name"
          ],
          "schema": [
            {
              "id": "first name",
              "displayName": "first name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "last name",
              "displayName": "last name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "headline",
              "displayName": "headline",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "industry",
              "displayName": "industry",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "organization_name",
              "displayName": "organization_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "location",
              "displayName": "location",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "icebreaker",
              "displayName": "icebreaker",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "shortenedCompanyName",
              "displayName": "shortenedCompanyName",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "useAppend": false
        }
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        1080,
        0
      ],
      "id": "e8e8aa3f-653c-42be-b3d0-2abd391f9e0e",
      "name": "Google Sheets1"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        440,
        0
      ],
      "id": "4c5c281a-41af-4a30-965d-2200a6875cc9",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "amount": 1
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1260,
        0
      ],
      "id": "5c4aa9a5-e1db-4a72-b283-b5db9838f1ed",
      "name": "Wait",
      "webhookId": "b1c80efc-f5ec-4f12-a533-3c2417675752"
    }
  ],
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}
