Back to Catalog

Auto-assign deals in Hubspot to fitting sales reps based on geo and company size

Niklas HatjeNiklas Hatje
1491 views
2/3/2026
Official Page

Use case

To guarantee an effective sales process deals must be distributed between sales reps in the best way. Normally, this involves manually assigning new deals that have come in. This workflow automates it for you!

What this workflow does

This workflow runs once a day and checks for unassigned deals in your Hubspot CRM. Once it finds one, it enriches the deal with information about the assigned contact and their company. It then checks the region of the assigned company before looking at the company's employee size. Based on this, it assigns the deal to the right sales rep within your company.

Requirements

  • New deals in Hubspot need to be unassigned in the beginning
  • New deals have to have an attached contact that has an attached company in Hubspot
  • The company needs to have values for region and employee count in Hubspot

Setup

The setup is quite straight forward and will probably take a few minutes only.

  1. Add your Hubspot credentials
  2. Customize your criterias for assigning deals in the Assign by Region and the following Assign nodes
  3. Make sure deals are assigned to the right salesrep in the Hubspot nodes at the end
  4. Activate the workflow

Customizing this to your needs

  • Adjust the trigger interval to your needs. Currently, it defaults to once a day
  • Adjust your region settings by adding/updating/removing options in the respective node
  • Adjust your employee size settings by adding/updating/removing options in the respective node

Ideas to enhance this flow

  • Wrap each region's assigned criteria into different sub-workflows for easier maintainability. This will not consume additional execution counts.
  • Add more logic on what happens once a deal does not match any criteria you've set

n8n Workflow: Auto-Assign Deals in HubSpot to Fitting Sales Reps Based on Geo and Company Size

This n8n workflow automates the assignment of HubSpot deals to the most suitable sales representatives. It intelligently routes deals by first enriching company data with geographical information (country) and then applying a series of filters based on the company's country and size to assign the deal to the correct sales rep.

What it does

This workflow streamlines the deal assignment process by:

  1. Triggering on a Schedule: The workflow is initiated at predefined intervals (e.g., daily, hourly) to check for new deals.
  2. Fetching HubSpot Deals: It retrieves a list of deals from HubSpot.
  3. Splitting Out Deals: Each deal is processed individually to allow for granular data enrichment and filtering.
  4. Enriching Company Data: For each deal, it fetches the associated company's details and then uses an external HTTP request to enrich the company data, specifically extracting the country information.
  5. Filtering by Country: It then filters deals based on the identified country, directing them down different paths for specific regions (e.g., "Germany", "Europe", "USA").
  6. Filtering by Company Size: Within each country/region path, it further filters deals based on company size (e.g., "Small", "Medium", "Large").
  7. Assigning to Sales Reps: Finally, it updates the HubSpot deal, assigning it to the appropriate sales representative based on the combined country and company size criteria.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running instance of n8n.
  • HubSpot Account: Configured with credentials in n8n.
  • External API for Geo-enrichment: An API endpoint that can take company information and return geographical data (specifically, the country). This is represented by the "HTTP Request" node. You will need to configure its URL and any necessary authentication.

Setup/Usage

  1. Import the Workflow:
    • Copy the provided JSON code.
    • In your n8n instance, click "New Workflow".
    • Go to "File" > "Import from JSON" and paste the code.
  2. Configure Credentials:
    • Set up your HubSpot API credentials in n8n if you haven't already.
    • Update the "HubSpot" nodes to use your configured HubSpot credential.
  3. Configure HTTP Request Node:
    • Locate the "HTTP Request" node.
    • Update the URL and any headers or body parameters to match the external API you are using for geographical data enrichment.
  4. Configure Filter and Switch Nodes:
    • Review the "Filter" and "Switch" nodes to ensure the logic for country and company size matches your sales team's assignment rules.
    • Adjust the conditions (e.g., country names, company size ranges) as needed.
  5. Configure HubSpot Update Nodes:
    • For each "HubSpot" node responsible for updating a deal, ensure the "Owner" property is set to the correct sales representative's ID or name based on the preceding filters.
  6. Activate the Workflow: Once configured, activate the workflow to start the automated deal assignment process.
  7. Adjust Schedule: Modify the "Schedule Trigger" node to define how often you want the workflow to run (e.g., every 15 minutes, once a day).

Related Templates

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chatโ€”turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. ๐Ÿ“‹ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing ๐Ÿ”ง Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation ๐Ÿ”‘ Required Credentials OpenAI API Setup Go to platform.openai.com โ†’ API keys (sidebar) Click "Create new secret key" โ†’ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai โ†’ Dashboard โ†’ API Keys Generate a new API key โ†’ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) โš™๏ธ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowโ€”chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" ๐ŸŽฏ Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration โš ๏ธ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

AI multi-agent executive team for entrepreneurs with Gemini, Perplexity and WhatsApp

This workflow is an AI-powered multi-agent system built for startup founders and small business owners who want to automate decision-making, accountability, research, and communication, all through WhatsApp. The โ€œvirtual executive team,โ€ is designed to help small teams to work smarter. This workflow sends you market analysis, market and sales tips, It can also monitor what your competitors are doing using perplexity (Research agent) and help you stay a head, or make better decisions. And when you feeling stuck with your start-up accountability director is creative enough to break the barrier ๐ŸŽฏ Core Features ๐Ÿง‘โ€๐Ÿ’ผ 1. President (Super Agent) Acts as the main controller that coordinates all sub-agents. Routes messages, assigns tasks, and ensures workflow synchronization between the AI Directors. ๐Ÿ“Š 2. Sales & Marketing Director Uses SerpAPI to search for market opportunities, leads, and trends. Suggests marketing campaigns, keywords, or outreach ideas. Can analyze current engagement metrics to adjust content strategy. ๐Ÿ•ต๏ธโ€โ™€๏ธ 3. Business Research Director Powered by Perplexity AI for competitive and market analysis. Monitors competitor moves, social media engagement, and product changes. Provides concise insights to help the founder adapt and stay ahead. โฐ 4. Accountability Director Keeps the founder and executive team on track. Sends motivational nudges, task reminders, and progress reports. Promotes consistency and discipline โ€” key traits for early-stage success. ๐Ÿ—“๏ธ 5. Executive Secretary Handles scheduling, email drafting, and reminders. Connects with Google Calendar, Gmail, and Sheets through OAuth. Automates follow-ups, meeting summaries, and notifications directly via WhatsApp. ๐Ÿ’ฌ WhatsApp as the Main Interface Interact naturally with your AI team through WhatsApp Business API. All responses, updates, and summaries are delivered to your chat. Ideal for founders who want to manage operations on the go. โš™๏ธ How It Works Trigger: The workflow starts from a WhatsApp Trigger node (via Meta Developer Account). Routing: The President agent analyzes the incoming message and determines which Director should handle it. Processing: Marketing or sales queries go to the Sales & Marketing Director. Research questions are handled by the Business Research Director. Accountability tasks are assigned to the Accountability Director. Scheduling or communication requests are managed by the Secretary. Collaboration: Each sub-agent returns results to the President, who summarizes and sends the reply back via WhatsApp. Memory: Context is maintained between sessions, ensuring personalized and coherent communication. ๐Ÿงฉ Integrations Required Gemini API โ€“ for general intelligence and task reasoning Supabase- for RAG and postgres persistent memory Perplexity API โ€“ for business and competitor analysis SerpAPI โ€“ for market research and opportunity scouting Google OAuth โ€“ to connect Sheets, Calendar, and Gmail WhatsApp Business API โ€“ for message triggers and responses ๐Ÿš€ Benefits Acts like a team of tireless employees available 24/7. Saves time by automating research, reminders, and communication. Enhances accountability and strategy consistency for founders. Keeps operations centralized in a simple WhatsApp interface. ๐Ÿงฐ Setup Steps Create API credentials for: WhatsApp (via Meta Developer Account) Gemini, Perplexity, and SerpAPI Google OAuth (Sheets, Calendar, Gmail) Create a supabase account at supabase Add the credentials in the corresponding n8n nodes. Customize the system prompts for each Director based on your startupโ€™s needs. Activate and start interacting with your virtual executive team on WhatsApp. Use Case You are a small organisation or start-up that can not afford hiring; marketing department, research department and secretar office, then this workflow is for you ๐Ÿ’ก Need Customization? Want to tailor it for your startup or integrate with CRM tools like Notion or HubSpot? You can easily extend the workflow or contact the creator for personalized support. Consider adjusting the system prompt to suite your business

ShadrackBy Shadrack
331

Auto-reply & create Linear tickets from Gmail with GPT-5, gotoHuman & human review

This workflow automatically classifies every new email from your linked mailbox, drafts a personalized reply, and creates Linear tickets for bugs or feature requests. It uses a human-in-the-loop with gotoHuman and continuously improves itself by learning from approved examples. How it works The workflow triggers on every new email from your linked mailbox. Self-learning Email Classifier: an AI model categorizes the email into defined categories (e.g., Bug Report, Feature Request, Sales Opportunity, etc.). It fetches previously approved classification examples from gotoHuman to refine decisions. Self-learning Email Writer: the AI drafts a reply to the email. It learns over time by using previously approved replies from gotoHuman, with per-classification context to tailor tone and style (e.g., different style for sales vs. bug reports). Human Review in gotoHuman: review the classification and the drafted reply. Drafts can be edited or retried. Approved values are used to train the self-learning agents. Send approved Reply: the approved response is sent as a reply to the email thread. Create ticket: if the classification is Bug or Feature Request, a ticket is created by another AI agent in Linear. Human Review in gotoHuman: How to set up Most importantly, install the gotoHuman node before importing this template! (Just add the node to a blank canvas before importing) Set up credentials for gotoHuman, OpenAI, your email provider (e.g. Gmail), and Linear. In gotoHuman, select and create the pre-built review template "Support email agent" or import the ID: 6fzuCJlFYJtlu9mGYcVT. Select this template in the gotoHuman node. In the "gotoHuman: Fetch approved examples" http nodes you need to add your formId. It is the ID of the review template that you just created/imported in gotoHuman. Requirements gotoHuman (human supervision, memory for self-learning) OpenAI (classification, drafting) Gmail or your preferred email provider (for email trigger+replies) Linear (ticketing) How to customize Expand or refine the categories used by the classifier. Update the prompt to reflect your own taxonomy. Filter fetched training data from gotoHuman by reviewer so the writer adapts to their personalized tone and preferences. Add more context to the AI email writer (calendar events, FAQs, product docs) to improve reply quality.

gotoHumanBy gotoHuman
353