AutomationFlowsCRM & Sales › Website Intelligence & Lead Scoring with Scrapegraphai, Hubspot and Slack

Website Intelligence & Lead Scoring with Scrapegraphai, Hubspot and Slack

Byvinci-king-01 @vinci-king-01 on n8n.io

This workflow automatically analyzes website visitors in real-time, enriches their data with company intelligence, and provides lead scoring and sales alerts. Webhook Trigger - Receives visitor data from your website tracking system. AI-Powered Company Intelligence - Uses…

Webhook trigger★★★★☆ complexity12 nodesN8N Nodes ScrapegraphaiHubSpotSlack
CRM & Sales Trigger: Webhook Nodes: 12 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #6570 — we link there as the canonical source.

This workflow follows the HubSpot → Slack recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "VhEwspDqzu7ssFVE",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "My workflow 2",
  "tags": [
    {
      "id": "DxXGubfBzRKh6L8T",
      "name": "Revenue Optimization",
      "createdAt": "2025-07-25T16:24:30.370Z",
      "updatedAt": "2025-07-25T16:24:30.370Z"
    },
    {
      "id": "IxkcJ2IpYIxivoHV",
      "name": "Content Strategy",
      "createdAt": "2025-07-25T12:57:37.677Z",
      "updatedAt": "2025-07-25T12:57:37.677Z"
    },
    {
      "id": "PAKIJ2Mm9EvRcR3u",
      "name": "Trend Monitoring",
      "createdAt": "2025-07-25T12:57:37.670Z",
      "updatedAt": "2025-07-25T12:57:37.670Z"
    },
    {
      "id": "YtfXmaZk44MYedPO",
      "name": "Dynamic Pricing",
      "createdAt": "2025-07-25T16:24:30.369Z",
      "updatedAt": "2025-07-25T16:24:30.369Z"
    }
  ],
  "nodes": [
    {
      "id": "2edae932-a3e1-42b6-b898-24adff666dd8",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1600,
        672
      ],
      "parameters": {
        "path": "visitor-tracking",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f8ff3605-a05d-49a8-b739-9b07ca1497a6",
      "name": "ScrapeGraphAI - Company Intel",
      "type": "n8n-nodes-scrapegraphai.scrapegraphAi",
      "position": [
        -1088,
        640
      ],
      "parameters": {
        "userPrompt": "Extract comprehensive company information from this website. Use the following schema for response: { \"company_name\": \"Company Name\", \"industry\": \"Technology/Healthcare/etc\", \"company_size\": \"1-50/51-200/201-1000/1000+\", \"description\": \"Brief company description\", \"services\": [\"Service 1\", \"Service 2\"], \"contact_info\": { \"email\": \"user@example.com\", \"phone\": \"+1-555-0123\", \"address\": \"123 Business St, City, State\" }, \"social_media\": { \"linkedin\": \"linkedin.com/company/name\", \"twitter\": \"@company\" }, \"key_personnel\": [{ \"name\": \"John Doe\", \"title\": \"CEO\" }], \"technologies\": [\"React\", \"AWS\", \"etc\"], \"recent_news\": [\"Recent announcement or news\"], \"funding_info\": \"Series A, $5M raised\", \"competitors\": [\"Competitor 1\", \"Competitor 2\"] }",
        "websiteUrl": "={{ $json.company_domain ? 'https://' + $json.company_domain : 'https://' + $json.visitor_ip_domain }}"
      },
      "typeVersion": 1
    },
    {
      "id": "50729cf8-6781-4f80-9b4f-acb57f4a1d4c",
      "name": "Visitor Enricher",
      "type": "n8n-nodes-base.code",
      "position": [
        -480,
        656
      ],
      "parameters": {
        "jsCode": "// Get input data from webhook and scraped company data\nconst visitorData = $input.first().json;\nconst companyData = $input.last().json.result || {};\n\n// Enrich visitor data with company intelligence\nfunction enrichVisitorData(visitor, company) {\n  const enrichedData = {\n    // Original visitor data\n    visitor_id: visitor.visitor_id || generateVisitorId(),\n    timestamp: visitor.timestamp || new Date().toISOString(),\n    ip_address: visitor.ip_address,\n    user_agent: visitor.user_agent,\n    page_visited: visitor.page_visited,\n    referrer: visitor.referrer,\n    session_duration: visitor.session_duration || 0,\n    pages_viewed: visitor.pages_viewed || 1,\n    \n    // Enriched company data\n    company: {\n      name: company.company_name || 'Unknown Company',\n      domain: visitor.company_domain || visitor.visitor_ip_domain,\n      industry: company.industry || 'Unknown',\n      size: company.company_size || 'Unknown',\n      description: company.description || '',\n      services: company.services || [],\n      technologies: company.technologies || [],\n      funding_info: company.funding_info || '',\n      competitors: company.competitors || []\n    },\n    \n    // Contact information\n    contact_info: company.contact_info || {},\n    social_media: company.social_media || {},\n    key_personnel: company.key_personnel || [],\n    \n    // Behavioral data\n    behavior: {\n      visit_type: determineVisitType(visitor),\n      engagement_level: calculateEngagement(visitor),\n      intent_signals: identifyIntentSignals(visitor),\n      device_type: getDeviceType(visitor.user_agent),\n      location: visitor.location || 'Unknown'\n    },\n    \n    // Recent company activity\n    recent_activity: {\n      news: company.recent_news || [],\n      last_updated: new Date().toISOString()\n    }\n  };\n  \n  return enrichedData;\n}\n\nfunction generateVisitorId() {\n  return 'visitor_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n}\n\nfunction determineVisitType(visitor) {\n  if (visitor.referrer && visitor.referrer.includes('google.com')) {\n    return 'organic_search';\n  } else if (visitor.referrer && visitor.referrer.includes('linkedin.com')) {\n    return 'social_media';\n  } else if (!visitor.referrer) {\n    return 'direct';\n  } else {\n    return 'referral';\n  }\n}\n\nfunction calculateEngagement(visitor) {\n  const duration = visitor.session_duration || 0;\n  const pages = visitor.pages_viewed || 1;\n  \n  if (duration > 300 && pages > 3) return 'high';\n  if (duration > 120 && pages > 1) return 'medium';\n  return 'low';\n}\n\nfunction identifyIntentSignals(visitor) {\n  const signals = [];\n  const page = visitor.page_visited || '';\n  \n  if (page.includes('/pricing')) signals.push('pricing_interest');\n  if (page.includes('/demo')) signals.push('demo_request');\n  if (page.includes('/contact')) signals.push('contact_intent');\n  if (page.includes('/case-study')) signals.push('research_mode');\n  if (page.includes('/careers')) signals.push('hiring_interest');\n  \n  return signals;\n}\n\nfunction getDeviceType(userAgent) {\n  if (!userAgent) return 'unknown';\n  if (/Mobile|Android|iPhone/i.test(userAgent)) return 'mobile';\n  if (/Tablet|iPad/i.test(userAgent)) return 'tablet';\n  return 'desktop';\n}\n\n// Process the enrichment\nconst enrichedVisitor = enrichVisitorData(visitorData, companyData);\n\nconsole.log('Visitor enriched with company intelligence:', enrichedVisitor.company.name);\n\nreturn {\n  json: enrichedVisitor\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "e79a7dce-bbad-49ae-9f59-cc41593b503f",
      "name": "Lead Scorer",
      "type": "n8n-nodes-base.code",
      "position": [
        48,
        656
      ],
      "parameters": {
        "jsCode": "// Get enriched visitor data\nconst enrichedData = $input.first().json;\n\n// Lead scoring algorithm\nfunction calculateLeadScore(data) {\n  let score = 0;\n  const factors = {};\n  \n  // Company size scoring (0-25 points)\n  const companySize = data.company.size;\n  if (companySize === '1000+') {\n    score += 25;\n    factors.company_size = 25;\n  } else if (companySize === '201-1000') {\n    score += 20;\n    factors.company_size = 20;\n  } else if (companySize === '51-200') {\n    score += 15;\n    factors.company_size = 15;\n  } else if (companySize === '1-50') {\n    score += 10;\n    factors.company_size = 10;\n  } else {\n    factors.company_size = 0;\n  }\n  \n  // Industry relevance (0-20 points)\n  const targetIndustries = ['Technology', 'SaaS', 'Software', 'Finance', 'Healthcare'];\n  if (targetIndustries.includes(data.company.industry)) {\n    score += 20;\n    factors.industry_fit = 20;\n  } else {\n    factors.industry_fit = 0;\n  }\n  \n  // Engagement level (0-20 points)\n  if (data.behavior.engagement_level === 'high') {\n    score += 20;\n    factors.engagement = 20;\n  } else if (data.behavior.engagement_level === 'medium') {\n    score += 12;\n    factors.engagement = 12;\n  } else {\n    score += 5;\n    factors.engagement = 5;\n  }\n  \n  // Intent signals (0-25 points)\n  const intentPoints = data.behavior.intent_signals.length * 5;\n  score += Math.min(intentPoints, 25);\n  factors.intent_signals = Math.min(intentPoints, 25);\n  \n  // Technology stack alignment (0-10 points)\n  const ourTechnologies = ['React', 'AWS', 'Python', 'Node.js', 'Docker'];\n  const commonTech = data.company.technologies.filter(tech => \n    ourTechnologies.includes(tech)\n  ).length;\n  const techScore = Math.min(commonTech * 2, 10);\n  score += techScore;\n  factors.tech_alignment = techScore;\n  \n  return { score, factors };\n}\n\n// Calculate lead qualification\nfunction qualifyLead(score) {\n  if (score >= 80) return 'hot';\n  if (score >= 60) return 'warm';\n  if (score >= 40) return 'qualified';\n  if (score >= 20) return 'cold';\n  return 'unqualified';\n}\n\n// Determine priority level\nfunction getPriority(qualification, intentSignals) {\n  if (qualification === 'hot' || intentSignals.includes('demo_request')) {\n    return 'immediate';\n  }\n  if (qualification === 'warm' || intentSignals.includes('pricing_interest')) {\n    return 'high';\n  }\n  if (qualification === 'qualified') {\n    return 'medium';\n  }\n  return 'low';\n}\n\n// Generate recommended actions\nfunction getRecommendedActions(data, qualification, priority) {\n  const actions = [];\n  \n  if (priority === 'immediate') {\n    actions.push('Schedule immediate sales call');\n    actions.push('Send personalized demo invitation');\n  }\n  \n  if (data.behavior.intent_signals.includes('pricing_interest')) {\n    actions.push('Share pricing information');\n    actions.push('Offer custom quote');\n  }\n  \n  if (data.behavior.intent_signals.includes('contact_intent')) {\n    actions.push('Initiate contact within 24 hours');\n  }\n  \n  if (qualification === 'warm' || qualification === 'hot') {\n    actions.push('Add to priority nurture campaign');\n    actions.push('Research key contacts at company');\n  }\n  \n  if (data.company.funding_info) {\n    actions.push('Review recent funding for expansion opportunities');\n  }\n  \n  return actions;\n}\n\n// Process scoring\nconst scoringResult = calculateLeadScore(enrichedData);\nconst qualification = qualifyLead(scoringResult.score);\nconst priority = getPriority(qualification, enrichedData.behavior.intent_signals);\nconst recommendedActions = getRecommendedActions(enrichedData, qualification, priority);\n\n// Create final scored lead data\nconst scoredLead = {\n  ...enrichedData,\n  lead_score: {\n    total_score: scoringResult.score,\n    max_score: 100,\n    scoring_factors: scoringResult.factors,\n    qualification: qualification,\n    priority: priority,\n    scored_at: new Date().toISOString()\n  },\n  recommendations: {\n    actions: recommendedActions,\n    next_steps: getNextSteps(qualification, priority),\n    estimated_deal_size: estimateDealSize(enrichedData.company.size, enrichedData.company.industry)\n  }\n};\n\nfunction getNextSteps(qualification, priority) {\n  if (priority === 'immediate') {\n    return 'Contact within 1 hour';\n  } else if (priority === 'high') {\n    return 'Contact within 4 hours';\n  } else if (priority === 'medium') {\n    return 'Contact within 24 hours';\n  }\n  return 'Add to nurture sequence';\n}\n\nfunction estimateDealSize(companySize, industry) {\n  let baseSize = 5000; // Base deal size\n  \n  // Adjust by company size\n  if (companySize === '1000+') baseSize *= 10;\n  else if (companySize === '201-1000') baseSize *= 5;\n  else if (companySize === '51-200') baseSize *= 2;\n  \n  // Adjust by industry\n  if (['Finance', 'Healthcare'].includes(industry)) baseSize *= 1.5;\n  if (industry === 'Technology') baseSize *= 1.3;\n  \n  return `$${baseSize.toLocaleString()} - $${(baseSize * 3).toLocaleString()}`;\n}\n\nconsole.log(`Lead scored: ${scoringResult.score}/100 - ${qualification} (${priority} priority)`);\n\nreturn {\n  json: scoredLead\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2b7a58ba-2086-479d-b90b-99487760145a",
      "name": "CRM Update",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        576,
        672
      ],
      "parameters": {
        "email": "={{ $json.contact_info.email || $json.visitor_id + '@' + $json.company.domain }}",
        "options": {},
        "additionalFields": {
          "industry": "={{ $json.company.industry }}"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "f8703761-8c95-41e1-a1a7-6a1f937021ce",
      "name": "Sales Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        1056,
        800
      ],
      "parameters": {
        "text": "\ud83d\udea8 **HIGH PRIORITY LEAD ALERT** \ud83d\udea8\n\n\ud83d\udc64 **Visitor Details:**\n\u2022 Company: {{ $json.company.name }}\n\u2022 Industry: {{ $json.company.industry }}\n\u2022 Size: {{ $json.company.size }}\n\u2022 Website: {{ $json.company.domain }}\n\n\ud83d\udcca **Lead Score: {{ $json.lead_score.total_score }}/100**\n\ud83c\udfaf **Qualification: {{ $json.lead_score.qualification.toUpperCase() }}**\n\u26a1 **Priority: {{ $json.lead_score.priority.toUpperCase() }}**\n\n\ud83d\udd0d **Intent Signals:**\n{{ $json.behavior.intent_signals.length > 0 ? $json.behavior.intent_signals.map(signal => '\u2022 ' + signal.replace('_', ' ')).join('\\n') : '\u2022 No specific signals detected' }}\n\n\ud83c\udfaf **Recommended Actions:**\n{{ $json.recommendations.actions.map(action => '\u2022 ' + action).join('\\n') }}\n\n\ud83d\udcb0 **Estimated Deal Size:** {{ $json.recommendations.estimated_deal_size }}\n\u23f0 **Next Steps:** {{ $json.recommendations.next_steps }}\n\n\ud83d\udcf1 **Visit Details:**\n\u2022 Page: {{ $json.page_visited }}\n\u2022 Source: {{ $json.behavior.visit_type }}\n\u2022 Engagement: {{ $json.behavior.engagement_level }}\n\u2022 Device: {{ $json.behavior.device_type }}\n\n\ud83d\udd50 **Detected:** {{ new Date($json.timestamp).toLocaleString() }}\n\n---\n*Visitor ID: {{ $json.visitor_id }}*",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C1234567890"
        },
        "otherOptions": {
          "mrkdwn": true
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5225845d-d700-4fec-95bd-8c4fc4d9a309",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        32
      ],
      "parameters": {
        "color": 4,
        "width": 550,
        "height": 962,
        "content": "# Step 1: Webhook Trigger \ud83c\udfa3\n\nCaptures visitor data from your website tracking code.\n\n## Expected Data Format\n```json\n{\n  \"visitor_id\": \"unique_id\",\n  \"ip_address\": \"192.168.1.1\",\n  \"company_domain\": \"example.com\",\n  \"page_visited\": \"/pricing\",\n  \"referrer\": \"google.com\",\n  \"user_agent\": \"browser_info\",\n  \"session_duration\": 180,\n  \"pages_viewed\": 3\n}\n```\n\n## Setup\n- Install tracking script on your website\n- Configure webhook URL in your analytics\n- Test with sample visitor data"
      },
      "typeVersion": 1
    },
    {
      "id": "ffe05945-e48b-418e-90f1-9a60b089a33a",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1264,
        32
      ],
      "parameters": {
        "color": 5,
        "width": 550,
        "height": 962,
        "content": "# Step 2: ScrapeGraphAI - Company Intel \ud83d\udd75\ufe0f\n\nScrapes the visitor's company website to gather intelligence.\n\n## What It Extracts\n- Company name and description\n- Industry and company size\n- Services and technologies\n- Contact information\n- Key personnel\n- Recent news and funding\n- Competitor analysis\n\n## Configuration\n- Add your ScrapeGraphAI API credentials\n- Uses dynamic URL from visitor data\n- Comprehensive company profiling"
      },
      "typeVersion": 1
    },
    {
      "id": "2f417273-502f-4063-b645-ea0768282376",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        32
      ],
      "parameters": {
        "color": 6,
        "width": 550,
        "height": 962,
        "content": "# Step 3: Visitor Enricher \ud83d\udd0d\n\nCombines visitor behavior with company intelligence.\n\n## Enrichment Process\n- Merges visitor data with company info\n- Analyzes behavioral patterns\n- Identifies intent signals\n- Determines engagement level\n- Extracts device and location data\n\n## Output\n- Complete visitor profile\n- Company context\n- Behavioral insights\n- Intent indicators"
      },
      "typeVersion": 1
    },
    {
      "id": "16cdaabe-0e33-46d0-ac39-cdac97f5469b",
      "name": "Sticky Note 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        32
      ],
      "parameters": {
        "color": 7,
        "width": 550,
        "height": 962,
        "content": "# Step 4: Lead Scorer \ud83d\udcca\n\nCalculates lead score based on multiple factors.\n\n## Scoring Factors (0-100 points)\n- **Company Size** (0-25): Larger = higher score\n- **Industry Fit** (0-20): Target industries get max\n- **Engagement Level** (0-20): Time + pages viewed\n- **Intent Signals** (0-25): Pricing, demo, contact pages\n- **Tech Alignment** (0-10): Matching technology stack\n\n## Qualification Levels\n- **Hot** (80+): Immediate action needed\n- **Warm** (60-79): High priority follow-up\n- **Qualified** (40-59): Standard nurturing\n- **Cold** (20-39): Long-term nurturing\n- **Unqualified** (<20): Monitor only"
      },
      "typeVersion": 1
    },
    {
      "id": "62de77ee-8872-4dd9-8697-630d7cb38740",
      "name": "Sticky Note 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        32
      ],
      "parameters": {
        "color": 3,
        "width": 550,
        "height": 962,
        "content": "# Step 5: CRM Update \ud83d\udcbe\n\nUpdates your CRM with enriched lead data.\n\n## CRM Integration (HubSpot)\n- Creates/updates contact record\n- Sets lead score and qualification\n- Adds company information\n- Updates custom properties\n- Assigns to appropriate pipeline\n\n## Data Sync\n- Visitor behavior data\n- Company intelligence\n- Lead scoring results\n- Intent signals\n- Estimated deal size\n\n## Configuration\n- Add HubSpot API credentials\n- Map custom properties\n- Set up lead routing rules"
      },
      "typeVersion": 1
    },
    {
      "id": "13f3e379-bc37-4fd8-98c0-6506801d7016",
      "name": "Sticky Note 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        32
      ],
      "parameters": {
        "color": 2,
        "width": 550,
        "height": 978,
        "content": "# Step 6: Sales Alert \ud83d\udea8\n\nSends real-time alerts to your sales team.\n\n## Alert Triggers\n- High-priority leads (Warm/Hot)\n- Specific intent signals\n- Large company visitors\n- Repeat visitors\n\n## Alert Details\n- Lead score and qualification\n- Company information\n- Intent signals detected\n- Recommended actions\n- Estimated deal size\n- Next steps timeline\n\n## Channels\n- Slack notifications\n- Email alerts\n- SMS for urgent leads\n- Mobile push notifications\n\n## Configuration\n- Set up Slack workspace integration\n- Configure alert thresholds\n- Customize message templates"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8d04ee78-cffe-4783-9d8a-f0aae110ca60",
  "connections": {
    "CRM Update": {
      "main": [
        [
          {
            "node": "Sales Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Scorer": {
      "main": [
        [
          {
            "node": "CRM Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "ScrapeGraphAI - Company Intel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Visitor Enricher": {
      "main": [
        [
          {
            "node": "Lead Scorer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapeGraphAI - Company Intel": {
      "main": [
        [
          {
            "node": "Visitor Enricher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automatically analyzes website visitors in real-time, enriches their data with company intelligence, and provides lead scoring and sales alerts. Webhook Trigger - Receives visitor data from your website tracking system. AI-Powered Company Intelligence - Uses…

Source: https://n8n.io/workflows/6570/ — original creator credit. Request a take-down →

More CRM & Sales workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

CRM & Sales

Automate your lead qualification pipeline — capture Typeform Webhook leads, enrich with APIs, score intelligently, and route to HubSpot, Slack, and Sheets in real-time.

HTTP Request, HubSpot, Slack +1
CRM & Sales

How it works This Lead Capture & Auto-Qualification workflow transforms raw leads into qualified prospects through intelligent automation. Here's the high-level flow: Lead Intake → Data Validation → E

Clearbit, HTTP Request, HubSpot +1
CRM & Sales

AI-Powered Lead Qualification & Routing System. Uses supabase, httpRequest, openAi, slack. Webhook trigger; 47 nodes.

Supabase, HTTP Request, OpenAI +2
CRM & Sales

Who is this for? Event organizers, RevOps teams, sales managers, and marketers running conferences, webinars, or meetups who want to automatically qualify RSVPs and turn attendees into revenue opportu

Google Sheets, OpenAI, HubSpot +1
CRM & Sales

This project automates the process of collecting and managing new leads submitted through a web form. It eliminates the need for manual data entry and ensures that each lead is: Properly recorded and

Google Sheets Trigger, Slack, Gmail +1