Weekly Shopify Sales Summary Workflow
Weekly Shopify Sales Summary
An intelligent workflow that automates Shopify sales data processing, leveraging RAG technology and a vector database to enable smart analysis, storage, and report generation of sales data.
Workflow Overview
This is an n8n automation workflow named "Weekly Shopify Sales Summary," designed to process and analyze Shopify sales data. The workflow integrates RAG (Retrieval-Augmented Generation) technology, vector database storage, and an AI chat model to deliver intelligent sales data processing and summarization capabilities.
Workflow Architecture
Trigger Mechanism
- Webhook Trigger: Activated via a POST request to the endpoint
/weekly-shopify-sales-summary. - Enables external systems or scheduled tasks to initiate the data processing pipeline through HTTP requests.
Core Processing Pipeline
1. Data Preprocessing Stage
Text Splitter
- Splits incoming data into smaller text chunks.
- Chunk Size: 400 characters
- Chunk Overlap: 40 characters
- Purpose: Optimizes subsequent vectorization and retrieval efficiency.
2. Vectorization and Storage
Embeddings Model
- Uses Cohere’s
embed-english-v3.0model. - Converts text data into vector representations.
- Connects to the Cohere API for embedding generation.
Pinecone Vector Database
- Insert Mode (Pinecone Insert): Stores vectorized data in an index named
weekly_shopify_sales_summary. - Query Mode (Pinecone Query): Retrieves relevant vector data from the same index.
- Enables long-term data storage and semantic search functionality.
3. AI Intelligence Layer
RAG Agent
- System Prompt: "You are an assistant for Weekly Shopify Sales Summary."
- Orchestrates multiple AI components collaboratively:
Chat Model
- Utilizes Anthropic’s Claude AI model.
- Responsible for generating intelligent responses and performing data analysis.
Vector Tool
- Name: "Pinecone"
- Description: "Vector context"
- Provides the RAG agent with vector-based contextual retrieval capabilities.
Window Memory
- Maintains conversation history.
- Ensures contextual coherence across interactions.
4. Output and Monitoring
Google Sheets Integration (Append Sheet)
- Operation Type: Append data
- Target Document: Google Sheet with ID
SHEET_ID - Target Worksheet: Sheet named "Log"
- Logs processing status and results.
Error Handling (Slack Alert)
- Monitoring Channel: #alerts
- Automatically sends error notifications to Slack when workflow failures occur.
- Message Format:
Weekly Shopify Sales Summary error: {error details}
Technology Stack Integration
Required API Credentials
- Cohere API: For text embeddings
- Pinecone API: For vector database storage
- Anthropic API: For the Claude AI model
- Google Sheets OAuth2: For data logging
- Slack API: For error alerts
Connection Topology
Webhook → Text Splitter → Embeddings → Pinecone Insert
↓
Pinecone Query → Vector Tool
↓
Window Memory ←────────────────────────────→ RAG Agent → Append Sheet
↓
Chat Model ──────────────────────────────────┘ (Error) → Slack Alert
Workflow Features
Advantages
- Intelligent Processing: Combines RAG and large language models for smart data analysis.
- Scalability: Vector database supports large-scale data storage and fast retrieval.
- Fault Tolerance: Comprehensive error handling and alerting system.
- Data Persistence: Google Sheets logging ensures traceability.
- Context Awareness: Window memory maintains conversational continuity.
Use Cases
- Automated sales data summarization
- Periodic sales trend analysis
- Intelligent Q&A system (for sales-related queries)
- Automatic sales report generation
Node Statistics
- Total Nodes: 12
- Trigger Nodes: 1 (Webhook)
- AI/ML Nodes: 7 (Text Splitter, Embeddings, 2 Pinecone nodes, Vector Tool, Memory, Chat Model)
- Integration Nodes: 2 (Google Sheets, Slack)
- Other Nodes: 2 (Sticky Note, RAG Agent)
Execution Settings
- Execution Order Version: v1
- Trigger Count: 1