Back to Library
Tech Deep DiveEngineering

Lead Scoring Automation with n8n, Brevo & HeyReach (Free Multi-Channel Template)

Alfaz Mahmud Rizve
Alfaz Mahmud Rizve
@whoisalfaz
March 4, 2026
12 min read
Lead Scoring Automation: Auto-tag Leads in Brevo & Trigger LinkedIn Outreach via HeyReach (Intent, Source, Language) – 30 Days of n8n & Automation – Day 9

This technical breakdown contains affiliate links. If you deploy this stack using my links, I earn a commission at no extra cost to you.

If your lead capture system dumps every incoming prospect into a single, unsegmented list, you are burying your highest-value opportunities under a mountain of unqualified noise.

When B2B buyers request an enterprise demo, they expect to be treated like a priority. If they are thrown into the exact same automated email nurture sequence as a college student signing up for a free newsletter, you will lose the enterprise deal before the first call is ever booked. To scale a SaaS or high-ticket agency, your sales team must know exactly who to call within the first 60 seconds of a form submission.

This requires lead scoring automation. And today, we are going further than just CRM tagging.

In Day 9 of our 30 Days of n8n & Automation sprint, we are upgrading the basic webhook capture engine we built in Day 8. We are going to deploy an autonomous triage system that acts as a gatekeeper. By leveraging n8n and the Brevo (formerly Sendinblue) API, we will evaluate every incoming Elementor lead, parse their form answers, and dynamically assign hyper-specific tags (Intent, Source, and Language) before routing them to your CRM. Then, for your highest-value prospects — the ones arriving from LinkedIn or requesting an enterprise demo — we will automatically trigger a personalized LinkedIn connection request via HeyReach, closing the loop with zero-touch, multi-channel engagement.

I deploy this exact architectural pattern across agency clients handling 300+ daily leads. By eliminating manual sorting, this workflow reclaims hours of administrative time and routinely drives a 35% increase in campaign open rates by ensuring hyper-relevant email routing — and the LinkedIn outreach layer consistently doubles the speed-to-first-meeting.


The Architectural Mandate: Why Segment Before You Store?

At whoisalfaz.me, I consistently see sales teams wasting up to 3 hours a day manually reviewing new form submissions, attempting to guess which leads are actually ready to buy.

When you introduce lead scoring automation, you move the friction from human operations to server execution. By analyzing the JSON payload the millisecond it hits your n8n Cloud instance, the system can instantly classify the prospect:

Intent Tracking: Did they select "Enterprise Demo," "Free Trial," or "Newsletter"? A "Demo" intent triggers a hot-lead-demo tag, instantly routing the data to an Account Executive.

Source Tracking: Did the lead arrive organically via Google, or did they convert from an expensive LinkedIn Ads campaign? Tagging linkedin-paid allows you to directly track the ROI of your ad spend in your CRM.

Language Localization: If a prospect selects Spanish ("es") as their preference, tagging spanish-lead guarantees they are never pushed into an English-only B2B sequence.

LinkedIn Outreach (New): If a prospect came from LinkedIn or requested a demo, the workflow automatically pushes their LinkedIn URL into a targeted HeyReach campaign — triggering a personalized connection request within minutes of form submission, before any competitor even reads the email notification.

This is not theory. This is enterprise-grade RevOps routing that ties directly back to the data integrity principles we established in Day 7: n8n Debugging & Error Handling.


Infrastructure Prerequisites: The 7-Minute Setup

Before we construct the logic gates, ensure your environment is fully prepared. Missing these credentials will result in 401 Unauthorized errors.

Your Orchestrator: An active n8n instance (Cloud or a self-hosted Vultr VPS).

The Email Engine: A live Brevo account. You must generate a Brevo v3 API Key (located under Account > SMTP & API).

The LinkedIn Outreach Engine: A live HeyReach account. Generate a HeyReach API key from your dashboard settings. Pre-create a campaign named something like "High-Intent Inbound — Auto" so you have a Campaign ID ready.

The Data Payload: An active WordPress Elementor form with specific dropdown fields structured to capture email, intent, source, language, and critically — a new LinkedIn Profile URL text field mapped to the key linkedin_url. This field is the fuel that powers Phase 6.

Brevo Taxonomy: You must pre-create the exact tags (e.g., hot-lead-demo, paid-social, spanish-lead) within the Brevo UI (Contacts > Settings > Tags) before n8n attempts to apply them, or the API will reject the payload.

n8n Brevo setup for lead scoring automation by Alfaz Mahmud Rizve, prerequisites checklist visual for SaaS/agencies at whoisalfaz.me.Click to expand


Phase 1: The Webhook Gatekeeper

We begin by establishing the connection between your frontend form and your backend automation server.

Deploy the Webhook: Add a Webhook node to your n8n canvas. Set the HTTP Method to POST.

The Handshake: Copy the Test Webhook URL and paste it into the "Actions After Submit > Webhook" settings of your Elementor form.

Execute the Test: Submit a test lead through your live form (e.g., Email: [email protected], Intent: demo, Source: linkedin, Language: es, LinkedIn URL: https://linkedin.com/in/test-lead).

Validate the JSON: Verify that the Webhook node successfully catches the payload and that all variables — including linkedin_url — are correctly formatted in the n8n execution log.


Phase 2: Multi-Dimensional IF Routing

Do not rely on a single, massive IF node to handle complex logic. If one condition fails, the entire workflow crashes. Professional lead scoring automation utilizes parallel IF branches to evaluate different data points independently.

We will use the concepts we mastered in Day 6: Essential n8n Core Nodes to build our logic gates.

Gate 1: Intent Scoring
Add an IF node connected to the Webhook.

  • Condition A (True): If {{ $json.body.intent }} exactly matches demo.
  • Action: Route to a Set node that defines tags = ["hot-lead-demo"].
  • Condition B (False/Fallback): If {{ $json.body.intent }} equals trial.
  • Action: Route to a Set node that defines tags = ["warm-lead-trial"].

Gate 2: Source Tracking
Branch another IF node parallel to the first.

  • Condition: If {{ $json.body.source }} exactly matches linkedin.
  • Action: Set tags = ["paid-social"].

Gate 3: Language Localization
Branch a third IF node.

  • Condition: If {{ $json.body.language }} exactly matches es.
  • Action: Set tags = ["spanish-lead"].

Phase 3: The Dynamic Tag Builder (Code Node)

While visual IF nodes are great for simple true/false routing, merging three parallel arrays back into a single, clean payload requires deep data manipulation. We will use the Code node to dynamically construct a single array of tags that the Brevo API can ingest perfectly.

Add a Code node and merge the outputs of your parallel Set nodes into it. Execute the following JavaScript to compile the final tags based on the raw Webhook input:

JSON Payload
// Dynamic Tag Compiler for Brevo Lead Scoring
// Authored by Alfaz Mahmud Rizve

const input = $input.all();
const tags = [];

input.forEach(item => {
  // Evaluate Intent
  if (item.json.body.intent === 'demo') tags.push('hot-lead-demo');
  if (item.json.body.intent === 'trial') tags.push('warm-lead-trial');
  
  // Evaluate Source
  if (item.json.body.source === 'linkedin') tags.push('paid-social');
  
  // Evaluate Language
  if (item.json.body.language === 'es') tags.push('spanish-lead');
});

// Return the compiled array alongside the raw email and LinkedIn URL
return [{ json: { 
  email: $json.body.email, 
  attributes: $json.body, 
  linkedin_url: $json.body.linkedin_url || null,
  final_tags: tags.filter(Boolean) // Filter removes any null/empty values
}}];

If your test lead submitted "demo", "linkedin", and "es", the Code node will output a clean array: ["hot-lead-demo", "paid-social", "spanish-lead"]. This array is infinitely scalable; you can add 10 more criteria to the JavaScript without ever cluttering your visual canvas. Notice we are also passing through linkedin_url — this is the critical handoff data that Phase 6 will consume.

n8n lead scoring automation workflow with IF nodes and Code tag builder by Alfaz Mahmud Rizve for Brevo segmentation at whoisalfaz.me.Click to expand


Phase 4: API Execution via the Brevo Node

We now have a cleanly formatted data object. The final step is to push this data to Brevo and force the platform to update the contact record.

1
Add the native Brevo node to the canvas.
2
Authenticate using the API key you generated earlier.
3
Resource: Set to Contact.
4
Operation: Set to Create or Update. (Using "Create or Update" acts as an idempotent upsert. If the email already exists in your database, it will simply append the new tags without duplicating the contact).
5
Email: Map to your Code node output: {{ $json.email }}.
6
Attributes: Map the raw form data: {{ $json.attributes }}.
7
Tags: Map your compiled array: {{ $json.final_tags }}.

Execute the node. Log into your Brevo dashboard, navigate to Contacts, and verify that the test email has successfully appeared with all three tags applied.


Phase 5: Defensive Engineering (Production Retry Logic)

If you have been following the 30 Days of n8n series, you know that relying on an API to work 100% of the time is a strategy based on hope. If the Brevo API rate-limits your server right as a "hot-lead-demo" is submitted, the node will fail, and the tags will be lost.

We must implement the try-catch architectural pattern discussed in Day 7.

Exponential Backoff: Open the settings of the Brevo node. Toggle on Retry on Fail. Configure it for 3 maximum retries with a 1000ms delay.

Raw HTTP Fallback: If the native Brevo node experiences a hard failure, advanced architects use a secondary HTTP Request node to ping the Brevo API directly as a failsafe:

JSON Payload
// Fallback HTTP Request Payload for Brevo v3 API
const response = await $http.request({
  method: 'POST',
  url: 'https://api.brevo.com/v3/contacts',
  headers: { 'api-key': $secrets.brevo_api_key },
  body: $json
});

n8n Brevo lead scoring automation execution with error handling by Alfaz Mahmud Rizve for agencies/SaaS at whoisalfaz.meClick to expand


Phase 6: Autonomous LinkedIn Outreach via HeyReach

This is where the workflow evolves from a CRM tagging engine into a full multi-channel revenue system. Email is powerful, but the average B2B decision-maker receives 120 emails a day. A timely, personalized LinkedIn connection request from a real account? That cuts through.

The logic is precise: if a prospect arrived from LinkedIn (paid-social tag) or requested an enterprise demo (hot-lead-demo tag), they have demonstrated they are platform-active and high-intent. These are exactly the prospects worth reaching out to on LinkedIn within 5 minutes of form submission — before any competitor does.

Step 1: The Qualifying IF Node
Add an IF node immediately after the Brevo node succeeds. This node has a single job: determine whether this specific lead warrants LinkedIn outreach.

  • Condition A: {{ $json.final_tags.includes('hot-lead-demo') }} equals true
  • OR Condition B: {{ $json.final_tags.includes('paid-social') }} equals true

Only leads that pass this gate proceed to HeyReach. Low-intent newsletter signups never touch your LinkedIn automation quota.

Step 2: The Guard Clause
Before calling the HeyReach API, add a second IF node to verify the linkedin_url field is not empty. An HTTP request with a null LinkedIn URL will cause a hard API error.

  • Condition: {{ $json.linkedin_url }} is not empty.

If the field is empty, route to a Slack or email notification node to alert your sales rep to manually source the LinkedIn URL. Never let a hot lead fall through.

Step 3: The HeyReach API Call
Add an HTTP Request node after the guard clause. Configure it as follows:

  • Method: POST
  • URL: https://api.heyreach.io/api/public/campaign/AddLeadsToCampaign
  • Authentication: Header Auth — add X-API-KEY with your HeyReach API key stored as an n8n credential.
  • Body (JSON):
JSON Payload
{
  "campaignId": "YOUR_HEYREACH_CAMPAIGN_ID",
  "leadsToAdd": [
    {
      "lead": {
        "profileUrl": "{{ $json.linkedin_url }}",
        "firstName": "{{ $json.attributes.first_name }}",
        "lastName": "{{ $json.attributes.last_name }}"
      }
    }
  ]
}

Replace YOUR_HEYREACH_CAMPAIGN_ID with the ID of your pre-created "High-Intent Inbound — Auto" campaign from the HeyReach dashboard.

The moment this node executes, HeyReach will queue a personalized LinkedIn connection request to the prospect — sent from your connected LinkedIn account, with the message template you configured in the campaign. The prospect submits a form. Within 5 minutes, they have an email in their inbox and a LinkedIn request from your team. This is what "omnichannel at scale" looks like in practice.

The Full Phase 6 Data Flow:

JSON Payload
Brevo Node (Success)
    └── IF Node: final_tags includes 'hot-lead-demo' OR 'paid-social'?
            ├── TRUE → IF Node: linkedin_url is not empty?
            │               ├── TRUE → HTTP Request → HeyReach API (Add to Campaign)
            │               └── FALSE → Slack Alert: "Hot lead missing LinkedIn URL"
            └── FALSE → (End. Low-intent leads skip LinkedIn outreach entirely)

The ROI of Architectural Rigor

At whoisalfaz.me, I do not build automations simply to save time; I build them to generate revenue. When this exact lead scoring automation was deployed across 7 different agency clients, the operational metrics shifted drastically:

  • Manual Triage Time: Dropped from 2.5 hours daily to 0 minutes.
  • Segmented Open Rates: Increased from an average of 19% to 31% because Spanish-speaking leads were finally receiving Spanish copy, and B2B leads were receiving technical sequences.
  • High-Intent Conversion: Demo booking rates from "hot" leads increased by 32% purely because the Account Executives were notified instantly via the hot-lead-demo tag, dropping speed-to-lead to under 60 seconds.
  • Multi-Channel Close Rate: Adding the HeyReach LinkedIn outreach layer to the top of the funnel resulted in a further 2x increase in speed-to-first-meeting. When a prospect receives a professional email AND a LinkedIn connection request within 5 minutes of expressing intent, the psychological effect of omnipresence is undeniable.

The Day 9 Deployment Mandate

You now possess the exact blueprint to transform a chaotic inbound pipeline into a mathematically precise, multi-channel sorting engine.

Do not let your best leads rot in an untagged list.

1
Deploy your webhook. Add the linkedin_url field to your Elementor form.
2
Create your tags in Brevo.
3
Configure your multi-dimensional IF logic.
4
Execute the Code node payload.
5
Deploy Phase 5 retry logic on the Brevo node.
6
Wire Phase 6: Create your HeyReach campaign, set the API key in n8n credentials, and connect the HTTP Request node.

If your agency infrastructure is struggling to scale, stop throwing more SDRs at the problem. Fix the data routing — then let HeyReach and Brevo do the outreach while you sleep.

Subscribe to the newsletter to follow the rest of the 30 Days of n8n & Automation sprint. Tomorrow, for Day 10, we are taking these newly tagged leads and building out the actual automated email sequences that convert them.

In this Article

Ready to automate your agency?

Skip the manual grunt work. Let's build a custom system that runs your business on autopilot 24/7.