Back to Alchemy
Alchemy RecipeAdvancedworkflow

Manufacturing quality inspection reports from shop floor photos to compliance filing

A factory floor produces hundreds of inspection photos daily. Each one contains critical data: cracks, surface defects, dimensional variations, material discolouration. Yet today, a quality manager prints these images, scribbles notes by hand, then transcribes everything into compliance reports. Hours vanish. Data entry errors compound. Audit trails disappear. The regulatory paperwork that should protect the business becomes a bottleneck instead. This workflow is common because it feels safe. Photos are tangible. A human signature on a report feels like accountability. But what if you could extract structured defect data from photos automatically, cross-reference it against compliance templates, generate compliant documentation, and route it for approval, all without anyone typing a single line? The good news: you can build this. It requires five tools and an orchestration layer, but the result is a system that turns photos into filed reports in minutes rather than hours.

The Automated Workflow

Start with n8n as your orchestration backbone. It's self-hosted, flexible, and handles file uploads cleanly. Here's the flow: 1. A quality inspector uploads a photo to a shared cloud folder (Google Drive, Dropbox, or OneDrive).

  1. n8n detects the new file and forwards it to Pixelcut AI for enhancement.

  2. The enhanced image is sent to Deep Angel to remove irrelevant objects and highlight defects.

  3. The cleaned image and any metadata (part number, line number, shift) feed into Claude Opus 4.6 via a vision API call to extract structured defect data.

  4. That structured data, plus regulatory templates stored as PDFs, go into Chat With PDF by Copilot.us to match defects against known issues and severity thresholds.

  5. Copy.ai generates a compliance-ready narrative report using the extracted data.

  6. The final report is saved to a secure archive and a notification triggers approval workflows downstream. Let's wire this together.

Step 1: File Detection in n8n

Create a trigger node that watches your cloud storage. For Google Drive:

{ "trigger": "google_drive.watch", "folder_id": "YOUR_FOLDER_ID", "file_types": ["image/jpeg", "image/png"], "poll_interval_seconds": 60
}

Step 2: Image Enhancement with Pixelcut AI

Pixelcut accepts direct image uploads via their REST API. Send the raw inspection photo:

POST https://api.pixelcut.io/v1/process
Content-Type: application/json
Authorization: Bearer YOUR_PIXELCUT_KEY { "image_url": "gs://drive-link-to-inspection-photo.jpg", "enhancement_type": "defect_highlight", "contrast_boost": 1.3, "clarity_filter": true
}

Pixelcut returns an enhanced image URL. Store this in n8n's internal memory for the next step.

Step 3: Object Removal with Deep Angel

Deep Angel specialises in removing distracting background elements. Pass the enhanced image:

POST https://api.deepangel.io/remove
Content-Type: application/json
Authorization: Bearer YOUR_DEEPANGEL_KEY { "image_url": "pixelcut-enhanced-image-url", "remove_objects": ["background_clutter", "hands", "tools"], "focus_region": "center_70_percent"
}

This returns a cleaned image focused on the actual defect area.

Step 4: Defect Data Extraction with Claude Opus 4.6

Now send both the original metadata and cleaned image to Claude for structured analysis:

POST https://api.anthropic.com/v1/messages
Content-Type: application/json
Authorization: Bearer YOUR_CLAUDE_KEY { "model": "claude-opus-4.6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "image", "source": { "type": "url", "url": "deep-angel-cleaned-image-url" } }, { "type": "text", "text": "Extract defects from this inspection photo. Return JSON with: defect_type, severity (1-5), location, dimensions_mm, confidence_percent. Part number: ABC-123, Line: 4, Shift: morning. Use null for unmeasurable values." } ] } ]
}

Claude returns structured JSON:

json
{ "defects": [ { "defect_type": "surface_crack", "severity": 3, "location": "upper_right_quadrant", "dimensions_mm": "2.4 x 0.8", "confidence_percent": 87 }, { "defect_type": "colour_variation", "severity": 2, "location": "centre", "dimensions_mm": null, "confidence_percent": 72 } ], "overall_pass_fail": "fail", "metadata": { "part_number": "ABC-123", "line": 4, "shift": "morning" }
}

Step 5: Compliance Matching with Chat With PDF

Your factory maintains PDF files with acceptance criteria, past defect records, and regulatory standards. Chat With PDF ingests these files and answers questions about your extracted data. In n8n, make a request:

POST https://api.chatwithpdf.com/v1/query
Content-Type: application/json
Authorization: Bearer YOUR_CHATPDF_KEY { "pdf_ids": ["acceptance_criteria.pdf", "iso_9001_requirements.pdf"], "query": "Part ABC-123 with surface crack 2.4mm x 0.8mm in upper right at severity 3. Does this meet acceptance criteria? Which regulatory standard applies?"
}

Chat With PDF returns a structured response that flags whether the defect violates standards, which specification applies, and whether the part should be scrapped or reworked.

Step 6: Report Generation with Copy.ai

Feed your extracted defects, compliance decision, and metadata into Copy.ai to generate a formal report narrative:

POST https://api.copy.ai/v1/generate
Content-Type: application/json
Authorization: Bearer YOUR_COPYAI_KEY { "template": "quality_inspection_report", "variables": { "part_number": "ABC-123", "defects_json": "{\"defect_type\": \"surface_crack\", \"severity\": 3, ...}", "compliance_status": "non_conforming", "applicable_standard": "ISO 9001:2015 Section 8.6", "recommendation": "scrap", "inspector_id": "QM-042", "timestamp": "2026-03-15T08:42:00Z" }, "tone": "formal", "output_format": "markdown"
}

Copy.ai returns a ready-to-file report in Markdown that you can convert to PDF.

Step 7: Archive and Approval Trigger

In your n8n workflow, write the final report to a compliance archive folder and trigger an approval webhook if the part is non-conforming:

javascript
const finalReport = { part_number: defectData.metadata.part_number, inspection_date: new Date().toISOString(), defects: defectData.defects, compliance_decision: complianceMatch.status, generated_report: copyaiOutput, images: { original: originalPhotoUrl, enhanced: pixelcutUrl, cleaned: deepangelUrl }
}; // Save to archive
await n8n.saveToCloudStorage('compliance-archive', finalReport, `${defectData.metadata.part_number}_${Date.now()}.json`); // Trigger approval workflow if non-conforming
if (complianceMatch.status === 'non_conforming') { await n8n.webhook('https://your-approval-system.com/initiate', finalReport);
}

This ensures every report is logged and escalations happen automatically.

The Manual Alternative

If you prefer human oversight at key junctures, remove Claude from the loop initially. Instead, send enhanced photos directly to a shared channel (Slack, Teams) where quality engineers review and annotate them manually. Then feed their annotations into Copy.ai to generate reports. This is slower but gives you a grace period to validate the system's accuracy before full automation. Alternatively, run the entire pipeline but require human sign-off before Copy.ai generates the final report. An n8n approval node can pause the workflow and wait for a manager to confirm the extracted defect data before proceeding.

Pro Tips

1. Manage image file sizes carefully.

Deep Angel and Pixelcut both charge per API call. Downsampling inspection photos to 1200×1200 pixels before upload saves bandwidth and cost with negligible loss of defect visibility. Add this as an n8n pre-processing step.

2. Cache compliance PDFs in Chat With PDF.

Don't upload your regulatory documents every run. Ingest them once, store their IDs, and reference them in queries. This cuts API costs and response time.

3. Build a feedback loop.

Store human corrections when quality engineers override Claude's severity ratings. Use these to fine-tune your extraction prompt every month. Claude gets smarter when you feed it real errors.

4. Rate limit Claude calls.

If multiple inspectors upload simultaneously, n8n will queue requests. Set a max of 5 parallel vision API calls to avoid hitting Anthropic's rate limits. Queue excess jobs for the next hour.

5. Archive everything.

Store original photos, enhanced versions, cleaned images, extracted JSON, and final reports together in a timestamped folder structure. Auditors will demand a complete chain of custody. Make this automatic in n8n.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
n8nSelf-hosted Community Edition£0Free; you host it. Pay for your server only.
Pixelcut AIPay-as-you-go£20–50~500–1000 inspections per month at standard rates.
Deep AngelPay-as-you-go£15–40Each removal call costs pence. Budget conservatively.
Claude Opus 4.6Pay-as-you-go£40–100Vision API calls are 3–4× text-only cost. 1000 inspections ≈ 1000 API calls.
Chat With PDFProfessional£20/monthUnlimited document uploads and queries after subscription.
Copy.aiStarter£29/monthUnlimited monthly generations after tier paid.
Cloud storageGoogle Drive / OneDrive£10–20For file detection trigger and archive.
Total£134–259/monthScales roughly linearly with inspection volume above 500/month.