{"product_id":"n8n-webhook-lead-scoring-routing-with-javascript-rules","title":"n8n Webhook Lead Scoring \u0026 Routing with JavaScript Rules","description":"\u003ch3\u003eScore every incoming lead instantly—then route it to the right response in n8n\u003c\/h3\u003e\n\u003cp\u003eThis n8n Webhook Lead Scoring \u0026amp; Routing workflow receives lead submissions via an \u003cstrong\u003en8n webhook\u003c\/strong\u003e, validates and scores them using \u003cstrong\u003ecustom JavaScript rules\u003c\/strong\u003e, and responds immediately with JSON for invalid, hot, or nurture leads. No manual triage—just smart routing and clear scoring in the same request.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a POST request\u003c\/strong\u003e on the webhook endpoint (for the \u003ccode\u003e\/lead-intake\u003c\/code\u003e path), including lead fields such as \u003cem\u003ename\u003c\/em\u003e, \u003cem\u003eemail\u003c\/em\u003e, \u003cem\u003ecompany\u003c\/em\u003e, \u003cem\u003ebudget\u003c\/em\u003e, and \u003cem\u003etimeline\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads configurable scoring settings\u003c\/strong\u003e, including hot\/warm thresholds, budget breakpoints, and a list of free email domains.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes and validates input\u003c\/strong\u003e (including name and email format).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalculates a lead score\u003c\/strong\u003e based on budget, whether a company is present, whether the email domain is a business domain vs. a free domain, and the timeline.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eClassifies leads\u003c\/strong\u003e as hot\/warm\/cold, then routes:\n    \u003cul\u003e\n      \u003cli\u003eInvalid leads to an \u003cstrong\u003eerror path\u003c\/strong\u003e and returns a \u003cstrong\u003e422 JSON response\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eValid leads to either a \u003cstrong\u003esales-now\u003c\/strong\u003e route (hot) or a \u003cstrong\u003enurture\u003c\/strong\u003e path (non-hot).\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResponds with JSON\u003c\/strong\u003e for accepted leads, including the chosen route and the computed score.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003ePrioritize SaaS inbound leads by budget, business email domain, and timeline.\u003c\/li\u003e\n  \u003cli\u003eImmediately reject malformed submissions with a 422 response.\u003c\/li\u003e\n  \u003cli\u003eSend “sales-now” only for high-fit leads, while routing others to nurture.\u003c\/li\u003e\n  \u003cli\u003eUse consistent lead scoring across web forms or other lead sources that POST JSON.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes\/parts used:\u003c\/strong\u003e webhook, code (JavaScript rules), set, switch, sticky note, respond to webhook.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConfiguration:\u003c\/strong\u003e adjust thresholds, budget values, and the free email domain list in the \u003cem\u003eSettings\u003c\/em\u003e node.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResponse behavior:\u003c\/strong\u003e returns \u003cstrong\u003e422 JSON\u003c\/strong\u003e for invalid leads; returns \u003cstrong\u003eroute + score\u003c\/strong\u003e for accepted leads.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46058947150003,"sku":"N8N-19700","price":4.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/Wnjngon9Tb9enrhbTbhFc_rtRPXjFC.png?v=1789722262","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-lead-scoring-routing-with-javascript-rules","provider":"N8N Commerce","version":"1.0","type":"link"}