# Monitor Competitor Price Shifts with Slack Alerts

> Runs every morning to scrape competitor product pages with Apify, stores snapshots in Postgres, flags unusual moves with SQL views, and posts repricing commentary to Slack.

- URL: https://www.automongo.com/automations/monitor-competitor-price-shifts/
- Summary: Scrapes competitor pages daily and posts repricing commentary to Slack when prices move.
- Tools: n8n
- Difficulty: Advanced
- Category: Analytics
- Tags: price-monitoring, ecommerce, slack, postgres, openai
- Published: 2026-11-06
- External resource: https://n8n.io/workflows/19750-monitor-competitor-price-shifts-with-apify-postgres-openai-and-slack/?ref=ez5zfu33yh5f&utm_source=affiliate

## How It Works

A scheduled n8n workflow pulls a list of competitor product URLs, hands them to the Apify E-commerce Scraping Tool, stores one row per product per day in Postgres, and compares today against a trailing baseline to flag only the moves that matter. An AI agent writes the recommendation and posts it to Slack, while a second branch reports any URLs that failed to scrape.

### Setup Steps

1. **Install the Apify node**: Add the @apify/n8n-nodes-apify community node. On n8n Cloud, search for it on the canvas (the instance owner must have verified community nodes enabled); self-hosted, install it under Settings, Community nodes.
2. **Apply the Postgres schema**: Run supabase_schema.sql (linked in the sticky note) against Postgres 15 or later. It creates a private schema with RLS enabled, so the table is never exposed through Supabase's Data API.
3. **Add credentials**: Connect Apify, Postgres, a chat model, and Slack.
4. **Set your watchlist**: Open the Pages to watch node, replace the example URLs with yours, and point the workflow at your Slack channel.
5. **Confirm the timezone**: The schedule says 06:00 and n8n reads it in the instance timezone; adjust the instance or the trigger.
6. **Dry run once**: Trigger the workflow manually and confirm a row landed in pricing.price_history.

### Automation Workflow

```
Schedule (06:00)
    ↓
Read competitor URLs
    ↓
Apify E-commerce Scraping Tool
    ↓
Normalize prices, currency, stock
    ↓
Insert into Postgres (pricing.price_history)
    ↓
SQL view: compare to 30-day avg, 90-day low, 14-day baseline gate
    ↓
Branch
    ├→ Moves detected → AI agent writes recommendation → Slack
    └→ Scrape failures → Slack health warning
```

### Benefits

- **Transitions, not states**: The SQL view reports a price move once, so a rival who cuts and holds does not spam the channel every morning.
- **Deterministic detection**: Thresholds live in one SQL view (5% band, 90-day low, 14-day baseline gate); the model only writes, it never decides.
- **Locale-safe parsing**: Both 1.299,99 and $1,299.99 read correctly, and currency is stored as an ISO code rather than a symbol.
- **Scraping health signal**: A second branch flags URLs that returned nothing, so a broken product page does not look like a quiet market.
- **No scraper to maintain**: Apify handles anti-bot, proxies, and per-retailer extraction.

### Advanced Features

- Three-state stock field so "not reported" is kept separate from "out of stock".
- 14-day silence window before any alert fires, because a baseline of one day is noise.
- Private Postgres schema with row-level security and security_invoker views, keeping snapshots out of Supabase's Data API.
- Keyword mode option: run the Apify Actor in keyword mode once to harvest URLs, then pin them; keyword results drift daily and cannot produce a clean price series.
- Replace Slack with email, Sheets, or a webhook by swapping a single node.

### Use Cases

- Daily repricing commentary for ecommerce merchandising teams.
- Early warning on competitor flash sales and markdowns across a watchlist.
- Monitoring retailers for stock changes on key SKUs during peak season.
- Tracking price positioning for private-label launches against incumbent brands.
- Reporting scraping health so a dead product page does not quietly go unmonitored.
