🎬 E-commerce product fine-tuning with Bright Data and OpenAI

⚡ 1,489 views · 🎬 Content Creation & Video

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

finetuning gpt4o.PNG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

This workflow automates the process of scraping product data from e-commerce websites and using it to fine-tune a custom OpenAI GPT model for generating high-quality marketing copy and product descriptions.

Main Use Cases

How it works

The workflow operates in two main phases: model training and model usage, organized into these stages:

  1. Data Collection & Processing

    • Manually triggered to start the fine-tuning process.
    • Uses Bright Data’s web scraper to extract product information from any supported e-commerce platform (Amazon, eBay, Shopify stores, Walmart, Target, and hundreds of other websites).
    • Collects product titles, brands, features, descriptions, ratings, and availability status from your chosen platform.
    • Easily customizable to scrape from different websites by simply changing the dataset configuration and product URLs.
  2. Training Data Preparation

    • A Code node processes the scraped product data to create training examples in OpenAI’s required JSONL format.
    • For each product, generates a complete training example with:
      • System message defining the AI’s role as a marketing assistant.
      • User prompt containing specific product details (title, brand, features, original description snippet).
      • Assistant response providing an ideal marketing description template.
    • Compiles all training examples into a single JSONL file ready for OpenAI fine-tuning.
  3. Model Fine-Tuning

    • Uploads the training file to OpenAI using the OpenAI File Upload node.
    • Initiates a fine-tuning job via HTTP Request to OpenAI’s fine-tuning API using the GPT-4o-mini model as the base.
    • The fine-tuning process runs on OpenAI’s servers to create your custom model.
  4. Interactive Chat Interface

    • Provides a chat trigger that allows real-time interaction with your fine-tuned model.
    • An AI Agent node connects to your custom-trained OpenAI model.
    • Users can chat with the model to generate product descriptions, marketing copy, or other content based on the training.
  5. Custom Model Integration

    • The OpenAI Chat Model node is configured to use your specific fine-tuned model ID.
    • Delivers responses trained on your product data for consistent, high-quality marketing content.

Summary Flow:

Manual Trigger → Scrape E-commerce Products (Bright Data) → Process & Format Training Data (Code) → Upload Training File (OpenAI) → Start Fine-Tuning Job (HTTP Request) | Parallel: Chat Trigger → AI Agent → Custom Fine-Tuned Model Response

Benefits:

Setup Requirements:

🔗 Nodes Used

HTTP Request, AI Agent, OpenAI Chat Model, Chat Trigger, OpenAI

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup