Back to Blog

Try n8n free for 10 days

After trial, plans start from $7/mo. No charge until day 11.

n8nmarketing automationlead scoringhubspotmailchimp

n8n for Marketing Automation: Build a Lead Scoring Workflow in 30 Minutes

n8nautomation TeamJune 20, 2026

n8n marketing automation workflows give marketing teams the ability to connect their entire tech stack without paying per-workflow or per-execution fees. Unlike Zapier or Make, n8n runs on your own instance — which means you control the schedule, the data flow, and the cost. Whether you're scoring leads in HubSpot, syncing segments to Mailchimp, or publishing content across social channels, a single n8n workflow can replace a dozen manual processes. In this tutorial, you'll build a real lead scoring workflow from scratch in under 30 minutes, then extend it into a full nurturing pipeline.

Why n8n Works Better for Marketing Automation Than Traditional Tools

Most marketing automation platforms charge by contact volume or workflow complexity. HubSpot's Marketing Hub starts at $50/month for basic automation and jumps quickly. Mailchimp's Premium plan costs $350/month. These tools also limit how many steps you can chain together before they ask for an upgrade.

n8n flips that model. You get the same 400+ integrations — including HubSpot, Mailchimp, Google Analytics, WordPress, LinkedIn, and Meta Ads — but you run everything on a managed instance starting at $7/month. No execution limits. No per-contact surcharges. No hidden tiers.

Marketing teams specifically benefit from n8n's architecture because:

  • Unlimited workflows — build separate automations for lead scoring, email nurturing, social posting, and ad management without paying per workflow.
  • Full data control — data never leaves your n8n instance unless you explicitly send it to an external API. No vendor lock-in.
  • Community nodes — access to 400+ community-built nodes means you can integrate tools like Clay, Apollo.io, and Hunter.io that enterprise platforms often skip.
  • Custom logic with Code nodes — write JavaScript or Python to transform data between marketing tools when native mapping isn't enough.

Tip: If you're already running n8n on a managed instance like n8nautomation.cloud, you can skip the DevOps overhead entirely — the instance comes pre-configured with automatic backups, SSL, and 24/7 uptime. Focus on building workflows, not maintaining servers.

Building a Lead Scoring Workflow with HubSpot and the Code Node

Lead scoring is the backbone of any serious n8n marketing automation setup. Instead of manually reviewing every new contact, you assign point values based on behavior — email opens, page visits, form submissions — and route high-scoring leads to sales automatically.

Here's how to build a lead scoring workflow in n8n that pulls contacts from HubSpot, scores them using custom logic, and updates the lead status.

  1. Add a HubSpot Trigger node.
    • Select the Contact Created event as the trigger.
    • Authenticate with your HubSpot account using an API key or OAuth.
    • Set the polling interval — every 15 minutes works well for most marketing teams.
  2. Add an HTTP Request node to fetch engagement data.
    • Use the HubSpot Contacts API endpoint: GET /crm/v3/objects/contacts/{contactId}.
    • Include query parameters for properties: email, last_visit_date, page_views_count, form_submissions_count.
    • This returns the behavioral data you'll need for scoring.
  3. Add a Code node for the scoring logic.
    • Paste the following JavaScript to calculate a raw score:
const contact = $input.first().json;
let score = 0;

// Base score for having a valid email
if (contact.properties.email) score += 10;

// Page view scoring
const pageViews = parseInt(contact.properties.page_views_count) || 0;
if (pageViews > 10) score += 25;
else if (pageViews > 5) score += 15;
else if (pageViews > 0) score += 5;

// Form submission scoring
const formSubs = parseInt(contact.properties.form_submissions_count) || 0;
if (formSubs > 2) score += 30;
else if (formSubs > 0) score += 15;

// Recency scoring
const lastVisit = new Date(contact.properties.last_visit_date);
const daysSinceVisit = Math.floor((Date.now() - lastVisit) / 86400000);
if (daysSinceVisit < 7) score += 20;
else if (daysSinceVisit < 30) score += 10;

return [{ score: score, lead_tier: score >= 60 ? 'hot' : score >= 30 ? 'warm' : 'cold' }];
  1. Add an IF node to route based on score tier.
    • Set Condition 1: score >= 60 → route to a Slack notification node to alert the sales team.
    • Set Condition 2: score >= 30 → route to a Mailchimp node to add the contact to a "warm leads" nurture sequence.
    • Default branch: do nothing or log to a Google Sheet for manual review.
  2. Add a HubSpot Update node to tag the contact.
    • Connect this to both the hot and warm branches.
    • Set the lead_score custom property to the calculated score.
    • Set the lead_tier property to hot, warm, or cold.
    • This keeps your CRM in sync with the scoring model.

That's it. The workflow runs on your chosen schedule, scores every new contact automatically, and updates HubSpot without any manual intervention. From here, you can extend it to trigger email sequences, create deals, or push data into a BI dashboard.

Connecting Mailchimp for Automated Lead Nurture Sequences

Once leads are scored, the next step in any n8n marketing automation strategy is nurturing. Instead of manually exporting CSV files from HubSpot and importing them into Mailchimp, you can automate the entire sync with three nodes.

  1. Add a Mailchimp node to the "warm" branch of your IF node.
    • Select operation: Add Member to List.
    • Choose the target audience list (e.g., "Nurture Sequence — Warm Leads").
    • Map the contact email, first name, and last name from the HubSpot trigger data.
  2. Add a Mailchimp Tag node.
    • Tag the new member with warm-lead-n8n so you can filter reports later.
    • Mailchimp's tag system lets you segment by source, score tier, or campaign engagement.
  3. Add a Wait node between email sends.
    • Set a 3-day wait duration between sequence steps.
    • Use Mailchimp's automation builder for the actual email content — n8n handles the enrollment cadence.
  4. Add a second Mailchimp node for hot leads.
    • Hot leads (score >= 60) bypass the nurture sequence entirely.
    • Instead, add them to a "Hot Lead Alert" list that triggers an immediate SMS or Slack notification to the sales team.
Note: Mailchimp's API has rate limits based on your plan. If you're syncing thousands of contacts per day, add a Split In Batches node to process contacts in groups of 100 with a 1-second delay between batches. This prevents API 429 errors without slowing down the overall workflow.

Automating Social Media Content Publishing with n8n

Marketing teams spend an average of six hours per week scheduling social media posts. With n8n marketing automation, you can reduce that to zero by building a content publishing pipeline that pulls from a Google Sheet or RSS feed and posts across LinkedIn, Twitter/X, and Facebook simultaneously.

Here's a practical workflow structure:

  1. Add a Google Sheets trigger node.
    • Watch a sheet named "Social Content Calendar" with columns: Date, Platform, Content, Image URL, Hashtags.
    • Set the trigger to fire every hour and check for rows where the Date matches today and Status is "Draft".
  2. Add an IF node to determine the target platform.
    • Check the Platform column value: LinkedIn, Twitter, or Facebook.
    • Route each row to the appropriate API node.
  3. Add LinkedIn, Twitter/X, and Facebook nodes on separate branches.
    • LinkedIn: Use the LinkedIn node with the Create Post operation. Include the content and image URL. LinkedIn requires OAuth — set up your LinkedIn Developer App and authorize the w_organization_social scope.
    • Twitter/X: Use the Twitter node with Create Tweet. Keep content under 280 characters or use Twitter's API v2 for longer threads.
    • Facebook: Use the Facebook Graph API via the HTTP Request node. POST to /{page-id}/feed with the message and link.
  4. Add an Update Google Sheets node at the end.
    • Change the Status column from "Draft" to "Published" and add a timestamp.
    • This prevents the same post from being scheduled twice.

This workflow handles one post at a time per trigger interval. If you need to publish five posts at 9 AM, add a Split In Batches node before the platform routers with a batch size of 1 and a 30-minute delay between batches. This mimics a natural posting schedule without overwhelming your social accounts' rate limits.

Tracking Campaign Performance with Google Sheets and Google Analytics

Automation without measurement is guesswork. n8n's Google Analytics node lets you pull campaign performance data on a schedule and log it to a Google Sheet for reporting.

  1. Add a Schedule Trigger node.
    • Set it to run every Monday at 8:00 AM for a weekly digest.
  2. Add a Google Analytics node.
    • Select the Run Report operation.
    • Set the date range to the previous 7 days.
    • Request dimensions: date, source, campaignName.
    • Request metrics: sessions, newUsers, goalCompletionsAll, conversionRate.
  3. Add a Code node to transform the data.
    • GA4 returns data in a nested structure. Flatten it into rows with columns for Date, Source, Campaign, Sessions, New Users, Conversions, and Conversion Rate.
  4. Add a Google Sheets node.
    • Append the transformed rows to a sheet named "Marketing Dashboard."
    • Use the Append or Update operation so previous weeks' data isn't overwritten.

Once the data is in Google Sheets, you can connect it to Looker Studio (formerly Google Data Studio) for a live dashboard — all without touching any code beyond the flattening logic in the Code node.

Why Marketing Teams Run n8n on Managed Instances

Building n8n marketing automation workflows is one thing. Keeping them running reliably is another. Marketing operations depend on uptime — a missed lead score or a failed nurture email can cost real pipeline.

Self-hosting n8n requires managing a server, installing updates, monitoring memory usage, and handling SSL certificate renewals. For a marketing team without dedicated DevOps, that's a distraction from what actually matters: building campaigns and analyzing results.

Managed hosting solves this. Providers like n8nautomation.cloud give you a dedicated n8n instance with automatic backups, SSL, and 24/7 monitoring — starting at $7/month. You get your own subdomain (yourname.n8nautomation.cloud), instant setup, and the full Community Edition with all 400+ nodes enabled. No execution limits, no workflow caps, no surprise overage charges at the end of the month.

For marketing teams running lead scoring, email nurture, and social publishing workflows — workflows that touch customer data and need to stay online 24/7 — the cost of self-hosting downtime almost always exceeds the cost of a managed instance.

Extending Your Marketing Stack with Community Nodes

The n8n marketing automation ecosystem extends far beyond the built-in nodes. The community has built nodes for tools that enterprise platforms rarely support. Some of the most useful for marketing teams include:

  • Clay — enrich contact data from multiple data providers inside a single workflow.
  • Apollo.io — pull lead lists, verify emails, and score prospects directly from n8n.
  • Hunter.io — find and verify email addresses associated with specific domains.
  • SerpAPI / Google Search — scrape search result positions to track keyword rankings weekly.
  • Meta Ads — pull ad performance data and feed it into your reporting sheet alongside Google Analytics data.
  • WordPress — publish blog posts automatically from a CMS draft or AI-generated content pipeline.

To install a community node in n8n, go to Settings → Community Nodes, paste the npm package name (e.g., n8n-nodes-clay), and click Install. The node appears in your node panel immediately. No restart required.

Tip: Community nodes are maintained by contributors, not the core n8n team. Before installing one, check its npm page for download count, last update date, and open issues. Nodes with 1,000+ weekly downloads and monthly updates are generally safe for production marketing workflows.

With 400+ community nodes available, your n8n marketing automation stack can include tools that would otherwise require separate Zapier subscriptions or custom API integrations. Each node adds another data source or destination without increasing your monthly bill.

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.