{
  "name": "AI Cold Call Machine",
  "nodes": [
    {
      "parameters": {
        "operation": "getAll",
        "documentId": { "value": "YOUR_GOOGLE_SHEET_ID" },
        "sheetName": "Prospects",
        "filters": { "conditions": [{ "value1": "Status", "condition": "isEmpty" }] }
      },
      "id": "f1a2b3c4-0001-0001-0001-000000000001",
      "name": "Get Prospect List",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [240, 300],
      "credentials": { "googleSheetsOAuth2Api": { "id": "YOUR_GSHEETS_CREDENTIAL_ID", "name": "Google Sheets OAuth2" } }
    },
    {
      "parameters": {
        "url": "=https://api.linkedin.com/v2/companies?q=name&query={{ encodeURIComponent($json['Company Name']) }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [{ "name": "Authorization", "value": "Bearer YOUR_LINKEDIN_ACCESS_TOKEN" }]
        }
      },
      "id": "f1a2b3c4-0002-0002-0002-000000000002",
      "name": "Search LinkedIn",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "create",
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a GTM analyst scoring and scripting cold calls. Given a prospect company, provide:\n1. ICP_SCORE: 1-10 based on size, industry, likely pain points\n2. DECISION_MAKER: likely title to target\n3. CALL_OPENER: a 2-sentence personalised cold call opener that references something specific\n4. KEY_PAIN: one sentence on their likely pain point\n\nFormat as JSON with keys: icsScore, decisionMaker, callOpener, keyPain"
            },
            {
              "role": "user",
              "content": "=Company: {{ $('Get Prospect List').item.json['Company Name'] }}\nIndustry: {{ $('Get Prospect List').item.json['Industry'] }}\nSize: {{ $('Get Prospect List').item.json['Company Size'] }}\nLinkedIn data: {{ JSON.stringify($json) }}"
            }
          ]
        }
      },
      "id": "f1a2b3c4-0003-0003-0003-000000000003",
      "name": "Score and Script",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [680, 300],
      "credentials": { "openAiApi": { "id": "YOUR_OPENAI_CREDENTIAL_ID", "name": "OpenAI API" } }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "1", "name": "parsed", "value": "={{ JSON.parse($json.message.content) }}", "type": "object" }
          ]
        }
      },
      "id": "f1a2b3c4-0004-0004-0004-000000000004",
      "name": "Parse AI Response",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [900, 300]
    },
    {
      "parameters": {
        "conditions": {
          "number": [{ "value1": "={{ $json.parsed.icsScore }}", "operation": "largerEqual", "value2": 7 }]
        }
      },
      "id": "f1a2b3c4-0005-0005-0005-000000000005",
      "name": "High ICP Score?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [1120, 300]
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": { "value": "YOUR_GOOGLE_SHEET_ID" },
        "sheetName": "Prospects",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ICP Score": "={{ $('Parse AI Response').item.json.parsed.icsScore }}",
            "Decision Maker": "={{ $('Parse AI Response').item.json.parsed.decisionMaker }}",
            "Call Opener": "={{ $('Parse AI Response').item.json.parsed.callOpener }}",
            "Key Pain": "={{ $('Parse AI Response').item.json.parsed.keyPain }}",
            "Status": "PRIORITY — CALL"
          }
        }
      },
      "id": "f1a2b3c4-0006-0006-0006-000000000006",
      "name": "Update Sheet — Priority",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [1340, 160],
      "credentials": { "googleSheetsOAuth2Api": { "id": "YOUR_GSHEETS_CREDENTIAL_ID", "name": "Google Sheets OAuth2" } }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": { "value": "YOUR_GOOGLE_SHEET_ID" },
        "sheetName": "Prospects",
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ICP Score": "={{ $('Parse AI Response').item.json.parsed.icsScore }}",
            "Status": "LOW PRIORITY"
          }
        }
      },
      "id": "f1a2b3c4-0007-0007-0007-000000000007",
      "name": "Update Sheet — Low Priority",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4,
      "position": [1340, 440],
      "credentials": { "googleSheetsOAuth2Api": { "id": "YOUR_GSHEETS_CREDENTIAL_ID", "name": "Google Sheets OAuth2" } }
    }
  ],
  "connections": {
    "Get Prospect List": { "main": [[{ "node": "Search LinkedIn", "type": "main", "index": 0 }]] },
    "Search LinkedIn": { "main": [[{ "node": "Score and Script", "type": "main", "index": 0 }]] },
    "Score and Script": { "main": [[{ "node": "Parse AI Response", "type": "main", "index": 0 }]] },
    "Parse AI Response": { "main": [[{ "node": "High ICP Score?", "type": "main", "index": 0 }]] },
    "High ICP Score?": {
      "main": [
        [{ "node": "Update Sheet — Priority", "type": "main", "index": 0 }],
        [{ "node": "Update Sheet — Low Priority", "type": "main", "index": 0 }]
      ]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "versionId": "f1a2b3c4-aaaa-bbbb-cccc-000000000006",
  "meta": { "templateCredsSetupCompleted": false },
  "id": "workflow-cold-call-machine",
  "tags": [{ "name": "Sales" }, { "name": "AI" }, { "name": "LinkedIn" }]
}
