AutomationFlowsMarketing & Ads › Score and Route Qualified Leads to Notion and Matrix

Score and Route Qualified Leads to Notion and Matrix

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

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…

Cron / scheduled trigger★★★★☆ complexity20 nodesHTTP RequestNotionMatrix
Marketing & Ads Trigger: Cron / scheduled Nodes: 20 Complexity: ★★★★☆ Added:

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

This workflow follows the HTTP Request → Notion 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": "JZ8C3IFRtHrntshw",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Lead Scoring Pipeline \u2013 Matrix + Notion",
  "tags": [],
  "nodes": [
    {
      "id": "3f35599e-e911-4f67-b900-44ceefa51291",
      "name": "\ud83d\udccc Lead Scoring Pipeline \u2013 Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -800,
        48
      ],
      "parameters": {
        "width": 550,
        "height": 690,
        "content": "## How it works\nThis workflow runs on a schedule, pulls the latest form submissions, enriches each lead with Clearbit data, and generates a numeric score based on firmographic and demographic signals.  Qualified leads (score \u2265 75) are written to a Notion CRM database and announced in a Matrix room so the sales team can act immediately.  Disqualified leads are still archived to Notion for historical reference.  Robust batching, validation, and error-handling logic ensure reliable, repeatable execution.\n\n## Setup steps\n1. Configure *Leads API* credentials and URL in the **Fetch New Leads** HTTP node.\n2. Add your **Clearbit API** key as an *HTTP Header Auth* credential.\n3. Create (or locate) a Notion database with properties Name, Email, Company, Score, Status.\n4. Add your **Notion** credential and reference the database ID in the **Create / Update Lead** nodes.\n5. Supply a **Matrix** credential and target room ID in the **Matrix Notify \u2013 New Qualified Lead** node.\n6. Adjust the scoring logic inside **Code \u2013 Calculate Lead Score** as needed.\n7. Activate the workflow once all credentials and IDs are in place."
      },
      "typeVersion": 1
    },
    {
      "id": "9459faf6-b2ed-4352-a8eb-3754e9214e65",
      "name": "\ud83d\uddc2\ufe0f Data Collection",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 562,
        "height": 670,
        "content": "## Data Collection\nThis section is responsible for regularly polling the external form provider for brand-new submissions. The **Schedule Trigger** fires based on the CRON rule you define (default every 15 minutes) and hands control to **Fetch New Leads**, an HTTP Request node authenticated with your form provider. The request should return an array of lead JSON objects containing at least an *email* and *name*. The subsequent **IF \u2013 Any Leads?** gate prevents unnecessary downstream execution when no fresh data is available. Finally, **Split In Batches** ensures we process leads one at a time, which makes rate-limiting, enrichment, and error-handling simpler and more predictable."
      },
      "typeVersion": 1
    },
    {
      "id": "7306ea3a-fe2a-4411-b7ff-43da4ff8407c",
      "name": "\ud83d\udd0d Enrichment & Scoring",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 1026,
        "height": 654,
        "content": "## Enrichment & Scoring\nAfter basic validation, each lead flows into **Clearbit Enrichment** where person + company data are fetched in real-time. A **Merge \u2013 Combine Lead & Enrichment** node stitches the original submission together with Clearbit\u2019s response, ensuring a unified data structure for scoring. In **Code \u2013 Calculate Lead Score** you can tweak the weighting of factors such as employee count, funding, Alexa rank, or role seniority. The script returns a `score` field (0-100) and a boolean `qualified`. Adjust thresholds or criteria here to match your unique ICP (Ideal Customer Profile)."
      },
      "typeVersion": 1
    },
    {
      "id": "d32ca77c-155b-4dd1-949b-88507de1cd4b",
      "name": "\ud83d\udcbe Storage & Notification",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        -32
      ],
      "parameters": {
        "color": 7,
        "width": 914,
        "height": 766,
        "content": "## Storage & Notification\nQualified leads are persisted to a Notion CRM database via **Notion \u2013 Create Qualified Lead Page** and immediately broadcast to your sales chat with **Matrix Notify \u2013 New Qualified Lead**. Disqualified or lower-priority leads still flow to **Notion \u2013 Archive Disqualified Lead** so marketing can analyze trends over time. Because Notion stores both categories, you maintain a single source of truth while still surfacing only high-value prospects to the front-line team. The notification payload is assembled in **Code \u2013 Build Matrix Message** making it easy to customize the message template, add emojis, or include deep links to the Notion page."
      },
      "typeVersion": 1
    },
    {
      "id": "27d535c5-9159-40f3-8510-1d4001edcbd2",
      "name": "Schedule \u2013 Every 15 min",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -144,
        400
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8b046e08-2f92-4448-b390-2bf6277cb304",
      "name": "Fetch New Leads",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        64,
        400
      ],
      "parameters": {
        "url": "https://api.yourformprovider.com/v1/leads?status=new",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "httpHeaderAuth"
      },
      "typeVersion": 4
    },
    {
      "id": "14e85ac3-dbfd-46d7-add0-a50b01bb6d94",
      "name": "IF \u2013 Any Leads?",
      "type": "n8n-nodes-base.if",
      "position": [
        272,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "number": [
            {
              "value1": "={{ $items.length }}",
              "value2": 0,
              "operation": "larger"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2b7a297a-03a2-47e4-969e-6bea27cb479d",
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        464,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "76742d38-a023-4e9c-a738-819357bd0062",
      "name": "IF \u2013 Valid Email?",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.email }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "9a96782c-f809-41f5-a414-9e2a1f8d1e54",
      "name": "Wait 1 s (Rate-limit)",
      "type": "n8n-nodes-base.wait",
      "position": [
        864,
        256
      ],
      "parameters": {
        "unit": "seconds"
      },
      "typeVersion": 1
    },
    {
      "id": "6cb7070b-2287-48cd-bf86-cf0fd2ffb178",
      "name": "Set \u2013 Lead Basics",
      "type": "n8n-nodes-base.set",
      "position": [
        864,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ca21aeaf-05b9-403e-945e-1f9f2fe7b910",
      "name": "Clearbit Enrichment",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        400
      ],
      "parameters": {
        "url": "https://person.clearbit.com/v2/combined/find?email={{$json.email}}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "httpHeaderAuth"
      },
      "typeVersion": 4
    },
    {
      "id": "8133f5e9-209a-49c4-bf79-95d0eaf1376d",
      "name": "Merge \u2013 Combine Lead & Enrichment",
      "type": "n8n-nodes-base.merge",
      "position": [
        1264,
        400
      ],
      "parameters": {
        "mode": "mergeByIndex",
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "2ac4391b-582f-4aa6-9f05-89f7a516abfb",
      "name": "Code \u2013 Calculate Lead Score",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        400
      ],
      "parameters": {
        "jsCode": "// Simple example; adjust weights as needed\nconst items = $input.items;\nreturn items.map(item => {\n  const data = item.json;\n  const company = data.company || {};\n  const metrics = company.metrics || {};\n  const employeeCount = metrics.employees || 0;\n  const alexa = metrics.alexa || 1000000;\n\n  let score = 0;\n  if (employeeCount > 50) score += 30;\n  if (employeeCount > 200) score += 20;\n  if (data.title && /director|vp|chief|head/i.test(data.title)) score += 20;\n  if (alexa < 200000) score += 20;\n  // Cap at 100\n  if (score > 100) score = 100;\n\n  return {\n    json: {\n      ...data,\n      score,\n      qualified: score >= 75\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "5566a1af-8b17-484e-8642-49cb6c94e981",
      "name": "Set \u2013 Build Notion Props",
      "type": "n8n-nodes-base.set",
      "position": [
        1664,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "6d8ae485-ccf5-4db7-a049-f38c40127a40",
      "name": "IF \u2013 Qualified?",
      "type": "n8n-nodes-base.if",
      "position": [
        1872,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.qualified }}",
              "operation": "isTrue"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "24953229-b0e5-4dc3-81e4-c29f61c5f735",
      "name": "Notion \u2013 Create Qualified Lead Page",
      "type": "n8n-nodes-base.notion",
      "position": [
        2064,
        288
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "databaseId": "={{ $json.notion_database_id || 'YOUR_NOTION_DATABASE_ID' }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Name",
              "title": "={{ $json.full_name }}"
            },
            {
              "key": "Email"
            },
            {
              "key": "Company",
              "richText": "={{ $json.company.name || $json.company }}"
            },
            {
              "key": "Score"
            },
            {
              "key": "Status",
              "selectValue": "Qualified"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "03dd0d65-b623-430d-afb0-0299e7072105",
      "name": "Code \u2013 Build Matrix Message",
      "type": "n8n-nodes-base.code",
      "position": [
        2272,
        288
      ],
      "parameters": {
        "jsCode": "const item = $input.first().json;\nconst message = `\ud83c\udfaf *New Qualified Lead!*\\nName: **${item.full_name}**\\nCompany: **${item.company.name || item.company}**\\nScore: **${item.score}**`;\nreturn [{ json: { message } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "e6cc1220-2d80-490d-82e6-ffd552f2acad",
      "name": "Matrix Notify \u2013 New Qualified Lead",
      "type": "n8n-nodes-base.matrix",
      "position": [
        2464,
        288
      ],
      "parameters": {
        "operation": "sendMessage"
      },
      "typeVersion": 1
    },
    {
      "id": "f02f114a-7ceb-4113-bb8a-adbd5808f6d9",
      "name": "Notion \u2013 Archive Disqualified Lead",
      "type": "n8n-nodes-base.notion",
      "position": [
        2064,
        528
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "resource": "databasePage",
        "databaseId": "={{ $json.notion_database_id || 'YOUR_NOTION_DATABASE_ID' }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Name",
              "title": "={{ $json.full_name }}"
            },
            {
              "key": "Email"
            },
            {
              "key": "Company",
              "richText": "={{ $json.company.name || $json.company }}"
            },
            {
              "key": "Score"
            },
            {
              "key": "Status",
              "selectValue": "Disqualified"
            }
          ]
        }
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fdb9d457-f890-447b-a47c-42c6011a0440",
  "connections": {
    "Fetch New Leads": {
      "main": [
        [
          {
            "node": "IF \u2013 Any Leads?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "IF \u2013 Valid Email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF \u2013 Any Leads?": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF \u2013 Qualified?": {
      "main": [
        [
          {
            "node": "Notion \u2013 Create Qualified Lead Page",
            "type": "main",
            "index": 0
          },
          {
            "node": "Code \u2013 Build Matrix Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notion \u2013 Archive Disqualified Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clearbit Enrichment": {
      "main": [
        [
          {
            "node": "Merge \u2013 Combine Lead & Enrichment",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "IF \u2013 Valid Email?": {
      "main": [
        [
          {
            "node": "Wait 1 s (Rate-limit)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set \u2013 Lead Basics": {
      "main": [
        [
          {
            "node": "Merge \u2013 Combine Lead & Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1 s (Rate-limit)": {
      "main": [
        [
          {
            "node": "Set \u2013 Lead Basics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule \u2013 Every 15 min": {
      "main": [
        [
          {
            "node": "Fetch New Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set \u2013 Build Notion Props": {
      "main": [
        [
          {
            "node": "IF \u2013 Qualified?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code \u2013 Build Matrix Message": {
      "main": [
        [
          {
            "node": "Matrix Notify \u2013 New Qualified Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code \u2013 Calculate Lead Score": {
      "main": [
        [
          {
            "node": "Set \u2013 Build Notion Props",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge \u2013 Combine Lead & Enrichment": {
      "main": [
        [
          {
            "node": "Code \u2013 Calculate Lead Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion \u2013 Create Qualified Lead Page": {
      "main": [
        [
          {
            "node": "Code \u2013 Build Matrix Message",
            "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 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…

Source: https://n8n.io/workflows/13116/ — 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

This workflow transforms your Meta Ads creatives into a rich dataset of actionable insights. It's designed for data-driven marketers, performance agencies, and analysts who want to move beyond basic m

Facebook Graph Api, HTTP Request, Google Sheets
Marketing & Ads

I created this workflow with great care to help you simplify your daily reporting routine. If you manage Meta Ads campaigns, you know how time-consuming it can be to open Ads Manager, filter data, and

Google Sheets, Facebook Graph Api, Gmail +1
Marketing & Ads

I built this workflow to remove the daily pain of Meta Ads reporting. If you manage multiple ad accounts, you know how time-consuming it is to open Ads Manager, export campaign data, clean spreadsheet

Google Sheets, HTTP Request, Telegram
Marketing & Ads

This workflow automates a complete 5-step user onboarding sequence by integrating Notion (as a CRM), Gmail (for sending emails), and Telegram (for team alerts).

Notion, Gmail, Telegram
Marketing & Ads

This workflow monitors Meta Ads and Google Ads campaigns on a daily schedule to detect performance drops. It fetches yesterday’s campaign data, standardizes metrics, and calculates CTR and ROAS agains

Google Sheets, HTTP Request, Slack +3