Back to Alchemy
Alchemy RecipeIntermediateautomation

Manufacturing quality reports from shop floor photos to compliance filing

Quality inspectors spend roughly three hours per shift just documenting what they've seen, transcribing notes, cross-referencing standards, and preparing the actual compliance filing. A factory with four inspectors means twelve hours of pure administrative overhead daily. That's not quality assurance; that's clerical work wearing a safety vest. The real problem is fragmentation. An inspector takes a photo on the shop floor, returns to the office, reviews it against the standard operating procedure document, makes notes in a spreadsheet, then manually ports that information into a compliance form. Each handoff introduces delay, mistakes, and the chance that critical details get lost in translation. This Alchemy workflow eliminates those handoffs. You photograph a defect, the system reads it, cross-references your SOP document automatically, drafts a report, and deposits it into your compliance filing system ready for signature. The entire loop runs without anyone touching it except at the start and end.

The Automated Workflow

You'll wire together four components: a document storage system for your SOPs, an AI image and text reader, a documentation tool that creates your compliance records, and an orchestration engine that connects them all.

Step 1: Capture and store the SOP document

Your quality standards document lives in a shared location; Chat With PDF by Copilot.us is your interface to it. Upload your SOP once, and the system becomes queryable. This means later, when you need to check whether a surface finish falls within spec, you're not searching a PDF manually.

Step 2: Build the orchestration spine with n8n

We're using n8n here rather than Zapier or Make because you need to orchestrate image analysis, multi-step document queries, and conditional logic. N8n gives you more control without requiring code. Start with a webhook trigger. When an inspector submits a photo from their phone or tablet, it hits your n8n instance:

POST /webhook/shop-floor-inspection
Content-Type: application/json { "photo_url": "https://storage.example.com/inspections/IMG_20260315_142501.jpg", "location": "Assembly Line 3", "inspector_id": "QI-047", "timestamp": "2026-03-15T14:25:01Z"
}

Step 3: Extract findings from the image

Route the photo URL to Claude Opus 4.6 via an HTTP Request node in n8n. Use the vision capability to describe what's in the image:

POST https://api.anthropic.com/v1/messages
Authorization: Bearer YOUR_ANTHROPIC_API_KEY
Content-Type: application/json { "model": "claude-opus-4.6", "max_tokens": 1024, "messages": [ { "role": "user", "content": [ { "type": "image", "source": { "type": "url", "url": "{{ $node["Webhook Trigger"].json.photo_url }}" } }, { "type": "text", "text": "Describe any visible defects, surface conditions, alignment issues, or non-conformances in this shop floor image. Be specific about location, size, and severity." } ] } ]
}

Claude returns a structured description of what the image shows. Store this in a temporary variable.

Step 4: Query the SOP document for applicable standards

Now pass Claude's findings to Chat With PDF by Copilot.us. Ask it to search your SOP document for the relevant standard or tolerance that applies to what you've just found:

POST https://api.chatpdf.example.com/v1/query
Authorization: Bearer YOUR_CHATPDF_API_KEY
Content-Type: application/json { "document_id": "SOP-2025-Quality-Standards", "query": "What are the acceptance criteria for {{ $node["Claude Vision"].json.body.content[0].text }}? Include tolerance ranges and reference standards."
}

This returns the exact specification from your SOP, so your report always cites the right standard.

Step 5: Generate the compliance report

Feed both the image findings and the SOP standards into Gemini 2.5 Pro to draft the compliance report. This model is particularly good at structured output, which is useful here:

POST https://generativelanguage.googleapis.com/v1/models/gemini-2.5-pro:generateContent?key=YOUR_GOOGLE_API_KEY
Content-Type: application/json { "contents": [ { "parts": [ { "text": "You are a quality assurance report writer. Using the inspection findings and the applicable SOP standard, generate a compliance report in this exact JSON format:\n\n{\n \"report_id\": \"QC-[DATE]-[LOCATION]-[SEQUENCE]\",\n \"inspection_date\": \"[ISO date]\",\n \"location\": \"[Shop floor location]\",\n \"inspector\": \"[Inspector ID]\",\n \"finding_summary\": \"[Concise description of what was found]\",\n \"applicable_standard\": \"[SOP reference]\",\n \"acceptance_criteria\": \"[Exact spec from SOP]\",\n \"result\": \"PASS\" or \"FAIL\",\n \"corrective_action\": \"[If FAIL, what must be done]\",\n \"filing_status\": \"READY_FOR_SIGNATURE\"\n}\n\nInspection findings: {{ $node["Claude Vision"].json.body.content[0].text }}\n\nApplicable standard: {{ $node["Chat With PDF"].json.answer }}" } ] } ]
}

Parse the JSON response and validate that all required fields are populated.

Step 6: File the report into NextStep for approval and tracking

NextStep is where the report enters your actual compliance workflow. It becomes a trackable task with a due date for review and sign-off:

POST https://api.nextstep.example.com/v1/tasks
Authorization: Bearer YOUR_NEXTSTEP_API_KEY
Content-Type: application/json { "title": "Quality Report {{ $node["Gemini Report"].json.report_id }}", "description": "{{ $node["Gemini Report"].json.finding_summary }}", "assigned_to": "quality-manager@company.com", "due_date": "{{ $now.add(1, 'days').format('YYYY-MM-DD') }}", "status": "PENDING_REVIEW", "metadata": { "location": "{{ $node["Webhook Trigger"].json.location }}", "inspector_id": "{{ $node["Webhook Trigger"].json.inspector_id }}", "report_id": "{{ $node["Gemini Report"].json.report_id }}", "finding_result": "{{ $node["Gemini Report"].json.result }}", "full_report": "{{ JSON.stringify($node["Gemini Report"].json) }}" }
}

A task lands in the quality manager's queue. If the result was FAIL, the task priority can escalate automatically.

Step 7: Handle failures gracefully

Add conditional logic to your n8n workflow. If Claude or Gemini fail to return useful data, log it and email the inspector a request for clarification:

IF $node["Claude Vision"].json.body.content[0].text == null OR length < 50
THEN POST to Slack/Email: "Inspection photo from [location] unclear. Please resubmit with better lighting." END workflow
ELSE Continue to next step
END

This prevents garbage reports from entering your compliance system.

The Manual Alternative

If you prefer not to set up orchestration, you can do this with less automation: inspectors upload photos to a shared folder, you manually paste the image URL into Claude Opus 4.6's web interface, ask it to describe the defect, then copy that description into Chat With PDF to look up the standard, then draft the report in Word. It's slower, but it's more transparent and gives you full control at each stage. This approach works if you have fewer than 10 inspections per week.

Pro Tips Error handling for image quality.

Not all shop floor photos are clear. Add a validation step where Claude assesses the image clarity first. If it returns a confidence score below 70%, reject the submission and ask the inspector to retake the photo. This prevents false positives entering compliance records. Rate limit your API calls. Chat With PDF and Claude have rate limits. If you're running dozens of inspections daily, batch them in n8n to avoid hitting limits. Use n8n's rate limit node to queue requests and space them out. Store the full audit trail. Every step of this workflow should log to a database or data warehouse. Compliance auditors want to see the original photo, the AI analysis, the SOP reference, and the final report. Store all of these together so you can prove the chain of reasoning. Use Freed AI for voice notes. If inspectors prefer to speak findings aloud rather than describe them in writing, integrate Freed AI. It converts speech to structured notes, which then feed into the same Claude and Chat With PDF queries. This cuts friction for field work. Cost-optimise with smaller models where possible. Use Claude Haiku 4.5 for the SOP queries; it's much cheaper than Opus and perfectly adequate for document lookup. Reserve Opus 4.6 for the final report generation where nuance matters.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Chat With PDF by Copilot.usPro£25–50Pay-as-you-go; includes multiple document uploads
Claude API (Opus 4.6, Haiku 4.5)Pay-as-you-go£30–100Estimated 50 inspections/month at ~$0.005 per image analysis
Gemini 2.5 Pro APIPay-as-you-go£15–40Report generation; cheaper than Opus for structured output
n8nHosted Pro£4530,000 executions/month; more than enough for typical factory
NextStepStandard£50–100Task management and approval tracking
Photo storage (AWS S3 or similar)Standard£5–10Depends on volume; ~50 GB/month for photos
Total (estimated)£170–300Scales with inspection frequency