Automation · 08
AI Photobook Creative Production + QA
An n8n workflow that turns a short brief and a set of photos into a finished four-page photobook PDF. Gemini reviews the photos and picks a template, code builds the layout, and a quality check decides whether the book ships or goes to a person, so a broken file is caught before delivery.
- Stack
- n8n
- Gemini
- PDFShift
- Google Drive
Overview
The problem. A personalised photobook means choosing which photos go where, matching a style and checking the final file. Letting AI design whole pages is unpredictable, and a broken PDF shouldn't be delivered.
What I built. I built a form-to-PDF pipeline in n8n. Gemini analyses each photo and chooses one of eight fixed templates, code renders the pages and validates them before PDFShift creates the PDF, and Gemini then checks the PDF for blank pages or missing photos. A hard-versus-soft QA policy saves passing books to Google Drive and sends hard failures to a manual review folder.
Why it helps. Books are produced from a short brief, and only files that pass the checks are delivered.
System flow
- An n8n form collects the brief and the photos. Nodes: n8n Form Trigger (Photobook Brief Form); Edit Fields (Set) (Prepare Photobook Brief). Next: Inspect & split photos.
- Checks the files and splits them for analysis. Nodes: Code ×2 (Inspect Photo Files, Split Photos for Analysis). Next: Gemini photo analysis, Optimize for render.
- Gemini describes each photo. Nodes: Google Gemini (Analyze Photo); Code (Collect Photo Analyses). Next: Template planner.Each photo is resized for the layout. Nodes: Edit Image (Optimize Render Photo); Code (Collect Optimized Photos). Next: Render & validate.
- Gemini Flash Lite picks from 8 fixed templates and plans the pages. Nodes: Basic LLM Chain (Smart Template Planner); Google Gemini Chat Model (Gemini Flash Lite (Planner)); Code (Build Render Data). Next: Render & validate.
- The pages are rendered and a technical validator checks them before any PDF credits are used. Nodes: Merge (Combine Plan + Photos); Code ×2 (Render Template Photobook, Technical Validator); IF (Render Valid?). Next: Generate the PDF, Manual review.
- PDFShift turns the render into a PDF. An error goes to manual review. Nodes: HTTP Request · PDFShift (Generate Photobook PDF). Next: AI quality check, Manual review.
- Gemini Flash Lite reviews the PDF: hard issues block it, soft ones become warnings. Nodes: Code ×2 (PDF Gate + QA Prompt, QA Policy (Hard vs Soft)); Google Gemini (Lightweight QA (Flash Lite)); IF (Ship?). Next: Save to Drive, Manual review.
- Saved to the AI Photobooks folder. Nodes: Code ×2 (Attach Original PDF, Final Photobook Result); Google Drive (Save Photobook to Drive). End of flow.Saved to Needs manual review with the reason. Nodes: Code ×2 (Prepare Manual Review, Manual Review Result); Google Drive (Save Manual Review PDF). End of flow.
