n8n HubSpot Integration Tutorial

n8n HubSpot Integration: How I Automated My Entire CRM Workflow

If you run a sales-driven business and you are still manually updating your CRM, I have been exactly where you are. As a startup consultant here in Chile, I was spending two or three hours every day copying data between HubSpot, spreadsheets, and Slack. Deals would fall through the cracks because nobody remembered to follow up. Contact records were outdated because syncing happened “when someone got around to it.”

Then I discovered n8n, and everything changed. In this guide, I will walk you through exactly how I built an n8n HubSpot integration that automated contact syncing, deal tracking, and sales follow-ups. By the end, you will have a working workflow that saves your team hours every single week.

Why Connect n8n with HubSpot?

HubSpot is a powerful CRM, but its native automation has limits. You either hit the ceiling on the free plan or find yourself paying for features that still require manual work. That is where n8n comes in.

With n8n, you can build automations that go far beyond what HubSpot’s built-in workflows offer. Here is what makes the combination so powerful:

No per-task pricing. Unlike Zapier, n8n lets you run unlimited workflows without worrying about execution costs.
Full data control. You can self-host n8n, meaning your CRM data never passes through a third-party cloud you do not control.
Complex logic support. Branching, loops, error handling, and data transformation are all built in.
Deep HubSpot API access. n8n’s HubSpot node supports contacts, companies, deals, tickets, and custom objects.

I covered more about why I chose n8n over other platforms in my full n8n review and my n8n vs Zapier comparison.

What You Will Need

Before we start building, make sure you have these ready:

1. An n8n instance. You can use n8n cloud or self-host it. If you are just getting started, sign up for n8n here to get going quickly. I also have a beginner guide to n8n if this is your first time.
2. A HubSpot account. Free or paid, the API access works on all plans.
3. HubSpot API credentials. You will need either an API key (legacy) or a private app access token.
4. A Google Sheets account (for the spreadsheet logging part of our workflow).
5. A Slack workspace (for team notifications).

Setting Up HubSpot Credentials in n8n

The first step is connecting n8n to your HubSpot account. Here is how to do it:

Step 1: Create a Private App in HubSpot

HubSpot has moved to private app tokens as the preferred authentication method. Log into your HubSpot account and navigate to Settings, then Integrations, then Private Apps.

Click “Create a private app” and give it a descriptive name like “n8n Integration.” Under the Scopes tab, select the permissions you need. For our workflow, you will want:

crm.objects.contacts.read and crm.objects.contacts.write
crm.objects.deals.read and crm.objects.deals.write
crm.objects.companies.read

Click “Create app” and copy the access token that appears.

Step 2: Add Credentials in n8n

Open your n8n instance and go to Credentials. Click “Add Credential” and search for HubSpot. Select “HubSpot API” and paste your access token. Click “Save” and test the connection. You should see a green success message.

Building the Main Workflow: Deal Stage Change Automation

Now let me walk you through the workflow I use every day. This is the one that saved my team from missing follow-ups.

The Workflow Overview

Here is what happens when a deal changes stage in HubSpot:

1. Trigger: HubSpot deal stage changes (detected via polling or webhook).
2. Fetch Details: Pull the full deal and contact data from HubSpot.
3. Update Spreadsheet: Log the stage change to a Google Sheet for reporting.
4. Notify Sales Team: Send a formatted Slack message to the sales channel.
5. Schedule Follow-Up: Create a follow-up task in HubSpot for the deal owner.

Step 1: Set Up the Trigger

Start a new workflow in n8n and add a HubSpot Trigger node. Configure it to watch for deal property changes. Set the property to monitor as dealstage.

If you are self-hosting n8n, you might prefer polling instead of webhooks. Set the polling interval to every 5 minutes. That way you catch stage changes quickly without hammering the API.

Node: HubSpot Trigger
Type: Deal
Event: Property Change
Property: dealstage
Poll Interval: 5 minutes

Step 2: Fetch Full Deal and Contact Details

The trigger gives you basic deal info, but you need more context. Add an HTTP Request node to call the HubSpot API and fetch the full deal record with associations.

URL: https://api.hubapi.com/crm/v3/objects/deals/{{ $json.dealId }}
Method: GET
Query Parameters:
associations: contacts,companies
properties: dealname,amount,dealstage,hubspot_owner_id,closedate
Headers:
Authorization: Bearer YOUR_TOKEN


Then add another HTTP Request node to fetch the associated contact details using the contact ID from the previous response.

Step 3: Transform the Data

Add a Set node to structure the data you need for the next steps. Map fields like deal name, new stage, contact email, deal amount, and owner name into clean variables.

Node: Set
Fields:
dealName: {{ $json.properties.dealname }}
newStage: {{ $json.properties.dealstage }}
amount: {{ $json.properties.amount }}
contactEmail: {{ $node['Get Contact'].json.properties.email }}
contactName: {{ $node['Get Contact'].json.properties.firstname }}
ownerName: (mapped from owner lookup)

Step 4: Log to Google Sheets

Add a Google Sheets node. Configure it to append a row to your deals tracking spreadsheet. I keep columns for date, deal name, previous stage, new stage, amount, and contact info.

Node: Google Sheets
Operation: Append Row
Sheet: Deals Pipeline Tracker
Columns:
Date: {{ $now.toISOString() }}
Deal Name: {{ $json.dealName }}
New Stage: {{ $json.newStage }}
Amount: {{ $json.amount }}
Contact: {{ $json.contactName }}


This spreadsheet becomes your source of truth for pipeline reports. I generate weekly charts from it that my clients love.

Step 5: Send Slack Notification

Add a Slack node to notify your sales team. Use the "Send Message" operation and format it with blocks for better readability.

Node: Slack
Channel: #sales-pipeline
Message:
*Deal Stage Update* :chart_with_upwards_trend:
*Deal:* {{ $json.dealName }}
*New Stage:* {{ $json.newStage }}
*Amount:* ${{ $json.amount }}
*Contact:* {{ $json.contactName }} ({{ $json.contactEmail }})
*Owner:* {{ $json.ownerName }}

Step 6: Create a Follow-Up Task

Add another HubSpot node, this time using the "Create Task" operation. Set the task to be due based on the deal stage. For example, deals that move to "Proposal Sent" get a 3-day follow-up, while deals in "Negotiation" get a 1-day follow-up.

Use an IF node before this to branch based on the stage:

IF newStage == "proposalsent"
→ Create task due in 3 days
IF newStage == "negotiation"
→ Create task due in 1 day
IF newStage == "closedwon"
→ Create task: "Send onboarding email" due tomorrow

Advanced Tips from Daily Use

After running this workflow for months, here are the refinements I have made.

Error Handling

Add an Error Trigger workflow that catches failures and sends you a direct message on Slack. HubSpot API rate limits can cause occasional failures, especially if you have a lot of deal activity. I added a Wait node with a 2-second delay between API calls to avoid hitting limits.

Deduplication

Sometimes HubSpot fires duplicate events. I added a Function node that checks a simple cache (stored in a Google Sheet or database) to see if the same deal-stage combination was processed in the last 5 minutes. If it was, the workflow stops.

Contact Enrichment

Before notifying the team, I run the contact email through Clearbit's API using an HTTP Request node. This adds company size, industry, and LinkedIn URL to the Slack notification, giving the sales rep instant context.

Multi-Pipeline Support

If you have multiple pipelines in HubSpot, add a Switch node right after the trigger to route deals through different processing paths based on the pipeline ID.

Other HubSpot Workflows Worth Building

Once you have the main workflow running, here are a few more I built:

1. New Contact to Onboarding Sequence. When a contact is created with a specific lifecycle stage, automatically create a task sequence for the sales rep.
2. Company Data Sync. Every night at midnight, sync company records between HubSpot and a PostgreSQL database for custom reporting.
3. Ticket Escalation. When a support ticket has been open for more than 48 hours, notify the team lead and update the ticket priority.
4. Lead Scoring Alerts. When a contact's lead score crosses a threshold, move them to a new lifecycle stage and assign them to a senior rep.

Troubleshooting Common Issues

"Authentication failed" error. Double-check your private app token. HubSpot tokens do not expire, but if someone regenerated the token in HubSpot settings, your n8n credential will break.

Missing deal properties. Make sure you are requesting the specific properties you need in the API call. HubSpot does not return all properties by default.

Webhook not firing. If you are using webhooks instead of polling, verify that your n8n instance is publicly accessible. Self-hosted instances behind a firewall need a tunnel like ngrok or Cloudflare Tunnel.

Rate limit errors. HubSpot allows 100 requests per 10 seconds for private apps. If you are processing many deals simultaneously, add delay nodes between API calls.

FAQ

Can I use the free version of HubSpot with n8n?

Yes. HubSpot's free CRM plan includes API access through private apps. You can create contacts, deals, and tasks via the API without a paid plan. Some advanced features like custom objects and workflows require a paid HubSpot plan, but the core CRM operations work perfectly on free.

How do I handle HubSpot API rate limits in n8n?

HubSpot allows 100 API calls per 10 seconds for private apps. In n8n, you can manage this by adding Wait nodes between consecutive API calls, processing records in batches using the Split In Batches node, and enabling retry on failure in each HTTP Request node with a delay of 2 to 5 seconds between retries. I typically set my workflows to process no more than 50 records per batch with a 1-second pause between each.

Is it better to use HubSpot webhooks or polling in n8n?

It depends on your setup. Webhooks are real-time and more efficient, but they require your n8n instance to be publicly accessible. Polling is simpler and works behind firewalls, but introduces a small delay. For most use cases, polling every 5 minutes is perfectly fine. I use polling on my self-hosted setup because I do not want to expose my instance to the internet.

Wrapping Up

Building an n8n HubSpot integration transformed how my clients manage their sales pipelines. The workflow I showed you today catches every deal stage change, keeps your spreadsheet reports updated, notifies your team instantly, and ensures no follow-up gets forgotten.

The beauty of n8n is that once you build one workflow, ideas for ten more come naturally. I started with deal tracking and now have over a dozen HubSpot automations running daily.

If you are ready to start building your own HubSpot automations, get started with n8n here. And if you want to learn the fundamentals first, check out my beginner guide to n8n for a solid foundation.

The time you invest in setting this up will pay for itself within the first week. I guarantee it.

🚀 Ready to automate?

Start your free n8n trial today.

Try n8n Free →

Deja un comentario