Automationn8nCRMHubSpotPipedriveSales Ops

How to Automate Your CRM with n8n: Practical Guide (Lead Scoring, Follow-ups, Reporting)

Adrijan Omičević··12 min read
Share

# What You'll Build (and Why It Matters)#

This guide shows a practical approach to CRM automation n8n for HubSpot or Pipedrive: lead scoring, automated follow-ups, and lightweight reporting. The goal is simple—reduce manual CRM admin while improving speed-to-lead and consistency.

Responding quickly matters. Harvard Business Review’s often-cited analysis found that companies responding to leads within 1 hour are far more likely to qualify them than those responding later (and the drop-off worsens after a few hours). Automation is the cheapest way to get “fast response” without hiring more headcount.

If you’re unsure whether you’re ready, check 5 signs your business needs automation. If you want help scoping or implementing this end-to-end, see our automation services.

# Prerequisites#

RequirementRecommendedNotes
n8nLatest stableCloud or self-hosted; self-host for maximum control
HubSpot or Pipedrive accountAdmin accessNeeded for API tokens/apps and custom fields
Email providerSMTP / SendGrid / GmailFor follow-ups; or use CRM email sequences
Slack or Teams (optional)For instant sales notifications
Basic CRM hygieneUnique IDs + required fieldsEmail as unique identifier is typical

Data model you should add to your CRM#

Create (or confirm) these properties/fields. This prevents “automation spaghetti” and makes reporting reliable.

FieldTypeExampleUsed for
lead_scorenumber0–100Routing, prioritization
lead_gradedropdownA / B / CHuman-friendly scoring
automation_statusdropdownnew / scored / contacted / nurturedIdempotency + visibility
last_automated_atdatetime2026-03-05T12:30ZDebugging + reporting
next_followup_atdatetime2026-03-06T09:00ZDelays/scheduling
source_detailtext“Pricing page form”Attribution

💡 Tip: Keep scoring fields on the Contact/Person record, and “follow-up task fields” on the Deal where possible. Sales teams live in deals; marketing signals live on contacts.

# Architecture: 3 Workflows That Cover 80% of CRM Automation#

You’ll implement three workflows in n8n:

WorkflowTriggerOutcome
1) Lead intake + scoringWebhook / CRM eventEnrich + score + update CRM
2) Follow-ups + task creation“Scored lead” stateCreate tasks, send email/Slack, schedule next step
3) Reporting digestCronDaily/weekly metrics pushed to Slack/email

This separation matters because it keeps each workflow small, testable, and easier to modify without breaking everything.

# Step 1: Connect HubSpot or Pipedrive to n8n (Securely)#

HubSpot connection options#

Best option: HubSpot Private App token (simple + secure for server-to-server automation). Create a Private App in HubSpot and grant scopes like CRM objects (contacts, companies, deals) and webhook permissions if needed.

Pipedrive connection options#

Use a Pipedrive API token or OAuth app (OAuth is better when you deploy for multiple clients). You’ll typically need scopes for persons, organizations, deals, activities.

SecretWhere to storeWhy
HubSpot private app tokenn8n credentialsKeeps tokens out of nodes
Pipedrive API tokenn8n credentialsEasy rotation
Enrichment API keys (Clearbit, etc.)n8n credentials + env varsAvoid leaking in exports
SMTP/SendGrid keysn8n credentialsEmail reliability

⚠️ Warning: Don’t paste API keys into Function node code or HTTP node headers directly. When workflows get duplicated/exported, keys leak into version control or tickets.

# Step 2: Workflow 1 — Lead Intake + Lead Scoring (HubSpot/Pipedrive)#

What this workflow does#

  1. 1
    Receives a new lead event (form submit, inbound email, chat lead, etc.).
  2. 2
    Enriches the lead (optional but powerful).
  3. 3
    Calculates a lead score (0–100) based on rules.
  4. 4
    Updates CRM properties and sets automation_status = scored.
  5. 5
    Notifies sales if score is above a threshold.

Trigger options (choose one)#

TriggerProsConsWhen to use
Webhook from website/formReal-time, cheapNeeds dev work to send payloadCustom site, Next.js forms
HubSpot webhookNative eventsSetup requires app configHubSpot-first stack
Pipedrive webhookNative eventsSetup + filteringPipedrive-first stack
Polling (Cron + “Get new”)SimpleNot real-timeLow volume, MVP

Example payload (from your website form)#

Keep it consistent and include a stable dedupe key (email).

JSON
{
  "email": "maria@acme.com",
  "firstName": "Maria",
  "lastName": "Kovac",
  "company": "ACME",
  "role": "Head of Operations",
  "source": "pricing_form",
  "utm_source": "google",
  "utm_campaign": "crm_automation",
  "page": "/pricing",
  "message": "Need HubSpot + n8n automation"
}

Scoring model (simple, effective, adjustable)#

Start with explicit scoring (firmographics + intent). You can improve later with historical conversion data.

SignalRulePoints
Role seniority“Head/Director/VP/C-level” in role+15
Company size11–50 = +10, 51–200 = +15, 200+ = +20+10 to +20
Source intentPricing page / demo request+20
Email domainFree email provider (gmail/yahoo)-15
Message contains“integration”, “automation”, “API”, “n8n”+10
GeographyEU/UK/US (if you sell there)+5

n8n node outline (HubSpot example)#

Use these nodes in order:

  1. 1
    Webhook (lead intake)
  2. 2
    Set (normalize fields)
  3. 3
    HubSpot → Search contact by email
  4. 4
    HubSpot → Create/Update contact (upsert)
  5. 5
    Function (calculate score)
  6. 6
    HubSpot → Update contact properties (lead_score, lead_grade, automation_status)
  7. 7
    IF (score >= threshold)
  8. 8
    Slack (notify) or HubSpot (create task)

Lead scoring Function node (copy-paste starter)

Keep this under 20 lines and treat it as a baseline.

JavaScript
const lead = $json;
 
let score = 0;
const role = (lead.role || '').toLowerCase();
const page = (lead.page || '').toLowerCase();
const email = (lead.email || '').toLowerCase();
const msg = (lead.message || '').toLowerCase();
 
if (/(head|director|vp|chief|cto|ceo|cfo|coo)/.test(role)) score += 15;
if (page.includes('pricing') || msg.includes('demo')) score += 20;
if (/(automation|integration|api|n8n)/.test(msg)) score += 10;
if (/@(gmail|yahoo|outlook)\./.test(email)) score -= 15;
 
score = Math.max(0, Math.min(100, score));
const grade = score >= 70 ? 'A' : score >= 40 ? 'B' : 'C';
 
return [{ ...lead, lead_score: score, lead_grade: grade }];

Pipedrive variant (what changes)#

The logic stays the same; only the nodes differ:

  • Search Person by email
  • Upsert Person
  • Update custom fields (you must create fields and map their IDs)
  • Optionally create a Deal and an Activity (task)

ℹ️ Note: Pipedrive custom fields often require referencing field IDs (e.g., custom_field_hash). Document these in a table in your project README to avoid breaking changes when fields are renamed.

# Step 3: Workflow 2 — Automated Follow-ups (Tasks, Email, and SLA Control)#

Why follow-ups should be automated#

Most teams don’t lose deals because their product is weak—they lose them because follow-up is inconsistent. Automation enforces a service-level agreement (SLA): “Every A lead gets touched within 15 minutes; every B lead within 4 hours.”

Follow-up strategy (practical defaults)#

Lead gradeResponse time targetActionOwner
A (70–100)15 minSlack alert + task + emailAssigned sales rep
B (40–69)4 hoursTask + email (optional)Round-robin
C (0–39)24 hoursAdd to nurture / newsletterMarketing

Node outline (works for HubSpot or Pipedrive)#

  1. 1
    Trigger: CRM event (“contact updated” where automation_status = scored) or a Cron that searches for automation_status = scored AND lead_score >= X.
  2. 2
    IF: Grade A/B/C
  3. 3
    Assign owner: round-robin via n8n Data Store / Google Sheet / simple static mapping
  4. 4
    Create task/activity in CRM
  5. 5
    Send email (optional) with a personalized template
  6. 6
    Update CRM: automation_status = contacted, next_followup_at, last_automated_at

Round-robin assignment (simple, reliable)#

If you don’t have a router already, use an n8n Data Store key like rr_index.

Sales repCRM owner IDWeight
Ana1048391
Marko2041281
Ivana9981231

Increment rr_index each run and pick index % reps.length. Keep it deterministic so you can debug assignments.

Example: create a HubSpot task with an SLA#

In HubSpot, tasks are typically Engagements. Use the HubSpot node to create a task associated with the contact/deal.

JSON
{
  "subject": "Follow up with {{firstName}} (Lead grade {{lead_grade}})",
  "body": "Source: {{source_detail}}\nMessage: {{message}}\nLead score: {{lead_score}}",
  "dueDate": "{{ $now.plus({ minutes: lead_grade === 'A' ? 15 : 240 }).toISO() }}"
}

Example: send an immediate email for Grade A leads#

Use an email node (SMTP/SendGrid). Keep it short and contextual.

Text
Subject: Quick question about your CRM automation
 
Hi {{firstName}},
I saw your request about {{source_detail}}. Are you using HubSpot or Pipedrive today, and what’s the #1 workflow you want to automate first (scoring, follow-ups, reporting)?
— {{ownerName}}

💡 Tip: If compliance is a concern (GDPR/opt-in), don’t send automated sales emails to cold leads. Instead, create tasks and notify reps, or use CRM’s built-in consent-aware sequences.

# Step 4: Workflow 3 — Reporting Digest (Daily/Weekly, No BI Required)#

What to report (metrics that change behavior)#

Avoid vanity metrics. Track numbers that improve pipeline quality and response speed.

MetricHow to computeWhy it matters
New leadsCount created in last 24hVolume trend
A/B/C distributionGroup by lead_gradeLead quality
Speed-to-leadfirst_contacted_at - created_atConversion lever
Task completion rateCompleted tasks / created tasksFollow-through
Source performanceLeads by source_detail + gradeBudget allocation

Node outline#

  1. 1
    Cron (every weekday 08:00)
  2. 2
    HubSpot/Pipedrive search: leads created yesterday
  3. 3
    Aggregate: totals, grade distribution
  4. 4
    Format: Markdown message
  5. 5
    Slack or Email
  6. 6
    (Optional) Google Sheets append row for historical trend

Slack digest message (example)#

Text
Daily CRM Digest ({{date}})
 
New leads: 34
Grade A: 6 | Grade B: 14 | Grade C: 14
Median speed-to-lead: 42 min (target: < 60 min)
 
Top sources:
- pricing_form: 12 (A: 4)
- webinar_signup: 9 (A: 1)
- contact_page: 7 (A: 0)

🎯 Key Takeaway: A daily digest only works if it includes one metric the team is accountable for (usually speed-to-lead). Everything else is supporting context.

# Implementation Details That Prevent Pain Later#

1) Idempotency and deduplication#

Automation fails silently when you create duplicates and everyone stops trusting the CRM. Apply these rules:

ObjectDedupe keyAction
Contact/PersonemailSearch → update; create only if missing
Company/OrgdomainSearch by domain; create if missing
Dealcontact ID + pipeline stage + monthAvoid creating multiple “same” deals
Task/Activitycontact ID + type + dateDon’t spam tasks on retries

2) Retries, rate limits, and backoff#

HubSpot and Pipedrive both enforce API limits. n8n supports retries, but you should still:

  • Add a short Wait node after bursts (e.g., 200ms–500ms).
  • Use batch processing for reporting.
  • Handle 429 responses (too many requests) with retry/backoff.

3) Logging you can actually use#

At minimum, write a log line back into the CRM:

Log fieldExampleWhy
last_automated_attimestampWhen did automation run?
automation_statusscored/contacted/nurturedWhat stage is automation at?
automation_notes“Scored A, notified #sales”Quick audit trail

If you need deeper visibility, push logs to a database or a Google Sheet. For higher-scale ops, consider a proper log sink.

# Common Pitfalls (and How to Avoid Them)#

  1. 1
    Scoring becomes a “black box” — Keep the scoring rules documented in a table and store the reasons (e.g., score_breakdown) if sales challenges it.
  2. 2
    No owner assignment — Leads without an owner don’t get worked. Implement round-robin or deterministic mapping from day one.
  3. 3
    Workflows trigger each other endlessly — Use automation_status to prevent loops (e.g., only score when status is new, only follow up when scored).
  4. 4
    You automate email without consent — If opt-in is unclear, automate tasks/notifications instead of outbound email.
  5. 5
    Reporting is disconnected from actions — If the digest doesn’t drive behavior, reduce it to 3–5 metrics and add targets.

# Key Takeaways#

  • Build CRM automation n8n as three separate workflows: intake+scoring, follow-ups, and reporting—this keeps changes safe and fast.
  • Use upsert + dedupe keys (email/domain) to prevent duplicate contacts, deals, and tasks.
  • Start lead scoring with a simple 0–100 rule-based model, then iterate based on conversion outcomes and sales feedback.
  • Enforce speed-to-lead with SLA-driven tasks and alerts (e.g., Grade A within 15 minutes).
  • Make reporting actionable: send a daily digest with grade distribution and speed-to-lead, not vanity metrics.

# Conclusion#

Automating your CRM with n8n is one of the highest-ROI improvements you can make in sales ops: leads get scored consistently, follow-ups happen on time, and reporting becomes automatic instead of a weekly scramble.

If you want Samioda to help you implement a production-ready setup (HubSpot/Pipedrive + n8n + lead scoring + follow-ups + reporting), start here: https://samioda.com/en/automation.

FAQ

Share
A
Adrijan OmičevićSamioda Team
All articles →

Need help with your project?

We build custom solutions using the technologies discussed in this article. Senior team, fixed prices.