HubSpot is the CRM a lot of small and growing teams start with, and its free tier makes it easy to collect contacts fast. Keeping those contacts clean, scored and followed up on is where the hours go. In this tutorial you’ll connect n8n to HubSpot and build four automations: capturing leads without duplicates, scoring them with AI, celebrating won deals, and sending a daily digest to your team.
What n8n can do with HubSpot
n8n has a built-in HubSpot node and a HubSpot Trigger node:
- Contacts: create or update (by email), get, get many, search, delete
- Companies and Deals: create, update, get, search, delete
- Engagements: log calls, emails, meetings, notes and tasks
- Tickets: create and update support tickets
- Forms: read form fields and submit form data
- Triggers: start a workflow when a contact, company or deal is created, changed or deleted
For anything else, use the HTTP Request node with the same HubSpot credential to call the HubSpot API directly.
Step 1: Connect HubSpot to n8n
The simplest way is an access token from a private app:
- In HubSpot, open Settings → Integrations → Private Apps and click Create a private app. (In newer HubSpot accounts this lives under Development → Legacy apps.)
- Give it a name like
n8n. - On the Scopes tab, add only what you need. For this tutorial:
crm.objects.contacts.readandcrm.objects.contacts.writecrm.objects.companies.readandcrm.objects.companies.writecrm.objects.deals.readandcrm.objects.deals.write
- Create the app and copy the access token.
- In n8n, add a HubSpot App Token credential and paste the token.
Note: the HubSpot Trigger node works differently. It uses webhooks from a HubSpot developer app, so it needs a separate HubSpot Developer API credential (developer API key, client ID, client secret and app ID). If you’d rather skip that setup, use a Schedule Trigger with a HubSpot search instead. Workflow 2 below shows both options.
Workflow 1: Website form → HubSpot contact (no duplicates)
Webhook / n8n Form Trigger
↓
HubSpot: Contact → Create or Update
↓
Slack: "New lead: {{name}} ({{email}})"
- Add a Webhook or n8n Form Trigger node and point your website form at it.
- Add a HubSpot node: Resource Contact, Operation Create or Update.
- Set Email to
{{ $json.email }}. HubSpot uses email as the unique key, so a returning visitor updates their existing contact instead of creating a second one. - Under Additional Fields, map First Name, Last Name, Company Name and Phone. Set Lead Status or Lifecycle Stage if you track them.
- Add a Slack (or Microsoft Teams) node to post the new lead to your sales channel.
Tip: add a hidden field to your form with the page URL or campaign name, and save it to a custom contact property. You’ll know exactly which page brought each lead in.
Workflow 2: Score new contacts with AI
HubSpot Trigger (Contact Created) or Schedule Trigger (every 15 min) + HubSpot: Contact → Search
↓
HubSpot: Contact → Get (all the properties you need)
↓
OpenAI / Gemini: score 1-10 + one-line reason
↓
HubSpot: Contact → Create or Update (ai_lead_score, ai_lead_reason)
↓
IF score ≥ 8 → Slack alert to the contact owner
- In HubSpot, create two custom contact properties:
ai_lead_score(number) andai_lead_reason(single-line text). - Start the workflow one of two ways:
- HubSpot Trigger with the event Contact Created, or
- a Schedule Trigger every 15 minutes, then a HubSpot node: Contact → Search, filtered to contacts where
ai_lead_scorehas no value.
- Add a HubSpot node: Contact → Get, so the AI sees job title, company, website and source.
- Add an OpenAI (or Gemini) node with a prompt like:
Score this B2B lead from 1-10 for fit with an automation agency. Reply as JSON: {"score": number, "reason": string}. Lead: {{ JSON.stringify($json.properties) }} - Add a HubSpot node: Contact → Create or Update with the same email, and fill
ai_lead_scoreandai_lead_reasonunder Additional Fields → Custom Properties. - Add an IF node: score 8 or more sends a Slack or Teams message to the sales team.
The schedule version scores each contact only once, because the search skips anyone who already has a score.
Workflow 3: Deal-won celebration and handoff
HubSpot Trigger (Deal Property Changed: dealstage)
↓
IF dealstage = closedwon
↓
HubSpot: Deal → Get
↓
Slack: "🎉 {{dealname}} closed for {{amount}}"
↓
HubSpot: Engagement → Create (Task: "Send onboarding kit")
- Add a HubSpot Trigger with the event Deal Property Changed and the property
dealstage. - Add an IF node that checks the new value equals
closedwon. HubSpot stores the stage’s internal ID, not its label, so check Settings → Objects → Deals → Pipelines if you use a custom pipeline. Custom stages often have numeric IDs. - Add a HubSpot node: Deal → Get to read the deal name, amount and owner.
- Post to Slack or Teams, then add a HubSpot node: Engagement → Create, type Task, so onboarding starts the same day.
Workflow 4: Daily new-contact digest
Schedule Trigger (8:00 AM daily)
↓
HubSpot: Contact → Search (created in the last 24 hours)
↓
Code / Summarize: build a short list
↓
Gmail or Slack: "12 new contacts yesterday"
- Add a Schedule Trigger for 8:00 AM.
- Add a HubSpot node: Contact → Search, with a filter on
createdategreater than{{ $now.minus({ days: 1 }).toMillis() }}. HubSpot compares dates as Unix time in milliseconds. - Add a Code node that turns the results into one message:
const lines = $input.all().map(i => { const p = i.json.properties; return `• ${p.firstname ?? ''} ${p.lastname ?? ''} - ${p.company ?? 'no company'} (${p.email})`; }); return [{ json: { count: lines.length, text: lines.join('n') } }]; - Send it with Gmail or Slack.
Want the same contacts in a spreadsheet too? Add a Google Sheets node with Append or Update Row, as shown in our Salesforce and Google Sheets sync guide. The pattern is the same, using the HubSpot contact ID as the match column.
Troubleshooting
- 401 or MISSING_SCOPES: the private app is missing a scope. Add it in HubSpot, then copy the token again if HubSpot asks you to rotate it.
- 429 Too Many Requests: HubSpot limits how many API calls an app can make every few seconds. Turn on Retry On Fail in the node settings, or process large lists with Loop Over Items and a short Wait.
- Property not found: use the property’s internal name (like
lifecyclestage), not its display label. You’ll find it in Settings → Properties. - Trigger never fires: the HubSpot Trigger needs a developer app with webhook subscriptions, and the workflow must be active. Use the Schedule plus Search approach if you don’t want to set up a developer app.
- Duplicate contacts: use Create or Update rather than a plain create, and make sure every incoming record has an email.
Wrapping up
Start with Workflow 1 so every lead lands in HubSpot cleanly, add AI scoring once the leads are flowing, then layer on deal alerts and the daily digest. Moving to Salesforce later? See our n8n Salesforce tutorial; the same four workflows carry over almost one to one.
Watch the step-by-step builds on our YouTube channel, Node & Volt.


