{
  "name": "cold-outbound-engine-claude",
  "nodes": [
    {
      "id": "a1b2c3d4-0001-4000-8000-000000000001",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        300
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "cold-outbound-lead",
        "responseMode": "onReceived",
        "options": {}
      }
    },
    {
      "id": "a1b2c3d4-0002-4000-8000-000000000002",
      "name": "Enrich: Fetch Company Website",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        220,
        300
      ],
      "parameters": {
        "method": "GET",
        "url": "={{ $json.website }}",
        "options": {
          "timeout": 10000,
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        }
      }
    },
    {
      "id": "a1b2c3d4-0003-4000-8000-000000000003",
      "name": "Score Fit",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1,
      "position": [
        440,
        300
      ],
      "parameters": {
        "model": "claude-3-5-sonnet-20241022",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an ICP scoring assistant. Given a lead record and their company website content, score the lead's fit against the following ICP criteria:\n- B2B SaaS or professional services company\n- 10 to 500 employees\n- English-speaking market\n- Signs of growth (hiring, new products, funding mentions)\n\nReturn ONLY valid JSON in this exact format with no additional text:\n{\"score\": 7, \"reason\": \"Brief one-sentence reason\", \"icp_match\": true}"
            },
            {
              "role": "user",
              "content": "Lead record:\nName: {{ $('Webhook Trigger').item.json.name }}\nCompany: {{ $('Webhook Trigger').item.json.company }}\nRole: {{ $('Webhook Trigger').item.json.role }}\nWebsite: {{ $('Webhook Trigger').item.json.website }}\n\nWebsite content (truncated to 3000 chars):\n{{ $json.data.substring(0, 3000) }}"
            }
          ]
        }
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "a1b2c3d4-0004-4000-8000-000000000004",
      "name": "Parse Score",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        660,
        300
      ],
      "parameters": {
        "mode": "manual",
        "fields": {
          "values": [
            {
              "name": "score",
              "type": "expression",
              "value": "={{ JSON.parse($json.message.content[0].text).score }}"
            },
            {
              "name": "reason",
              "type": "expression",
              "value": "={{ JSON.parse($json.message.content[0].text).reason }}"
            },
            {
              "name": "icp_match",
              "type": "expression",
              "value": "={{ JSON.parse($json.message.content[0].text).icp_match }}"
            },
            {
              "name": "lead_name",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.name }}"
            },
            {
              "name": "lead_company",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.company }}"
            },
            {
              "name": "lead_role",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.role }}"
            },
            {
              "name": "lead_website",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.website }}"
            }
          ]
        }
      }
    },
    {
      "id": "a1b2c3d4-0005-4000-8000-000000000005",
      "name": "IF: Score Check",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        880,
        300
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "cond-001",
              "leftValue": "={{ $json.score }}",
              "rightValue": 7,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        }
      }
    },
    {
      "id": "a1b2c3d4-0006-4000-8000-000000000006",
      "name": "Draft Email",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "typeVersion": 1,
      "position": [
        1100,
        180
      ],
      "parameters": {
        "model": "claude-3-5-sonnet-20241022",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are an expert cold outreach copywriter. Write concise, personalized cold emails that feel human and specific. Never use em-dashes, never use filler phrases like 'I hope this finds you well', and never start with 'I'. Max 3 short paragraphs. Output format:\nSubject: [subject line]\n\n[email body]"
            },
            {
              "role": "user",
              "content": "Write a cold outreach email for this lead:\nName: {{ $json.lead_name }}\nCompany: {{ $json.lead_company }}\nRole: {{ $json.lead_role }}\nWebsite: {{ $json.lead_website }}\nICP fit reason: {{ $json.reason }}\n\nThe email should reference something specific about their company, propose a concrete next step, and be under 120 words."
            }
          ]
        }
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "a1b2c3d4-0007-4000-8000-000000000007",
      "name": "Low Fit - Stop",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1100,
        440
      ],
      "parameters": {}
    },
    {
      "id": "a1b2c3d4-0008-4000-8000-000000000008",
      "name": "Parse Email Draft",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        1320,
        180
      ],
      "parameters": {
        "mode": "manual",
        "fields": {
          "values": [
            {
              "name": "email_draft",
              "type": "expression",
              "value": "={{ $json.message.content[0].text }}"
            },
            {
              "name": "lead_name",
              "type": "expression",
              "value": "={{ $('Parse Score').item.json.lead_name }}"
            },
            {
              "name": "lead_company",
              "type": "expression",
              "value": "={{ $('Parse Score').item.json.lead_company }}"
            },
            {
              "name": "lead_role",
              "type": "expression",
              "value": "={{ $('Parse Score').item.json.lead_role }}"
            },
            {
              "name": "score",
              "type": "expression",
              "value": "={{ $('Parse Score').item.json.score }}"
            },
            {
              "name": "icp_match",
              "type": "expression",
              "value": "={{ $('Parse Score').item.json.icp_match }}"
            }
          ]
        }
      }
    },
    {
      "id": "a1b2c3d4-0009-4000-8000-000000000009",
      "name": "Log to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2,
      "position": [
        1540,
        180
      ],
      "parameters": {
        "operation": "create",
        "baseId": "YOUR_AIRTABLE_BASE_ID",
        "tableId": "Leads",
        "fields": {
          "fieldMappingMode": "defineBelow",
          "value": {
            "Name": "={{ $json.lead_name }}",
            "Company": "={{ $json.lead_company }}",
            "Role": "={{ $json.lead_role }}",
            "Score": "={{ $json.score }}",
            "ICP Match": "={{ $json.icp_match }}",
            "Email Draft": "={{ $json.email_draft }}",
            "Status": "Draft Ready"
          }
        }
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "a1b2c3d4-0010-4000-8000-000000000010",
      "name": "Notify Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        1760,
        180
      ],
      "parameters": {
        "operation": "post",
        "select": "channel",
        "channelId": {
          "value": "#outbound"
        },
        "text": "New qualified lead logged to Airtable.\nName: {{ $('Parse Email Draft').item.json.lead_name }}\nCompany: {{ $('Parse Email Draft').item.json.lead_company }}\nScore: {{ $('Parse Email Draft').item.json.score }}/10\nEmail draft is ready for review in Airtable.",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Enrich: Fetch Company Website",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich: Fetch Company Website": {
      "main": [
        [
          {
            "node": "Score Fit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score Fit": {
      "main": [
        [
          {
            "node": "Parse Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Score": {
      "main": [
        [
          {
            "node": "IF: Score Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF: Score Check": {
      "main": [
        [
          {
            "node": "Draft Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Low Fit - Stop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Draft Email": {
      "main": [
        [
          {
            "node": "Parse Email Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Email Draft": {
      "main": [
        [
          {
            "node": "Log to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Airtable": {
      "main": [
        [
          {
            "node": "Notify Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-05-17T00:00:00.000Z",
  "versionId": "v1"
}