E-commerce Recommendation Engine (n8n)
Production recommendation backend: n8n + PostgreSQL, 4 modes (trending/co-purchase/personalized/repurchase), 74 nodes, webhook API, daily scheduler. No custom server required.
Custom e-commerce order data via REST API
4-algorithm recommendation engine with upsert, daily scheduler, webhook API
Production recommendation engine built entirely with n8n + PostgreSQL — no Python server, no ML infrastructure.
4 Recommendation Algorithms
| Mode | Algorithm | Use Case |
|---|---|---|
| Trending | Most purchased in rolling 7-day window | Homepage |
| Co-purchase | Market basket analysis | "Frequently bought with" |
| Personalized | Customer history → top unordered | Returning customers |
| Repurchase | Previously bought consumables | Replenishment emails |
Architecture (74 nodes)
POST /import-orders → validate client → upsert to PostgreSQL
POST /generate-recs → fetch orders → run algorithms → upsert results
GET /get-recs → fetch by mode + client_id
GET /customer-recs → personalized + repurchase merged
ScheduleTrigger (daily) → purge orders > 90 days
Market Basket SQL Pattern For each order pair (A,B) bought by same customer: increment co_purchase_count(A,B). Query returns items with highest count for current product.
Why n8n Over Python? Typical recommendation backends require: model serving, Python env, monitoring, retraining. This delivers 4 recommendation modes with pure SQL + webhooks, deployable in hours, maintainable without code.