Batch 1b: This endpoint runs in parallel with Batch 1a (update-ai-site).
Itβs completely decoupled - no scraped content needed.
What This Endpoint Does
- β
Fetch products from Shopify
/products.json - β Compare hash to detect changes
- β Save NEW products to database
- β
Generate prompts for NEW products (calls
generate_prompts_for_productinternally) - β
Generate
/llms/{slug}.txtfor NEW products (callsgenerate_product_llms_txtinternally) - β
Return files for combined deploy (when
skip_deploy=True)
How It Works
Hash-Based Change Detection
Instead of re-processing all products every time, we use efficient change detection:- products_hash - MD5 hash of sorted product handles
- products_snapshot - Full product list from last sync
Request Body
Response
Database Updates
Database Columns Used (ai_sites)
Code Location
Internal Services Called
This endpoint internally calls these shared services:Why all-in-one? For the cron job, we want a single endpoint that handles
the entire product discovery flow. The separate endpoints (
generate-product-prompts,
generate-product-llms-txt) exist for manual triggering and debugging.