Marketing Automation Workflow (n8n)
This project is a complete n8n workflow designed for automating LoRA model training, product photo generation, and order management using Google Sheets, Drive, Gmail, Replicate, and Qdrant.
-
Technology: n8n
-
Integrations:
- Google Sheets
- Google Drive
- Gmail
- Replicate API
- Qdrant (vector database)
- OpenAI (Embeddings, LLM)
-
Main Features:
- Automatic LoRA model training based on user-uploaded images
- Google Drive photo management
- Google Sheets order tracking and data management
- Automatic product content retrieval from PDF (using RAG)
- Generation of creative, highly customized image prompts
- Complete automation of the workflow without manual coding
-
Data Source:
- The main source of truth is the
OrdersGoogle Sheet. - Each record includes:
- Order number
- Payment status
- Training status
- Number of generated images
- Model version info
- (Note: In production, it is highly recommended to migrate to a real database instead of Google Sheets for better scalability.)
- The main source of truth is the
-
Inputs Required:
- 10–20 high-quality photos of the product/object from different angles and with good lighting.
- One detailed PDF file describing the product (use, material, style, color, technical details).
- Detailed product descriptions significantly improve the quality of generated graphics because the AI agent uses this data to create realistic and striking prompts.
-
Important Notes:
- The project uses RAG (Retrieval-Augmented Generation) to analyze the PDF file and extract important content.
- If the input data is very small, RAG can easily be disabled for faster execution.
- You are not limited to training perfume bottles or cosmetics — any object can be trained (e.g., shoes, furniture, tech gadgets).
- Once the model is trained, it appears in your Replicate account under "Models," and remains accessible for future generations without retraining.
-
Performance and Costs:
- Training cost: ~1 USD per model (based on Replicate pricing and number of photos).
- Image generation cost: typically below 0.01 USD per image.
- The workflow is optimized to minimize token usage and API costs.
-
Current Status:
- This is an early (draft) version.
- Many improvements and upgrades are planned, including:
- Better image quality and faster generation
- Workflow modularization
- Automated video generation from photos
- Even in its current form, the system delivers satisfying and production-ready results.
- Install and configure n8n.
- Create necessary Credentials (Google, Replicate, OpenAI, Qdrant).
- Import the workflow into your instance.
- Insert your API keys and configure endpoint details.
- Provide proper photos and PDF documents for each order.
- Run the workflow and enjoy automated generation!
- Google Cloud account (for OAuth 2.0)
- Replicate account
- OpenAI account
- Qdrant Cloud account (or private instance)



