🎣 Score and route qualified leads to Notion and Matrix

⚡ 17 views · 🎣 Lead Generation & Enrichment

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

Lead Scoring Pipeline – Matrix + Notion

This workflow automatically enriches incoming form leads, applies a customizable scoring model, then routes high-value prospects to a Notion CRM database and a Matrix channel for instant sales notification. It streamlines lead qualification by combining third-party enrichment APIs, conditional logic, and asynchronous batching—eliminating manual research and ensuring your sales team focuses on the best opportunities.

Pre-conditions/Requirements

Prerequisites

Required Credentials

Additional Setup Requirements

SettingExample / Notes
Notion Database ID8f3d49e8c8f74e6f9d32e8e2bf7c1c46
Matrix Room ID!aBcDeFgHiJ:matrix.org
Scoring Threshold (env var)LEAD_SCORE_MIN=70
Batch SizeSPLIT_IN_BATCHES=10 (controls parallel requests)
Webhook URL for form submissionhttps://your-n8n-instance/webhook/leads

How it works

This workflow automatically enriches incoming form leads, applies a customizable scoring model, then routes high-value prospects to a Notion CRM database and a Matrix channel for instant sales notification. It streamlines lead qualification by combining third-party enrichment APIs, conditional logic, and asynchronous batching—eliminating manual research and ensuring your sales team focuses on the best opportunities.

Key Steps:

Set up steps

Setup Time: 15-25 minutes

  1. Clone the template in your n8n instance or import the JSON.
  2. Set environment variables (LEAD_SCORE_MIN, SPLIT_IN_BATCHES, API keys) in n8n Settings → Variables.
  3. Configure the Webhook/Schedule Trigger
    • Webhook: copy the URL to your form provider
    • Schedule: set cron (e.g., every hour).
  4. Update HTTP Request nodes with your enrichment API endpoints & headers.
  5. Map Notion fields: open the Notion node → choose your connection → select your Leads database → map data pins (Name, Email, etc.).
  6. Enter Matrix credentials & Room ID in the Matrix node.
  7. Adjust scoring weights in the Code node (weights object) to match your ICP (Ideal Customer Profile).
  8. Execute the workflow once with test data, verify Notion rows and Matrix messages.
  9. Activate the workflow and monitor via n8n’s execution list.

Node Descriptions

Core Workflow Nodes:

Data Flow:

  1. Schedule/Webhook → SplitInBatches → HTTP Request (Enrichment) → Set → Code (Score) → If (Qualified?) →
    a. (Yes) Notion → Matrix
    b. (No) Wait (Cooldown) → Merge

Customization Examples

1. Change Scoring Weights

// Code node snippet
const weights = {
  employeeCount: 0.4, // increase influence of company size
  emailDeliverability: 0.2,
  industryMatch: 0.25,
  techStack: 0.15,
};

2. Notify Different Matrix Rooms Based on Territory

// If node expression
{{ $json.country === 'US' ? '!usSales:matrix.org' : '!intlSales:matrix.org' }}

Data Output Format

The workflow outputs structured JSON data:

{
  "name": "Jane Doe",
  "email": "jane@acme.co",
  "company": "Acme Co.",
  "enrichment": {
    "employeeCount": 120,
    "industry": "SaaS",
    "techStack": ["AWS", "React"]
  },
  "score": 83,
  "qualified": true,
  "notionPageId": "9b2a4c09-0bf4-4b58-988a-1f361b0a2c20",
  "matrixEventId": "$15163622445EBvZJ:matrix.org"
}

Troubleshooting

Common Issues

  1. Low or zero scores for valid leads – Review weighting logic and API response mapping in the Code node.
  2. Notion “Missing required property” error – Ensure all mandatory database fields are mapped and Notion token has write access.
  3. Matrix authentication failure – Double-check username/password or switch to an access token login method.

Performance Tips

Pro Tips:


This is a community template provided “as is.” Always test thoroughly in a non-production environment before activating in production.

đź”— Nodes Used

HTTP Request, Matrix, Notion, Schedule Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup