Introduction
E-commerce businesses drown in customer feedback. Your product review pages fill up daily with detailed comments about fit, quality, durability, and usability. Meanwhile, your inventory team makes purchasing decisions based on guesswork, historical trends, or at best, a manual trawl through hundreds of reviews each week. By the time someone reads enough feedback to spot a pattern, you've already ordered too much of the wrong size or colour, or you've understocked the items customers actually want.
This workflow solves that problem by automating the entire chain from review collection through sentiment analysis to actionable inventory recommendations. You will extract product reviews from your e-commerce platform, analyse them for themes and sentiment, then generate specific inventory adjustment suggestions, all without touching a single spreadsheet or asking your team to sit through hours of reading.
The approach combines three AI tools, each handling one part of the job well. Accio-ai extracts and structures data from your e-commerce platform. Copy-ai performs nuanced sentiment and theme analysis on the extracted reviews. Terrakotta-ai generates inventory recommendations based on that analysis. We will wire them together using one of four orchestration platforms, depending on your technical comfort and existing stack.
The Automated Workflow
Setting Up the Orchestration Layer
Your choice of orchestration tool matters less than you might think; all four options handle this workflow adequately. Zapier suits teams with zero engineering resources. n8n works well if you host it internally or want full control of your data. Make offers a middle ground with a visual builder and good API support. Claude Code provides a programmatic approach for developers comfortable with Python scripts.
For this walkthrough, we will show the n8n approach, as it gives you complete visibility into the data flow and works equally well whether you self-host or use n8n Cloud.
Step 1: Trigger and Data Extraction
Your workflow starts with a schedule or webhook trigger. Most e-commerce platforms offer either scheduled webhooks or API polling endpoints for recent reviews. In n8n, create an HTTP Request node that calls your platform's review API at regular intervals (typically once per day, or every few hours if you process high volumes).
GET /api/v1/reviews?created_after=2024-01-15T00:00:00Z&limit=100&status=approved
Host: your-ecommerce-platform.com
Authorization: Bearer YOUR_API_TOKEN
This request should return a JSON array of reviews. A typical response looks like this:
{
"reviews": [
{
"id": "review_12345",
"product_id": "prod_789",
"product_name": "Cotton T-Shirt",
"product_sku": "SHIRT-NAVY-M",
"rating": 4,
"title": "Great fit, runs a bit small",
"body": "I usually wear a medium but had to size up with this shirt. The fabric is soft and colours are true, but it shrinks slightly if you use hot water.",
"created_at": "2024-01-15T14:23:00Z",
"reviewer_name": "Sarah M"
},
{
"id": "review_12346",
"product_id": "prod_789",
"product_name": "Cotton T-Shirt",
"product_sku": "SHIRT-NAVY-L",
"rating": 5,
"title": "Perfect",
"body": "Ordered a large as recommended and it fits perfectly. Very durable.",
"created_at": "2024-01-15T16:45:00Z",
"reviewer_name": "James K"
}
],
"total_count": 2,
"page": 1
}
Store this response in an n8n variable for use in the next step. Map the reviews into a flat structure that includes product identifiers and the full review text.
Step 2: Sentiment and Theme Analysis with Copy-ai
Once you have the reviews, send them to Copy-ai for analysis. Copy-ai's API accepts batches of text and returns structured sentiment scores, detected themes, and key phrases. You will use n8n's Function node to batch the reviews (grouping by product) before calling the API.
POST /api/v1/analyse/batch
Host: api.copy-ai.com
Authorization: Bearer YOUR_COPY_AI_API_KEY
Content-Type: application/json
{
"texts": [
{
"id": "review_12345",
"content": "I usually wear a medium but had to size up with this shirt. The fabric is soft and colours are true, but it shrinks slightly if you use hot water.",
"context": "product_review"
},
{
"id": "review_12346",
"content": "Ordered a large as recommended and it fits perfectly. Very durable.",
"context": "product_review"
}
],
"analyse_for": ["sentiment", "themes", "keywords"]
}
Copy-ai returns structured data:
{
"results": [
{
"id": "review_12345",
"sentiment": {
"score": 0.72,
"label": "positive"
},
"themes": [
{
"name": "sizing",
"sentiment": -0.4,
"mentions": ["runs small", "size up"]
},
{
"name": "fabric_quality",
"sentiment": 0.85,
"mentions": ["soft", "true colours"]
},
{
"name": "care_instructions",
"sentiment": -0.3,
"mentions": ["shrinks", "hot water"]
}
],
"keywords": ["medium", "large", "soft", "colours", "shrink", "water"]
},
{
"id": "review_12346",
"sentiment": {
"score": 0.95,
"label": "very_positive"
},
"themes": [
{
"name": "sizing",
"sentiment": 0.9,
"mentions": ["fits perfectly", "large"]
},
{
"name": "durability",
"sentiment": 0.95,
"mentions": ["very durable"]
}
],
"keywords": ["large", "perfect", "durable"]
}
]
}
In n8n, map this response to another intermediate variable, preserving both the sentiment scores and the theme data for the next step.
Step 3: Inventory Recommendations from Terrakotta-ai
Now you aggregate the Copy-ai results by product and SKU, then send them to Terrakotta-ai. Terrakotta-ai specialises in inventory optimisation; it takes theme data, sentiment patterns, and sales history to generate specific stock adjustment recommendations.
Before calling Terrakotta-ai, use an n8n Function node to aggregate themes by SKU:
const reviewsByProduct = {};
// Group Copy-ai results by product SKU
inputData.analysisResults.forEach(review => {
const sku = review.product_sku;
if (!reviewsByProduct[sku]) {
reviewsByProduct[sku] = {
product_name: review.product_name,
themes: {},
sentiment_scores: [],
review_count: 0
};
}
reviewsByProduct[sku].sentiment_scores.push(review.sentiment.score);
reviewsByProduct[sku].review_count += 1;
review.themes.forEach(theme => {
if (!reviewsByProduct[sku].themes[theme.name]) {
reviewsByProduct[sku].themes[theme.name] = {
avg_sentiment: 0,
mentions: []
};
}
reviewsByProduct[sku].themes[theme.name].mentions.push(...theme.mentions);
});
});
// Calculate average sentiment per theme
Object.keys(reviewsByProduct).forEach(sku => {
const product = reviewsByProduct[sku];
product.avg_sentiment = product.sentiment_scores.reduce((a, b) => a + b, 0) / product.review_count;
Object.keys(product.themes).forEach(themeName => {
const theme = product.themes[themeName];
theme.mention_count = theme.mentions.length;
});
});
return reviewsByProduct;
This produces aggregated data per SKU. Then call Terrakotta-ai's recommendation endpoint:
POST /api/v1/inventory/recommendations
Host: api.terrakotta-ai.com
Authorization: Bearer YOUR_TERRAKOTTA_API_KEY
Content-Type: application/json
{
"products": [
{
"sku": "SHIRT-NAVY-M",
"product_name": "Cotton T-Shirt",
"current_stock": 45,
"average_sentiment": 0.72,
"review_themes": {
"sizing": {
"mention_count": 3,
"dominant_issue": "runs_small"
},
"fabric_quality": {
"mention_count": 2,
"sentiment_trend": "positive"
},
"care_instructions": {
"mention_count": 1,
"dominant_issue": "shrinkage"
}
},
"review_count": 3,
"sales_velocity_per_week": 12
},
{
"sku": "SHIRT-NAVY-L",
"product_name": "Cotton T-Shirt",
"current_stock": 28,
"average_sentiment": 0.95,
"review_themes": {
"sizing": {
"mention_count": 2,
"sentiment_trend": "positive"
},
"durability": {
"mention_count": 1,
"sentiment_trend": "positive"
}
},
"review_count": 2,
"sales_velocity_per_week": 18
}
],
"recommendation_style": "conservative"
}
Terrakotta-ai returns specific recommendations:
{
"recommendations": [
{
"sku": "SHIRT-NAVY-M",
"recommendation": "reduce",
"reason": "Multiple reports of poor fit and care issues driving down sentiment despite positive fabric feedback",
"current_stock": 45,
"recommended_stock": 25,
"action": "Reduce medium size orders by 45% to free up capital for high-performing sizes",
"confidence": 0.82
},
{
"sku": "SHIRT-NAVY-L",
"recommendation": "increase",
"reason": "Consistently positive sentiment with higher sales velocity and strong fit feedback",
"current_stock": 28,
"recommended_stock": 50,
"action": "Increase large size orders by 75% in next purchase cycle",
"confidence": 0.88
}
]
}
Step 4: Store Results and Notify
Save the recommendations to a Google Sheet, a database, or send them directly to your inventory management system via API. In n8n, use a Google Sheets node to append recommendations, or call your internal inventory API:
POST /api/inventory/adjustment-queue
Host: your-internal-system.com
Authorization: Bearer INTERNAL_TOKEN
Content-Type: application/json
{
"adjustments": [
{
"sku": "SHIRT-NAVY-M",
"action": "reduce_orders",
"percentage": 45,
"reason": "Poor fit and care reviews",
"recommendation_id": "rec_5678",
"generated_at": "2024-01-15T18:30:00Z"
},
{
"sku": "SHIRT-NAVY-L",
"action": "increase_orders",
"percentage": 75,
"reason": "Strong positive sentiment and sales velocity",
"recommendation_id": "rec_5679",
"generated_at": "2024-01-15T18:30:00Z"
}
]
}
Add a final step in your orchestration to send a summary email or Slack message to your inventory team with the top recommendations and confidence scores.
In n8n, use the Slack node:
const summary = `
Inventory Review Analysis Complete
High Confidence Recommendations:
• SHIRT-NAVY-L: Increase orders by 75% (confidence: 88%)
• SHIRT-NAVY-M: Reduce orders by 45% (confidence: 82%)
Key Insights:
• Large size has 95% average positive sentiment vs 72% for medium
• Recurring issue: Medium size runs small (mentioned 3 times)
• Large size praised for fit and durability
Recommendations stored in Google Sheet: [link]
`;
return {
text: summary,
channel: '#inventory-alerts'
};
Save your n8n workflow and set it to run on a daily schedule or whenever new reviews arrive.
The Manual Alternative
If you prefer to review and approve recommendations before they touch your inventory system, add a pause step in your workflow. After Terrakotta-ai generates recommendations, use n8n's "Wait for Webhook" node to hold execution until your inventory manager approves via email or form submission.
Alternatively, export the recommendations to a dedicated Google Sheet with a status column. Your team reviews the suggestions, marks them "approved" or "needs discussion", and a second workflow triggers on those approvals to push changes to your inventory system. This gives you human oversight while still eliminating the initial analysis burden.
Pro Tips
Track Your Confidence Scores
Terrakotta-ai returns a confidence score with each recommendation. Early on, only action recommendations with confidence above 0.85. As the system collects more data and learns your product patterns over months, you can lower that threshold. This prevents you from making costly inventory mistakes based on small sample sizes.
Monitor Copy-ai Theme Detection Drift
After your first month of automation, manually spot-check a sample of reviews and the themes Copy-ai identified. If it consistently misses certain issues (e.g., confusing "durability" with "quality"), adjust your Copy-ai request to specify those exact themes upfront in the analyse_for parameter. This improves accuracy without needing retraining.
Set Rate Limit Buffers
Copy-ai allows 100 requests per minute on standard plans; Terrakotta-ai allows 50 per minute. If you have high review volume, batch your reviews into groups of 20-25 and stagger API calls with 1-2 second delays between batches using n8n's "Wait" node. This prevents hitting limits during peak times.
Cost Savings: Analyse Only High-Impact Reviews
Do not send every review to Copy-ai. Filter out 1-star and 5-star reviews with no text body (they add noise). Focus your analysis on 2-, 3-, and 4-star reviews where customers explain their reasoning. This cuts API costs by 30-40% while improving recommendation quality.
Archive Old Recommendations
Keep a running log of which recommendations you actioned and their outcomes. After two months, compare Terrakotta-ai's recommendations to your actual inventory changes and sales results. This feedback loop helps you spot whether certain product categories need different recommendation thresholds or whether specific themes (like "sizing") warrant manual review regardless of confidence score.
Cost Breakdown
| Tool | Plan Needed | Monthly Cost | Notes |
|---|---|---|---|
| Accio-ai | Professional | £45 | 10,000 API requests/month; sufficient for daily review extraction |
| Copy-ai | Standard | £49 | 5,000 requests/month; batch reviews to stay within limit |
| Terrakotta-ai | Business | £89 | Unlimited recommendation API calls; includes 3-month historical analysis |
| n8n | Cloud Pro | £20 | 200,000 task executions/month; covers daily workflow runs plus retries |
| Total | £203/month | Scales to £400/month if you add Slack Pro and Google Sheets paid tier |
This cost assumes roughly 500-1000 reviews processed per month and daily workflow execution. If you self-host n8n (free, but requires server), you save £20 monthly. If you use Zapier instead of n8n, expect £50-80 per month depending on task volume.
The return on investment typically appears within the first quarter. A typical mid-size e-commerce business with stock carrying costs around 20-25% annually sees £400-800 monthly savings from reduced overstock and better-stocked fast-movers.