How milosmrsovic/competitor-price-automation works
This repository demonstrates scheduled competitor-price monitoring and automated product repricing. The principal workflow collects regional market offers, filters and records them, computes a median, then lets n8n compare it with the current price and either request an update or notify that no change is needed. A Flask page demonstrates the resulting price. The README documents the n8n stages and email integration; the workflow JSON is present in the tree, but its contents were not sampled, so those stages are represented only as documented.
Main entry points: main.py FastAPI service · CompetitionWorkflown8n.json 5% decision · check_competiton.py Competitor collector · product_data.json Product data JSON
Components 17
Workflow orchestration
- Schedule trigger
CompetitionWorkflown8n.json - Normalize values
CompetitionWorkflown8n.json - Calculate difference
CompetitionWorkflown8n.json - 5% decision
CompetitionWorkflown8n.json - Update email
CompetitionWorkflown8n.json - Aligned email
CompetitionWorkflown8n.json
Market data collection
- Competitor collector
check_competiton.py - Offer filtering
check_competiton.py - Price results CSV
Price service and state
- FastAPI service
main.py - Product data JSON
Web_Example/product_data.json - Median calculation
main.py
Product display
- Flask product page
Web_Example/app.py - Product view
Web_Example/templates/product.html
Other components
- SerpAPI Shopping
- Store visitor
- Email provider
Connections 21
- Schedule trigger → FastAPI service: requests GET
- FastAPI service → Competitor collector: runs script
- Competitor collector → Product data JSON: reads product
- Competitor collector → SerpAPI Shopping: searches regions
- Competitor collector → Offer filtering: validates offers
- Offer filtering → Price results CSV: writes offers
- FastAPI service → Price results CSV: reads prices
- FastAPI service → Median calculation: calculates median
- FastAPI service → Product data JSON: reads current price
- FastAPI service → Normalize values: returns price data
- Normalize values → Calculate difference: passes numbers
- Calculate difference → 5% decision: passes difference
- 5% decision → FastAPI service: requests POST update
- FastAPI service → Product data JSON: saves new price
- 5% decision → Update email: above threshold
- 5% decision → Aligned email: at or below
- Update email → Email provider: sends update
- Aligned email → Email provider: sends status
- Store visitor → Flask product page: requests page
- Flask product page → Product data JSON: reads product
- Flask product page → Product view: renders page