Skip to content

AI Automation

AI Integration

HubSpot Lead Enrichment

HubSpot Lead Enrichment is an AI automation workflow developed for RetailBox to reduce the manual research required before sales representatives can engage new leads. Built with n8n, HubSpot, Gemini, JavaScript, and REST APIs, the workflow automatically processes newly created HubSpot contacts, retrieves information from their company websites, and uses Gemini to generate structured business profiles. The resulting data passes through rule-based lead-prioritization logic before being written back to the corresponding HubSpot records. RetailBox reported that sales outreach could begin within approximately five minutes of contact creation, compared with the hours or sometimes days previously spent researching companies manually. This was a paid client engagement completed in July 2026. The workflow is live, and I continue to provide maintenance.

Project details

Project type
AI-Powered CRM Automation
Role
AI Automation Engineer
Engagement
Paid Client Engagement
Period
July 2026 – Present
Status
Live · Ongoing maintenance
Technologies
  • n8n
  • HubSpot
  • Gemini API
  • JavaScript
  • REST APIs
  • Webhooks
  • HTTP Requests
  • JSON

Context

Project context.

RetailBox needed a more efficient way to prepare new HubSpot contacts for sales outreach. Before automation, researching a newly acquired lead required manually investigating the associated company, reviewing publicly available business information, and determining whether the company warranted sales attention. This process could take hours or, in some cases, days before a sales representative had enough context to begin outreach. The objective was to reduce this preparation time by automatically gathering company information, using AI to organize it into useful CRM fields, and applying business rules to prioritize leads. I developed an n8n workflow connecting HubSpot, company website retrieval, Gemini, and rule-based data processing. When a new contact enters HubSpot, the workflow retrieves the relevant contact information and researches the associated company website. Gemini analyzes the available website content and generates a structured company profile. JavaScript processing and field mapping then prepare the information for lead-priority evaluation and updating the corresponding HubSpot record. The resulting workflow gives sales representatives company context and prioritization information directly in their existing CRM.

Project setting

The automation was designed to operate within RetailBox's existing HubSpot workflow rather than introducing a separate application for researching leads. HubSpot remained the system where contacts were created, enriched, and accessed by the sales team. The implementation combined AI-generated company analysis with conventional automation logic. Gemini handled interpretation of retrieved business information, while structured parsing, field mapping, and rule-based prioritization controlled how the resulting information was processed. This distinction was important because the workflow needed both the flexibility of an LLM and predictable data updates within the CRM.

Problem space

  • Sales representatives needed to research newly created HubSpot contacts before beginning meaningful outreach.
  • Manual company research could delay sales follow-up by hours or days.
  • Important information about a lead's company was not consistently available when the contact first entered the CRM.
  • Repeatedly gathering company information introduced avoidable manual work.
  • Sales teams needed structured company profiles rather than unorganized website content.
  • Lead prioritization needed to follow defined business rules instead of relying entirely on AI-generated judgments.
  • Enrichment results needed to be written back to the correct HubSpot contact so the information was available within the existing sales workflow.

Target users

  • RetailBox sales representatives responsible for contacting new leads.
  • Sales teams qualifying and prioritizing prospects.
  • CRM users who need business context before initiating outreach.

Contribution

My contribution.

I developed and continue to maintain RetailBox's HubSpot lead enrichment automation. My responsibilities included designing the n8n workflow, integrating HubSpot and Gemini, retrieving company website information, implementing JavaScript processing and field mapping, applying lead-prioritization rules, and updating CRM records.

My work focused on connecting the stages of lead research into a single automated workflow. Rather than requiring a sales representative to manually investigate a company and copy relevant information into HubSpot, the workflow performs the initial research and enrichment when a new contact is created. The implementation combines webhook-driven automation, external API requests, LLM analysis, deterministic business rules, and CRM integration.

  1. Workflow Architecture and Orchestration

    Designed and built the automation in n8n, coordinating the processing steps from new HubSpot contact creation to CRM enrichment. Connected the trigger, company research, AI analysis, prioritization, and record-update stages into a single workflow.

  2. HubSpot Integration

    Integrated the workflow with HubSpot to retrieve information about newly created contacts and update their records with enriched company data. Implemented the data mapping necessary to associate generated business information with the appropriate CRM fields.

  3. Company Website Research

    Developed the website retrieval stage using HTTP requests to obtain publicly available company information. Prepared the retrieved content for analysis by Gemini, allowing the workflow to work with the company's website as a research source.

  4. Gemini-Powered Company Enrichment

    Integrated the Gemini API to analyze retrieved company website content and generate structured business profiles. The AI stage transforms company information into a format that can be processed programmatically and used within the CRM.

  5. Lead Prioritization

    Implemented rule-based logic to evaluate the enriched company information and assign lead priorities. Separated AI-generated company analysis from deterministic prioritization rules so lead assessment followed the workflow's defined criteria.

  6. JavaScript Processing and Field Mapping

    Used JavaScript to process structured enrichment results and prepare them for HubSpot. Implemented the transformations required to map extracted company information and lead-priority values into CRM fields.

  7. Ongoing Workflow Maintenance

    Continue to maintain the live automation following its initial implementation. The engagement includes supporting the workflow as part of RetailBox's ongoing lead-enrichment process.

Scope of ownership

The workflow was delivered as a paid client engagement in July 2026. Its main engineering value lies in combining several systems into an automated business process: HubSpot provides the contact records, HTTP requests retrieve company information, Gemini generates structured enrichment, and JavaScript processing applies the required mappings and prioritization logic. The final information is returned to HubSpot, where the sales team can use it without switching to a separate research application.

Implementation

Technical breakdown.

The automation is implemented in n8n, with HubSpot serving as both the source of new contact events and the destination for enriched lead information. The workflow combines webhook-based triggering, company website retrieval, Gemini-powered analysis, JavaScript data transformations, rule-based prioritization, and HubSpot API updates. Each stage has a defined responsibility, separating the collection and interpretation of company information from the rules used to classify and store it.

  1. HubSpot Contact Trigger

    • n8n
    • HubSpot
    • Webhooks
    • REST APIs

    Configured an n8n webhook workflow to process newly created HubSpot contacts.

    The workflow retrieves the relevant contact information and uses available company details to initiate the enrichment process.

    This makes lead research part of the contact-creation workflow instead of a separate manual activity performed by a sales representative.

    • Webhook-based automation trigger.
    • New HubSpot contact processing.
    • Retrieval of contact and company information.
    • Coordination of subsequent enrichment steps.
  2. Company Website Retrieval

    • n8n
    • HTTP Requests
    • REST APIs

    Implemented HTTP requests to retrieve information from company websites associated with incoming leads.

    The retrieved website content provides the source material for AI-generated company analysis.

    This stage separates the process of acquiring company information from the subsequent interpretation and classification of that information.

    • Company website retrieval.
    • HTTP request integration.
    • Extraction of publicly available website content.
    • Preparation of retrieved information for AI analysis.
  3. Gemini-Powered Business Analysis

    • Gemini API
    • n8n
    • JSON

    Integrated Gemini to analyze company website content and generate structured information about the business.

    Rather than returning an unstructured research narrative, the AI stage produces information that can be parsed and mapped into CRM fields.

    This enables the workflow to use the language model for interpreting company information while leaving subsequent processing to conventional application logic.

    • Gemini API integration.
    • Analysis of retrieved website information.
    • Generation of structured company profiles.
    • JSON-based enrichment data.
    • Preparation of results for downstream processing.
  4. Structured Data Processing and Prioritization

    • JavaScript
    • n8n
    • JSON

    Used JavaScript within the n8n workflow to process the structured enrichment results.

    The implementation prepares company information for storage and applies defined lead-priority rules to the generated data.

    Separating prioritization from the AI analysis makes it possible to process the model's output according to the business rules established for the workflow.

    • JavaScript-based data parsing.
    • Structured enrichment processing.
    • Lead-priority evaluation.
    • Rule-based classification.
    • Preparation of values for HubSpot fields.
  5. HubSpot Record Enrichment

    • HubSpot
    • n8n
    • JavaScript
    • REST APIs

    Integrated the final enrichment stage with HubSpot to update the corresponding contact record.

    The workflow maps structured company information and lead-priority values to the appropriate CRM fields.

    This keeps the resulting research inside the sales team's existing system, where it can be accessed during lead qualification and outreach.

    • HubSpot record updates.
    • Mapping of structured company information.
    • Lead-priority field updates.
    • REST API integration.
    • Association of enrichment results with the originating contact.
  6. Live Operation and Maintenance

    • n8n
    • HubSpot
    • Gemini API
    • JavaScript

    The workflow was deployed for RetailBox's operational use following its implementation in July 2026.

    I continue to maintain the automation as an ongoing client engagement.

    The workflow supports the recurring process of enriching new HubSpot contacts with company information and lead-priority data.

    • Live client workflow.
    • Automated processing of new contacts.
    • Integration with RetailBox's existing CRM.
    • Ongoing maintenance.

Outcomes

What the work delivered.

The HubSpot lead enrichment workflow reduced the amount of manual research required before RetailBox's sales team could begin contacting new leads. RetailBox reported that sales outreach could begin within approximately five minutes of a new contact being created, compared with the hours or sometimes days previously required for manual company research. The automation also established a repeatable process for generating structured company profiles, applying lead-priority rules, and storing enrichment results directly in HubSpot. The workflow is live and remains under maintenance. These results are based on client feedback rather than an independently measured performance study.

  1. Outcome

    Faster Sales Outreach Preparation

    Automated initial company research and CRM enrichment, allowing RetailBox's sales representatives to begin outreach substantially sooner after new contacts entered HubSpot.

    Measured impact

    Client-reported outreach readiness
    ~5 minutes

    Compared with hours or sometimes days of manual company research before automation.

    The approximately five-minute figure was reported by RetailBox. It describes the time before sales outreach could begin, not a guaranteed workflow execution time or a measured sales response rate.

  2. Deliverable

    Automated Company Research

    Replaced repetitive initial company research with an n8n workflow that retrieves company website information and uses Gemini to produce structured enrichment data.

    The workflow brings company research into the existing HubSpot lead-management process, reducing the need for sales representatives to gather the same information manually.

  3. Deliverable

    Structured CRM Enrichment

    Integrated Gemini-generated company profiles with HubSpot, automatically mapping structured enrichment information into the corresponding contact records.

    The resulting information is accessible within HubSpot, allowing sales representatives to review company context in the system they already use.

  4. Deliverable

    Rule-Based Lead Prioritization

    Implemented deterministic lead-prioritization logic using the enriched company information, separating AI-generated analysis from business-rule evaluation.

    JavaScript processing and field mapping prepare prioritization results for storage in the CRM.

  5. Deliverable

    End-to-End AI Automation

    Built a connected workflow covering contact creation, company website retrieval, AI enrichment, lead prioritization, and HubSpot record updates.

    The implementation combines n8n orchestration, HubSpot integration, Gemini analysis, JavaScript transformations, and REST APIs in a single automated business process.

  6. Outcome

    Live Client Deployment

    Delivered the automation as a paid client engagement and continue to provide maintenance for the live workflow.

    The engagement began in July 2026. Unlike an independent demonstration workflow, this automation is used in RetailBox's sales operations.