Automate HubSpot Deal Assignments with n8n Workflow

This n8n workflow automates the assignment of unassigned HubSpot deals based on region and company size, saving sales teams hours of manual work and ensuring timely follow-up. It streamlines deal distribution by automatically allocating leads to the right sales rep according to specific criteria.
scheduleTrigger
httpRequest
switch
+3
Workflow Identifier: 2042
NODES in Use: Schedule Trigger, HTTP Request, Split Out, Filter, Switch, HubSpot

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does 🔧

This workflow gets unassigned deals from HubSpot and sorts them automatically.
It looks at deal regions and company size to pick the right sales rep.
This stops manual work and helps assign deals fast without missing any.

The workflow runs every 2 days early in the morning to keep deal lists clean.
It fetches deal info plus linked contacts and companies to get needed data for assignment.

Then, deals are checked for their country and sorted by region — mainly United States or Germany, with others handled as fallback.
Sales reps get assigned based on how big the company is, using employee count thresholds that differ between US and Germany.


Inputs, Processing Steps, and Output

Inputs

  • HubSpot unassigned deals: Deals without a sales rep assigned.
  • Contact details: Contacts linked to deals.
  • Company info: Company data for linked contacts including country and employee count.

Processing Steps

  1. Fetch deals from HubSpot API every 2 days at 7 AM.
  2. Split deals into single items for processing one by one.
  3. Filter only deals with empty owner field.
  4. Get contact for each deal with associations from API.
  5. Get company info for the contact’s company.
  6. Use switch logic to assign deals by country (US, Germany, fallback).
  7. Within US and Germany branches, assign deals to sales reps based on company size ranges.
  8. Update HubSpot deal owner field using respective sales rep IDs.
  9. Optional fallback or notification for unassigned cases.

Output

Deals in HubSpot get owner assigned correctly by region and company size.
Sales reps receive appropriate deals without manual sorting.
Workflow keeps deals organized, speeds up response, and avoids mistakes.


Who Should Use This Workflow?

This workflow fits sales managers or teams using HubSpot who handle many deals daily.
It helps if deal owners must match both region and company size rules.
Automation reduces manual deal work and human errors while speeding up sales follow-up.

It is good for growing teams needing a simple, repeatable process inside n8n.
Users should have basic HubSpot access and n8n setup with credentials.


Tools and Services Used

  • HubSpot CRM API: To fetch and update deals, contacts, and companies.
  • n8n platform: For creating automation workflow.
  • HubSpot OAuth2 Credentials: Secure API authentication inside n8n.
  • self-host n8n: Recommended for stable hosting and control. Learn more here.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open your n8n editor where you build workflows.
  3. Use the “Import from File” option to load the workflow.

Step 2: Add Credentials and Configure

  1. Go to credential setup in n8n and add your HubSpot OAuth2 credentials if not done.
  2. Check and update any sales rep user IDs for assignments according to your HubSpot users.
  3. If you want to notify via Slack or email, update those node fields with your channels or emails.

Step 3: Test the Workflow

  1. Run the workflow manually once to see if deals are fetched and assigned correctly.
  2. Make sure deal owner fields update in your HubSpot portal.
  3. Fix any errors like missing credentials or wrong IDs.

Step 4: Activate Workflow for Production

  1. Switch the workflow to active mode in n8n to run automatically.
  2. The workflow will now run every 2 days at 7 AM without manual trigger.
  3. Monitor the executions in the n8n dashboard for any issues.

Edge Cases and Failure Notes

  • If some deals have no contacts linked, the workflow may error at contact fetch step.
    Add an If node to check for contact presence before proceeding.
  • Company data might be missing partially.
    Include fallback or default assignment to avoid unassigned deals.
  • API OAuth tokens can expire causing 401 errors.
    Reauthorize HubSpot credentials regularly.
  • Country exact spelling is important in switch nodes.
    Use exact strings like “United States” or “Germany”.
  • Employee number comparisons must compare numbers, not strings.
    Wrong types cause switch nodes to fail.

Customization Ideas

  • Change run frequency in Schedule Trigger to daily or weekly.
  • Add more regions in region switch to cover more countries.
  • Modify company size thresholds for your sales team needs.
  • Replace fallback assignment with Slack or email notifications to managers.
  • Handle missing contacts with an If node or Function node to skip or log.

Workflow Code Snippet Sample

Example dynamic URL to get contact for a deal, with contact ID placeholder:

https://api.hubapi.com/crm/v3/objects/contacts/{{ $json.associations.contacts.results[0].id }}?associations=company

This URL dynamically pulls contact info and their company for the current deal item.
Replace with appropriate ID fields for customization.


Summary

✓ Automates deal assignment based on region and company size.
✓ Fetches enriched data from HubSpot deal, contact, and company info.
✓ Runs every 2 days without manual input.
✓ Reduces manual sorting and human errors.
✓ Keeps sales reps focused on closing deals, not managing assignments.

Frequently Asked Questions

Download the workflow file from the page. In n8n editor, use Import from File to add it. Add HubSpot OAuth2 credentials. Update sales rep IDs if needed. Test the workflow once. Then activate it to run automatically.
The workflow may error when trying to get contact data. To fix, add a node to check if contacts exist before continuing. You can skip or log these deals.
Yes, more countries can be added in the Switch node for region assignment. Just add rules matching the new countries.
Unauthorized errors often happen when OAuth2 credentials expire or are misconfigured. Reauthorize or recreate HubSpot credentials in n8n to fix.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free