AutomationFlowsMarketing & Ads › AI Lead Scoring & Routing to Slack & Sheets

AI Lead Scoring & Routing to Slack & Sheets

Original n8n title: AI Lead Scoring + Routing

AI Lead Scoring + Routing. Uses openAi, httpRequest, slack, googleSheets. Webhook trigger; 10 nodes.

Webhook trigger★★★★☆ complexityAI-powered10 nodesOpenAIHTTP RequestSlackGoogle Sheets
Marketing & Ads Trigger: Webhook Nodes: 10 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Google Sheets → HTTP Request 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
{
  "name": "AI Lead Scoring + Routing",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead-scoring",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook \u2014 nowy lead",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        400
      ]
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "message",
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Jeste\u015b ekspertem od kwalifikacji lead\u00f3w B2B w polskim M\u015aP. Oce\u0144 lead w skali 1-10 na podstawie podanych danych. Zwr\u00f3\u0107 JSON: {\"score\": <number>, \"reasoning\": \"<kr\u00f3tkie uzasadnienie po polsku>\", \"segment\": \"hot|warm|cold\"}\n\nKryteria scoringu:\n- Wielko\u015b\u0107 firmy (>50 pracownik\u00f3w = +2)\n- Bud\u017cet (podany i >5000 PLN = +2)\n- Pilno\u015b\u0107 (szuka rozwi\u0105zania teraz = +2)\n- Dopasowanie do ICP (bran\u017ca, lokalizacja = +2)\n- Kompletno\u015b\u0107 danych (email firmowy, telefon = +2)\n\nSegmenty: hot (8-10), warm (4-7), cold (1-3)"
            },
            {
              "role": "user",
              "content": "Dane leada:\n- Imi\u0119: {{$json.body.name}}\n- Email: {{$json.body.email}}\n- Firma: {{$json.body.company}}\n- Stanowisko: {{$json.body.position}}\n- Wielko\u015b\u0107 firmy: {{$json.body.company_size}}\n- Bud\u017cet: {{$json.body.budget}}\n- Wiadomo\u015b\u0107: {{$json.body.message}}\n- \u0179r\u00f3d\u0142o: {{$json.body.source}}"
            }
          ]
        },
        "options": {
          "temperature": 0.3,
          "maxTokens": 200,
          "response_format": {
            "type": "json_object"
          }
        }
      },
      "id": "openai-score",
      "name": "OpenAI \u2014 oce\u0144 lead",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        480,
        400
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const aiResponse = JSON.parse($input.item.json.message.content);\nconst leadData = $('Webhook \u2014 nowy lead').item.json.body;\n\nreturn {\n  json: {\n    ...leadData,\n    score: aiResponse.score,\n    reasoning: aiResponse.reasoning,\n    segment: aiResponse.segment,\n    scored_at: new Date().toISOString()\n  }\n};"
      },
      "id": "parse-score",
      "name": "Parsuj wynik scoringu",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        720,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "hot",
              "leftValue": "={{$json.score}}",
              "rightValue": 7,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "if-hot",
      "name": "IF \u2014 gor\u0105cy lead (>7)",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        960,
        400
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "warm",
              "leftValue": "={{$json.score}}",
              "rightValue": 3,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "if-warm",
      "name": "IF \u2014 ciep\u0142y lead (4-7)",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1200,
        560
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://REPLACE_WITH_YOUR_CRM_URL/api/contacts",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer REPLACE_WITH_YOUR_CRM_API_KEY"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{$json.name}}"
            },
            {
              "name": "email",
              "value": "={{$json.email}}"
            },
            {
              "name": "company",
              "value": "={{$json.company}}"
            },
            {
              "name": "score",
              "value": "={{$json.score}}"
            },
            {
              "name": "segment",
              "value": "hot"
            },
            {
              "name": "source",
              "value": "={{$json.source}}"
            },
            {
              "name": "notes",
              "value": "={{$json.reasoning}}"
            }
          ]
        },
        "options": {}
      },
      "id": "crm-push-hot",
      "name": "CRM \u2014 dodaj gor\u0105cy lead",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1200,
        280
      ]
    },
    {
      "parameters": {
        "channel": "#sprzedaz",
        "text": ":fire: *Gor\u0105cy lead!* (Score: {{$json.score}}/10)\n\n*{{$json.name}}* z {{$json.company}}\nStanowisko: {{$json.position}}\nEmail: {{$json.email}}\nBud\u017cet: {{$json.budget}}\n\n_{{$json.reasoning}}_",
        "otherOptions": {}
      },
      "id": "slack-notify",
      "name": "Slack \u2014 powiadom zesp\u00f3\u0142",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        1440,
        280
      ],
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "REPLACE_WITH_YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Nurture",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Data": "={{$json.scored_at}}",
            "Imi\u0119": "={{$json.name}}",
            "Email": "={{$json.email}}",
            "Firma": "={{$json.company}}",
            "Score": "={{$json.score}}",
            "Segment": "warm",
            "Uzasadnienie": "={{$json.reasoning}}"
          },
          "matchingColumns": []
        },
        "options": {}
      },
      "id": "gsheets-nurture",
      "name": "Google Sheets \u2014 lista nurture",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1440,
        480
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "REPLACE_WITH_YOUR_SPREADSHEET_ID",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Archiwum",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Data": "={{$json.scored_at}}",
            "Imi\u0119": "={{$json.name}}",
            "Email": "={{$json.email}}",
            "Firma": "={{$json.company}}",
            "Score": "={{$json.score}}",
            "Uzasadnienie": "={{$json.reasoning}}"
          },
          "matchingColumns": []
        },
        "options": {}
      },
      "id": "gsheets-archive",
      "name": "Google Sheets \u2014 archiwum",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1440,
        680
      ],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={\"status\": \"scored\", \"score\": {{$('Parsuj wynik scoringu').item.json.score}}, \"segment\": \"{{$('Parsuj wynik scoringu').item.json.segment}}\"}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "webhook-response",
      "name": "Webhook \u2014 odpowied\u017a",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1680,
        400
      ]
    }
  ],
  "connections": {
    "Webhook \u2014 nowy lead": {
      "main": [
        [
          {
            "node": "OpenAI \u2014 oce\u0144 lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI \u2014 oce\u0144 lead": {
      "main": [
        [
          {
            "node": "Parsuj wynik scoringu",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parsuj wynik scoringu": {
      "main": [
        [
          {
            "node": "IF \u2014 gor\u0105cy lead (>7)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF \u2014 gor\u0105cy lead (>7)": {
      "main": [
        [
          {
            "node": "CRM \u2014 dodaj gor\u0105cy lead",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF \u2014 ciep\u0142y lead (4-7)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CRM \u2014 dodaj gor\u0105cy lead": {
      "main": [
        [
          {
            "node": "Slack \u2014 powiadom zesp\u00f3\u0142",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack \u2014 powiadom zesp\u00f3\u0142": {
      "main": [
        [
          {
            "node": "Webhook \u2014 odpowied\u017a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF \u2014 ciep\u0142y lead (4-7)": {
      "main": [
        [
          {
            "node": "Google Sheets \u2014 lista nurture",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets \u2014 archiwum",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets \u2014 lista nurture": {
      "main": [
        [
          {
            "node": "Webhook \u2014 odpowied\u017a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets \u2014 archiwum": {
      "main": [
        [
          {
            "node": "Webhook \u2014 odpowied\u017a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner"
  },
  "staticData": null,
  "tags": [
    {
      "name": "lead-scoring"
    },
    {
      "name": "ai"
    },
    {
      "name": "crm"
    },
    {
      "name": "automatyzacja"
    }
  ],
  "triggerCount": 1,
  "updatedAt": "2026-04-08T00:00:00.000Z",
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

How this works

This workflow automates the intelligent scoring and routing of incoming leads, helping sales teams prioritise high-potential prospects and nurture others efficiently to boost conversion rates without manual effort. It is ideal for marketing or sales professionals handling inbound inquiries via web forms or emails, who want to leverage AI for smarter decision-making. The key step involves OpenAI evaluating lead quality based on provided details, followed by conditional routing: hot leads (scoring over 7) are pushed directly to your CRM via HTTP request, while warm leads (4-7) are added to a Google Sheets nurture list, with Slack notifications alerting the team to urgent opportunities.

Use this workflow when you receive a steady stream of leads through a webhook-connected source, such as a website form, and need automated triage to focus resources on promising ones. Avoid it for very low-volume leads or if your team prefers fully manual review, as the AI scoring requires clear prompt setup for accuracy. Common variations include integrating with a specific CRM like HubSpot instead of generic HTTP requests, or adding email notifications alongside Slack for broader team alerts.

About this workflow

AI Lead Scoring + Routing. Uses openAi, httpRequest, slack, googleSheets. Webhook trigger; 10 nodes.

Source: https://github.com/DariuszCiesielski/ai-automatyzacja-biznesu/blob/main/examples/n8n-lead-scoring.json — original creator credit. Request a take-down →

More Marketing & Ads workflows → · Browse all categories →

Related workflows

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

Marketing & Ads

Automated Social Media Lead Processing with AI Summaries, Slack Alerts & Jira Ticketing. Uses slack, jira, stickyNote, scheduleTrigger. Webhook trigger; 18 nodes.

Slack, Jira, Google Sheets +1
Marketing & Ads

This n8n workflow automates the generation of personalized marketing content for events, including emails, social media posts, and advertisements. Leveraging AI, it tailors content based on event deta

HTTP Request, Google Sheets, Email Send +1
Marketing & Ads

AI Lead Qualification & Follow-Up. Uses httpRequest, slack, googleSheets, gmail. Webhook trigger; 18 nodes.

HTTP Request, Slack, Google Sheets +2
Marketing & Ads

Ad Agency in a box. Uses httpRequest, splitOut, outputParserStructured, chainLlm. Webhook trigger; 54 nodes.

HTTP Request, Output Parser Structured, Chain Llm +5
Marketing & Ads

Master Social Scraper (Google Sheets). Uses chatTrigger, textClassifier, lmChatOpenAi, httpRequest. Chat trigger; 36 nodes.

Chat Trigger, Text Classifier, OpenAI Chat +4