Structured Company Data Generation using Web RAG and LLMs - n8n Workflow

Automate synthetic content creation using n8n workflow templates. Combine Bedrijfsdata Web RAG with OpenAI to generate structured company descriptions (in Dutch) and update HubSpot CRM records instantly.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Sales and Marketing Operations Teams: Seeking automated prospect qualification and enriched CRM data using an n8n workflow.

  • Data Engineers: Needing a reliable n8n templates foundation for creating custom, structured data points from unstructured web content.

  • Automation Specialists: Developers looking to implement advanced RAG techniques within an n8n environment utilizing custom API integrations.

  • Users of HubSpot and Bedrijfsdata: Requiring seamless data synchronization driven by a powerful n8n node structure.

Overview

Generating high-quality, structured company descriptions requires combining factual data with sophisticated content synthesis. This powerful n8n workflow solves the challenge of manually aggregating web data and then manually writing summaries.

It leverages Retrieval-Augmented Generation (RAG) through the Bedrijfsdata.nl platform to pull live content from a company's website and search results. This rich context is then fed into an OpenAI Chat Model, guided by a specialized prompt and a structured output parser to ensure the final result—a description, products/services list, and target audience—is always in a usable JSON format (and specifically in Dutch, as requested in the prompt).

The final synthesized content is then automatically pushed to an external CRM, like HubSpot, dramatically improving data quality and accelerating sales qualification processes. This entire process is orchestrated efficiently within a single n8n workflow, demonstrating the power of modular n8n templates for complex tasks.

How it Works

This n8n workflow initiates execution based on an input company ID, making it an excellent example of a reusable n8n templates structure.


  1. Trigger and Initial Data Fetch: The process starts with the When Executed by Another Workflow n8n trigger. It accepts a company ID, which is immediately used by the Get prospect n8n node (using ProspectPro) to retrieve essential company details, including the domain name.

  2. Input Validation: The Company domain is required n8n node acts as a crucial check. If the required domain name is missing, the n8n workflow branches off to error handling (Error type 1: invalid input).

  3. Web RAG Data Retrieval: The n8n workflow executes two parallel RAG requests: Get RAG domain scrapes specific content from the company's website, and Get rag search collects relevant search engine snippets. Both use the Bedrijfsdata n8n node.

  4. Content Preparation: The Prepare content to feed to LLM Code n8n node aggregates all retrieved information—basic company details, website snippets, and search results—into a consolidated JSON object, preparing the context for the LLM.

  5. Context Check: The Content available to proceed? n8n node verifies that some RAG content was successfully collected before proceeding to the expensive AI step. Failure routes to Error type 2: RAG error.

  6. AI Synthesis: The Basic LLM Chain node receives the context. It utilizes the OpenAI Chat Model (running gpt-4.1-mini) and the Structured Output Parser n8n node. This combination ensures the output is generated according to strict criteria (in Dutch and matching a defined JSON schema for description, products, and target audience).

  7. CRM Update: Finally, the Update company description n8n node (HubSpot) takes the structured output (specifically the company_description) and updates the corresponding company record in HubSpot, completing the n8n workflow automation.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Credentials Setup: This n8n workflow requires several credentials:

Bedrijfsdata API: Set up credentials for the Bedrijfsdata.nl Developer Platform (used by Get RAG domain and Get rag search).
ProspectPro API: Set up credentials for the Bedrijfsdata/ProspectPro service (used by Get prospect).
OpenAI API: Configure your OpenAI API key for the OpenAI Chat Model n8n node.
HubSpot OAuth2 API: Connect your HubSpot account to allow the final Update company description n8n node to write data.

  1. Code Node Review: The Prepare content to feed to LLM n8n node relies on specific node names (Get prospect, Get RAG domain, Get rag search). If you change the names of these upstream n8n nodes, you must update the references in the Code node accordingly.

  2. Testing: Execute the n8n trigger manually with a test id to ensure data flows correctly from RAG collection to LLM generation and final CRM update.

Node Details

When Executed by Another Workflow (n8n trigger): The starting point. Designed to receive an execution signal and a companyid input from another n8n workflow or system, enabling decoupled execution.
Get prospect (Bedrijfsdata ProspectPro n8n node): Fetches initial company data based on the input ID, retrieving essential details like the company domain.
Company domain is required (If n8n node): Acts as a critical flow control, verifying that the input contains a usable domain name before initiating expensive RAG lookups.
Get RAG domain & Get rag search (Bedrijfsdata n8n node): Core RAG nodes. They retrieve relevant content snippets directly from the company's website and external search engine results, providing the LLM with up-to-date context.
Prepare content to feed to LLM (Code n8n node): Custom scripting that cleans, validates, and consolidates data received from ProspectPro and the two RAG nodes into a single, structured payload for the subsequent LLM call.
Content available to proceed? (If n8n node): Ensures that at least one source of RAG content (website or search) is available before proceeding to the LLM generation phase.
Basic LLM Chain (LangChain n8n node): Orchestrates the AI process. It combines the RAG context with a specific prompt (requiring output in Dutch) and links to the model and parser.
OpenAI Chat Model (LangChain n8n node): The specific LLM used for generation (configured here as gpt-4.1-mini), responsible for synthesizing human-readable content from the raw inputs.
Structured Output Parser (LangChain n8n node): Enforces that the LLM's output conforms to a strict JSON schema, guaranteeing fields like companydescription and target_audience are present and structured.
Update company description (HubSpot n8n node): The final action. It uses data extracted from the structured LLM output to update the description field for the corresponding company record in HubSpot.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by
Olivier
Olivier

Featured*