A fully automated quality audit pipeline that uses computer vision AI to score branch compliance across Mexico — replacing manual inspections with intelligent, fraud-resistant automation.
Arellano Global's end client operates 64 retail locations spread across 14 zones in Mexico. Maintaining consistent brand standards — from storefront signage to service area cleanliness — was impossible to enforce manually at scale.
Quality standards varied wildly by location. There was no systematic way to compare branch performance or enforce brand guidelines uniformly. Managers could submit recycled, downloaded, or outdated photos to pass audits — and without technical validation, there was no way to verify evidence authenticity.
Audit requests went unanswered for days. No automated follow-up, no escalation path for non-responders, no way to track who submitted on time. Leadership lacked consolidated reporting — no cross-branch rankings, zone comparisons, or trend data to inform strategic decisions about underperforming locations.
Five interconnected workflows on n8n that handle every stage of the audit lifecycle — from intelligent scheduling and evidence collection to AI-powered scoring, fraud detection, and executive reporting. The entire system is controlled from a single Google Sheet.
Each workflow operates independently with its own trigger, but they share state through Google Sheets and NocoDB — making the system resilient, portable, and easy to maintain.
Selects branches for daily auditing using a date-based dispatch guard with seeded LCG shuffle for fair rotation across 14-day cycles. Sends branded emails with personalized form links and a 30-minute deadline.
12 nodesThe core engine. Receives photo/video evidence via Formbricks webhook, runs 7-layer fraud detection, uploads to Google Drive, groups files by area, and sends each batch to Gemini Vision AI for scoring — all in under <60s.
77 nodesMonitors pending audits and sends up to 3 escalating reminders at 10-minute intervals. After 3 unanswered reminders, marks the audit as overdue and alerts the zone supervisor automatically.
19 nodesAggregates all audit scores and generates a 7-section branded PDF report: KPIs, zone performance, branch rankings, score distributions, overdue tracking, and detailed per-branch breakdowns.
26 nodesDownloads 21 branding reference files (17 images + 4 videos) from Google Drive, uploads them to the Gemini Files API one at a time to prevent memory issues, and caches the resulting URIs in NocoDB.
16 nodesA multi-layered fraud detection pipeline catches recycled photos, screenshots, tampered timestamps, and AI-generated images — before any scoring happens. Then 10 safeguards ensure the AI produces accurate, reproducible scores.
Images must contain camera Make/Model EXIF tags. Rejects screenshots, crops, WhatsApp forwards, and downloaded images.
EXIF creation timestamp must be within 30 minutes of upload. Catches old photos and future-dated fakes.
Video evidence must be 30–120 seconds. Filters out trivially short clips and stock footage.
Cycle-aware hash matching against NocoDB. Same file in a different cycle = fraud. Same cycle = re-submission (allowed).
If any single file fails validation, the entire submission is rejected — saving API costs and preventing partial fraud.
Gemini Vision scans for 7 fraud categories: screen recordings, stock photos, photos of screens, AI-generated images, recycled media, wrong location, and static video.
Post-AI validation cross-checks scores vs. findings. Fraud with a positive score is forced to zero. Contradictions are flagged automatically.
Gemini's response is constrained at the decode level with a strict JSON schema — types, enums, and required fields are enforced.
7 mandatory rules in every prompt: "only describe what you see", "don't copy criteria as findings." Forces factual analysis.
The AI must write a factual description of each image before scoring. Chain-of-thought anchors scores to visual evidence.
The final score is computed from individual criteria averages on the server — we never trust the AI's math.
High score + many negative findings? Score of 0 with no fraud? The system flags these contradictions automatically.
Each area is scored against branding reference images from a curated library. The AI sees what "good" looks like before evaluating.
The AI compares each submission to the same branch's previous audit — both text and images — for calibrated scoring over time.
Near-deterministic output ensures the same photo receives the same score regardless of when the audit runs.
All five workflows running in production on n8n Cloud with a 94.8% success rate. Here's the system in action.
All 64 branches audited on a fair 14-day rotation with anti-duplication guards. Branded emails, evidence submission, and AI-scored feedback — all without human intervention.
7 validation layers catch recycled photos, screenshots, tampered timestamps, and AI-generated fakes before they ever reach the scoring engine.
10 anti-hallucination safeguards ensure the AI describes what it sees, not what it imagines. Server-side recomputation produces reliable 0–10 scores per area.
Bi-weekly branded PDF reports with KPI summaries, zone rankings, score distributions, and per-branch breakdowns generated and emailed automatically.
All workflows fail-open on non-critical paths. Controlled from one Google Sheet, exportable as 5 JSON files — zero code changes to migrate.
Escalating reminders, automatic overdue classification, supervisor alerts, and end-to-end execution ID traceability ensure no audit falls through the cracks.
Client endorsement pending verification.
I build intelligent automation systems that replace manual processes with reliable, AI-powered workflows. Let's talk about your project.
Get in Touch →