🎣 Score and route leads with Telegram alerts and Box storage

⚡ 20 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 with Telegram and Box

This workflow ingests incoming lead data from a form submission webhook, enriches each lead with external data sources, applies a custom scoring algorithm, and automatically stores the enriched record in Box while notifying your sales team in Telegram. It is designed to give you a real-time, end-to-end lead-qualification pipeline without writing any glue code.

Pre-conditions/Requirements

Prerequisites

Required Credentials

CredentialScopePurpose
Telegram Bot TokenBotSend scored-lead alerts
Box OAuth2 CredentialsApp LevelUpload enriched lead JSON/CSV
(Optional) Enrichment API KeyRESTAppend firmographic & technographic data
VariableExampleDescription
LEAD_SCORE_THRESHOLD75Minimum score that triggers a Telegram alert
BOX_FOLDER_ID123456789Destination folder for lead files

How it works

This workflow listens for new form submissions, enriches each contact with external data, calculates a lead score based on configurable criteria, and routes the lead through one of two branches: high-value leads trigger an instant Telegram alert and are archived to Box, while low-value leads are archived only. Errors are captured by an Error Trigger for post-mortem analysis.

Key Steps:

Set up steps

Setup Time: 15-25 minutes

  1. Create Telegram Bot & Get Token
    • Talk to BotFather → /newbot → copy the provided token.
  2. Create a Box Developer App
    • Enable OAuth2 → add https://api.n8n.cloud/oauth2-credential/callback (or your own) as redirect URI.
  3. Install Required Community Nodes
    • From n8n editor → “Install” → search “ScrapeGraphAI” → install.
  4. Import the Workflow JSON
    • Click “Import” → paste the workflow file → save.
  5. Configure the Webhook URL in Your Form Tool
    • Copy the production URL generated by the Webhook node → add it as form action.
  6. Set Environment Variables
    • In n8n (Settings → Environment) add LEAD_SCORE_THRESHOLD and BOX_FOLDER_ID.
  7. Fill in All Credentials
    • Telegram: paste bot token.
    • Box: complete OAuth2 flow.
    • Enrichment API: paste key in the HTTP Request node headers.
  8. Activate Workflow
    • Toggle “Activate”. Submit a test form to verify Telegram/Box outputs.

Node Descriptions

Core Workflow Nodes:

Data Flow:

  1. Webhook → Set → HTTP Request → Merge → Code → If
  2. If (true) → Telegram
  3. If (always) → Box
  4. Error (from any node) → Error Trigger

Customization Examples

Change Scoring Logic

// Inside the Code node
const { jobTitle, companySize, technologies } = items[0].json;
let score = 0;

if (jobTitle.match(/(CTO|CEO|Founder)/i)) score += 50;
if (companySize > 500) score += 20;
if (technologies.includes('AWS')) score += 10;

// Bonus: subtract points if free email domain
if (items[0].json.email.endsWith('@gmail.com')) score -= 30;

return [{ json: { ...items[0].json, score } }];

Use a Different Storage Provider (e.g., Google Drive)

// Replace Box node with Google Drive node
{
  "node": "Google Drive",
  "operation": "upload",
  "fileName": "lead_{{$json.email}}.json",
  "folderId": "1A2B3C..."
}

Data Output Format

The workflow outputs structured JSON data:

{
  "firstName": "Ada",
  "lastName": "Lovelace",
  "email": "ada@example.com",
  "company": "Analytical Engines Inc.",
  "companySize": 250,
  "jobTitle": "CTO",
  "technologies": ["AWS", "Docker", "Node.js"],
  "score": 82,
  "qualified": true,
  "timestamp": "2024-04-07T12:34:56.000Z"
}

Troubleshooting

Common Issues

  1. Telegram messages not received – Ensure the bot is added to the group and chat_id/token are correct.
  2. Box upload fails with 403 – Check folder permissions; verify OAuth2 tokens have not expired.
  3. Webhook shows 404 – The workflow is not activated or the URL was copied in “Test” mode instead of “Production”.

Performance Tips

Pro Tips:


This is a community-contributed n8n workflow template provided “as-is.” Always test thoroughly in a non-production environment before deploying to live systems.

đź”— Nodes Used

HTTP Request, Webhook, Telegram, Box

📥 Import

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

📖 Importing guide · 🔑 Credential setup