🎣 Score and route leads with Clearbit, Mattermost and Trello

⚑ 8 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 Mattermost and Trello

This workflow automatically enriches incoming form-based leads, calculates a lead-score from multiple data points, and then routes high-value prospects to a Mattermost alert channel while adding all leads to Trello for further handling. It centralizes lead intelligence and streamlines sales team triageβ€”no manual spreadsheet work required.

Pre-conditions/Requirements

Prerequisites

Required Credentials

Specific Setup Requirements

VariablePurposeExample Value
MM_CHANNEL_IDMattermost channel to post high-score leadsleads-alerts
TRELLO_BOARD_IDBoard where new cards are added62f1d…
TRELLO_LIST_ID_HOTTrello list for hot leadsHot Deals
TRELLO_LIST_ID_BACKLOGTrello list for all other leadsNew Leads
LEAD_SCORE_THRESHOLDScore above which a lead is considered hot70

How it works

This workflow grabs new leads at a defined interval, enriches each lead with external data, computes a custom score, and routes the lead: high-scorers trigger a Mattermost alert and are placed in a β€œHot Deals” list, while the rest are stored in a β€œBacklog” list on Trello. All actions are fully automated and run unattended once configured.

Key Steps:

Set up steps

Setup Time: 10–15 minutes

  1. Import the Workflow: Download the JSON template and import it into n8n.
  2. Create / Select Credentials:
    • Add your Trello API key & token under Trello API credentials.
    • Add your Mattermost personal access token under Mattermost API credentials.
  3. Configure Environment Variables: Set MM_CHANNEL_ID, TRELLO_BOARD_ID, TRELLO_LIST_ID_HOT, TRELLO_LIST_ID_BACKLOG, and LEAD_SCORE_THRESHOLD in n8n β†’ Settings β†’ Environment.
  4. Form Backend Endpoint: Update the first HTTP Request node with the correct URL and authentication for your form or CRM.
  5. (Optional) Enrichment Provider: Replace the sample enrichment HTTP Request with your chosen provider’s endpoint and credentials.
  6. Test Run: Execute the workflow manually with a sample payload to ensure Trello cards and Mattermost messages are produced.
  7. Activate: Enable the workflow; it will now run on the defined schedule.

Node Descriptions

Core Workflow Nodes:

Data Flow:

  1. Schedule Trigger β†’ HTTP Request (Fetch Leads) β†’ SplitInBatches
  2. β†’ HTTP Request (Enrich Lead) β†’ Code (Calculate Score) β†’ IF
  3. IF (Yes) β†’ Mattermost β†’ Trello (Hot List)
  4. IF (No) β†’ Trello (Backlog)
  5. Both branches β†’ Merge (Flag Processed)

Customization Examples

Adjust Scoring Weights

// Code node: adjust weights to change scoring logic
const weights = {
  industry: 15,
  companySize: 25,
  jobTitle: 20,
  intentSignals: 40
};

Dynamic Trello List Mapping

// Use a Lookup table instead of IF node
const mapping = {
  hot: 'TRELLO_LIST_ID_HOT',
  cold: 'TRELLO_LIST_ID_BACKLOG'
};
items[0].json.listId = mapping[items[0].json.segment];
return items;

Data Output Format

The workflow outputs structured JSON data:

{
  "leadId": "12345",
  "email": "jane.doe@example.com",
  "score": 82,
  "priority": "hot",
  "trelloCardUrl": "https://trello.com/c/abc123",
  "mattermostPostId": "78yzk9n8ppgkkp"
}

Troubleshooting

Common Issues

  1. Trello authentication fails – Ensure the token has write access and that the API key & token pair belong to the same Trello account.
  2. Mattermost message not sent – Confirm the token can post in the target channel and that MM_CHANNEL_ID is correct.

Performance Tips

Pro Tips:

πŸ”— Nodes Used

HTTP Request, Trello, Mattermost, Schedule Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup