All modules
Module 22 · ai · intermediate
AI Product Description Generator
After this module you can write on-brand descriptions for a whole catalog in batches, catch AI mistakes before customers see them, and publish to Shopify only after a human approves.
What it does
The demo brand is Juniper & Oak (home goods). Voice, audience, banned phrases and limits live in Settings.
| Entry | What happens |
|---|---|
Daily 7 AM (Shopify) or POST /webhook/pd/generate (products in the body) |
Pick products with missing, short (< 30 words) or placeholder text (TBD, lorem ipsum) copy, up to the batch size. OpenAI writes description, bullets, SEO title, meta description and tags in the brand voice (template from the facts if AI fails). Guardrails flag banned claims, numbers that aren't in the product data, length problems and thin data; SEO fields are cut to 60/155 characters; HTML is built and escaped by code. Drafts go to a review queue |
GET /webhook/pd/review |
The queue (?state=pending|rejected|published|all, or ?product_id= for one), issues first |
POST /webhook/pd/review/decide |
approve (optionally with edits) → Shopify product update (description + tags); reject with a note |
Body options for generate: dry_run, batch_size, force (rewrite existing copy), ai: false, source: "shopify", and per-product draft (check copy written elsewhere instead of generating).
Flow
Daily 7 AM / Generate API ─┐
Review API ────────────────┼→ Settings → Route ─generate→ Products from API? ─no→ Get Shopify Products ─┐
Decide API ────────────────┘ │ └yes──────────────────────────┴→ Pick Products → Use AI?
│ ─yes→ Write with AI (OpenAI, structured) ─┐
│ └no─────────────────────────────────────┴→ Join Branches (Merge) → Check Copy → Queue for Review → respond
├review→ Review Queue → respond
└decide→ Apply Decision → Publish? → Update Shopify Product → Record Publish → respond
Verification status (n8n 2.43.6)
- 23 behavior checks (40 assertions) without credentials: selection and skipping (incl. products already in review), batch size, force, template fallback when AI fails, bullets/HTML, SEO limits, tag merging, thin-data flag, guardrails on supplied copy (banned phrases, invented number vs real specs, word-boundary cut, HTML escaping, tag dedupe), queue ordering, versioning, reject, approve with edits (dry run), Shopify failures reported (draft stays pending).
- Not run with OpenAI or Shopify credentials (
WITH_CREDS=1 [SHOPIFY_PRODUCT_ID=…] ./test/test.sh). AI copy quality and the real Shopify update are unverified.
Files
| File | Tier | Purpose |
|---|---|---|
| lesson.md | Free | Step-by-step build, guardrail design |
| workflow/starter.json | Free | Triggers, Shopify fetch, product selection |
| workflow/learner.json | Learner | Finished workflow |
| workflow/code/ | Learner | Readable copies of the Code nodes + AI prompt |
| exercises.md | Learner | Practice tasks |
| solutions.md | Learner | Exercise solutions |
| notes.md | Private | Learning log |
| sell/ | Private | Offer, video script, blog post |