Alchemy RecipeIntermediateautomation

Manufacturing quality inspection report generation from photo documentation

Published

Manufacturing quality control is tedious and expensive. Inspectors photograph defects, damage, and assembly issues on the production line, then spend hours documenting findings in spreadsheets or formal reports. Each photo requires manual review, categorisation, and written description. When you're running multiple production lines, this process becomes a bottleneck that costs time and introduces human error.............

The real problem is the gap between documentation and reporting. Photos exist in one system, quality metrics live in another, and final reports get written in a third. There's no connection between them. A single defect photo might need to be reviewed by quality assurance, cross-referenced with historical data, converted into structured findings, and then formatted into a professional report. Most facilities do this manually, losing hours per shift.

This Alchemy workflow solves that by chaining three complementary tools together: AI-Boost analyses the photos for defects, Hour One generates a professional video summary of findings, and Terrakotta AI structures everything into a formal inspection report. The entire process runs without manual handoff; your orchestration tool handles the data flow.

The Automated Workflow

This workflow is designed for n8n, though Zapier and Make will work equally well. The key difference is that n8n gives you finer control over conditional logic and data transformation, which matters when inspection results vary significantly.

Step One:

Photo Upload and Trigger

Set up an n8n workflow with a cloud storage trigger. If you're using Google Drive, use the "Google Drive" node with a folder watch:


Trigger Node: Google Drive
- Watch Folder: /Manufacturing/Quality Inspections
- File Type: Images (jpg, png)
- Trigger Event: New File

Alternatively, if you're using Webhook input (preferred for real-time SLA control), create a simple HTTP POST endpoint that inspectors can call from a mobile app:


POST /api/inspection/upload
Content-Type: application/json

{
  "inspection_id": "QC-2024-001523",
  "production_line": "Assembly Line 3",
  "timestamp": "2024-01-15T14:32:00Z",
  "image_url": "s3://manufacturing-photos/QC-2024-001523.jpg",
  "metadata": {
    "shift": "morning",
    "operator_id": "EMP-4421",
    "station": "Solder Joint Inspection"
  }
}

This approach means you control when analysis starts rather than depending on file system polling, which reduces API calls and costs.

Step Two:

Image Analysis with AI-Boost

AI-Boost specialises in computer vision for manufacturing defects. Its API can classify damage types, measure defect severity, and flag critical issues.

Create an HTTP request node in n8n that sends the image URL to AI-Boost:


POST https://api.ai-boost.io/v2/inspect/defects
Authorization: Bearer YOUR_AI_BOOST_API_KEY
Content-Type: application/json

{
  "image_url": "{{ $json.image_url }}",
  "inspection_type": "solder_joint",
  "output_format": "structured",
  "confidence_threshold": 0.75,
  "include_measurements": true
}

AI-Boost returns a structured JSON response:

{
  "inspection_id": "QC-2024-001523",
  "defects": [
    {
      "type": "cold_solder",
      "severity": "high",
      "confidence": 0.92,
      "location": {
        "x_percent": 42,
        "y_percent": 58
      },
      "description": "Cold solder joint detected at pin 7; insufficient wetting observed",
      "recommended_action": "Rework required"
    },
    {
      "type": "component_misalignment",
      "severity": "medium",
      "confidence": 0.87,
      "location": {
        "x_percent": 18,
        "y_percent": 31
      },
      "description": "IC package rotated 2.3 degrees from specification",
      "recommended_action": "Monitor; rework if rotation exceeds 3 degrees"
    }
  ],
  "overall_pass": false,
  "pass_rate": 0.68
}

In n8n, assign this output to a variable you'll use in the next step. Use a "Set" node:


Set Node Configuration:
- defect_analysis = {{ $json }}

Step Three:

Structure Data with Terrakotta AI

Terrakotta AI is designed specifically for manufacturing compliance documentation. It takes raw inspection data and converts it into formal quality report structures that meet ISO 13849 and similar standards.

Send the defect analysis from Step Two to Terrakotta:


POST https://api.terrakotta-ai.com/v1/reports/quality
Authorization: Bearer YOUR_TERRAKOTTA_API_KEY
Content-Type: application/json

{
  "inspection_id": "{{ $json.inspection_id }}",
  "production_line": "{{ $json.production_line }}",
  "inspection_timestamp": "{{ $json.timestamp }}",
  "defects": {{ JSON.stringify($json.defects) }},
  "operator_id": "{{ $json.metadata.operator_id }}",
  "station": "{{ $json.metadata.station }}",
  "report_format": "detailed_compliance",
  "include_recommendations": true,
  "include_metrics_summary": true
}

Terrakotta responds with a structured report body:

{
  "report_id": "RPT-2024-001523",
  "title": "Quality Inspection Report - Assembly Line 3",
  "inspection_date": "2024-01-15",
  "summary": {
    "total_defects": 2,
    "critical_defects": 1,
    "pass_rate": "68%",
    "recommendation": "Unit requires rework before release"
  },
  "findings": {
    "critical": [
      {
        "defect": "Cold Solder Joint",
        "location": "Pin 7",
        "standard_reference": "IPC-A-610-F",
        "corrective_action": "Rework with approved solder profile",
        "priority": 1
      }
    ],
    "non_critical": [
      {
        "defect": "Component Misalignment",
        "location": "IC Package Position",
        "standard_reference": "IPC-A-610-F",
        "corrective_action": "Verify within tolerance range",
        "priority": 2
      }
    ]
  },
  "compliance_checklist": {
    "visual_inspection": "pass",
    "dimensional_check": "fail",
    "functional_readiness": "unknown"
  }
}

Store this structured report in another n8n variable for use in the final document.

Step Four:

Generate Video Summary with Hour One

Hour One specialises in AI-generated video presentations. You can use it to create a professional video walkthrough of the inspection findings, which is useful for team briefings or record-keeping.

Send the structured report to Hour One:


POST https://api.hourone.ai/v2/videos/generate
Authorization: Bearer YOUR_HOUR_ONE_API_KEY
Content-Type: application/json

{
  "script": "Quality Inspection Summary for Production Line 3. Date: January 15, 2024. Total Defects Identified: 2. Critical Issues: 1. Pass Rate: 68 percent. Critical Finding: Cold solder joint detected at pin 7 requiring immediate rework. Secondary Finding: Component misalignment within acceptable tolerance. Recommendation: Unit must undergo rework before release to production. Detailed findings documented in attached report.",
  "avatar": "professional_male",
  "background": "corporate_blue",
  "duration": "auto",
  "output_format": "mp4",
  "quality": "1080p"
}

Hour One returns a video URL and metadata:

{
  "video_id": "VID-2024-001523",
  "status": "completed",
  "video_url": "https://videos.hourone.ai/VID-2024-001523.mp4",
  "duration_seconds": 45,
  "created_at": "2024-01-15T14:45:22Z"
}

Store this URL in another n8n variable. Note that Hour One processing typically takes 30–90 seconds depending on script length.

Step Five:

Assemble Final Report and Save

In the final n8n step, combine everything into a structured document. Use Google Docs, a PDF template system, or direct database insertion. Here's an example using a Google Docs template:


HTTP Request Node:
POST https://docs.googleapis.com/v1/documents/{{ $json.doc_template_id }}/batchUpdate
Authorization: Bearer YOUR_GOOGLE_OAUTH_TOKEN
Content-Type: application/json

{
  "requests": [
    {
      "replaceText": {
        "text": "{{INSPECTION_ID}}",
        "replaceText": "{{ $json.inspection_id }}"
      }
    },
    {
      "replaceText": {
        "text": "{{REPORT_DATE}}",
        "replaceText": "{{ $json.timestamp }}"
      }
    },
    {
      "replaceText": {
        "text": "{{FINDINGS_SUMMARY}}",
        "replaceText": "{{ $json.structured_report.findings }}"
      }
    },
    {
      "replaceText": {
        "text": "{{VIDEO_LINK}}",
        "replaceText": "{{ $json.video_url }}"
      }
    }
  ]
}

Finally, save the completed document to your records system. If you're using a manufacturing database, write the report ID and all metadata:


Database Insert Node (example for PostgreSQL):
INSERT INTO quality_inspections 
(inspection_id, report_id, production_line, pass_rate, critical_defects, video_url, document_url, created_at)
VALUES 
('{{ $json.inspection_id }}', '{{ $json.report_id }}', '{{ $json.production_line }}', {{ $json.pass_rate }}, {{ $json.critical_defects }}, '{{ $json.video_url }}', '{{ $json.document_url }}', NOW());

n8n Workflow JSON Structure

Here's the approximate node structure you'll need in n8n (simplified pseudocode):

{
  "nodes": [
    {
      "type": "webhook",
      "name": "Inspection Upload Trigger",
      "operation": "POST /api/inspection/upload"
    },
    {
      "type": "http",
      "name": "AI-Boost Defect Analysis",
      "method": "POST",
      "url": "https://api.ai-boost.io/v2/inspect/defects"
    },
    {
      "type": "http",
      "name": "Terrakotta Structuring",
      "method": "POST",
      "url": "https://api.terrakotta-ai.com/v1/reports/quality"
    },
    {
      "type": "http",
      "name": "Hour One Video Generation",
      "method": "POST",
      "url": "https://api.hourone.ai/v2/videos/generate"
    },
    {
      "type": "http",
      "name": "Update Google Doc",
      "method": "POST",
      "url": "https://docs.googleapis.com/v1/documents/batchUpdate"
    },
    {
      "type": "database",
      "name": "Log to Quality Database",
      "operation": "INSERT"
    }
  ]
}

The Manual Alternative

If you prefer not to use an orchestration tool, you can run each step separately:

  1. Upload the photo to Google Drive and share the link.

  2. Go to AI-Boost's web dashboard, paste the image URL, and download the JSON results.

  3. Copy the defect data into a spreadsheet and manually enter it into Terrakotta's web interface to generate the structured report.

  4. Write a script or blog post, then upload it to Hour One's dashboard and wait for video generation.

  5. Copy the video URL and defect findings into a Google Doc template and manually format everything.

This approach takes 15–20 minutes per inspection instead of 2–3 minutes with automation, and introduces multiple points where data can be mistyped or forgotten. It's viable only for low-volume inspections (fewer than five per week) or as a fallback when automation fails.

Pro Tips

Rate Limiting and API Quotas. AI-Boost allows 100 requests per minute on the standard plan; Terrakotta and Hour One allow 50 per minute. If you're running multiple production lines, stagger requests using n8n's "Rate Limit" node set to 45 requests per minute to stay safely under quota. This prevents failed API calls at peak inspection times.

Error Handling and Retries. Add error handlers in n8n for when AI-Boost returns a low-confidence result (below 0.70). Configure n8n to automatically retry AI-Boost requests twice with a 5-second delay. If confidence remains low, flag the inspection for manual human review and send a Slack notification to your quality team. This prevents false passes or failures from cascading into your final report.

Image Optimisation. Compress images to under 2 MB before sending to AI-Boost. Smaller files are processed faster and cost less. Use ImageMagick or a similar tool in your n8n workflow:


bash convert input.jpg -resize 1920x1080 -quality 85 output.jpg

Cost Optimisation Through Conditional Logic. Not every inspection requires a video summary. Use Terrakotta's pass/fail result to decide conditionally: only generate Hour One videos for inspections with critical defects or failures. Add a conditional node in n8n: "If critical_defects > 0, then call Hour One; else skip." This cuts Hour One costs by 60–75% without losing quality documentation.

Timestamping and Audit Trails. Always log the exact timestamp when each API call completes. Terrakotta includes ISO timestamps in its responses; make sure your database schema stores these. This is vital for compliance audits and for correlating inspection findings with production logs. Add a timestamp field to every database insertion.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
AI-BoostProfessional£1805,000 inspections/month; £0.036 per image over quota
Terrakotta AIStandard£240Unlimited structured reports; includes compliance templates
Hour OneBusiness£300100 videos/month; £3 per additional video
n8n (self-hosted)Open Source£0Or £20/month for n8n Cloud with 100,000 executions
n8n (cloud alternative)Pro Plan£40500,000 executions/month; ideal for growing teams
Google Docs APIFree£0Part of Google Workspace; included with enterprise plans
Database Storage (PostgreSQL on AWS RDS)db.t3.micro£25Minimal for inspection metadata; scale as needed
Total (typical setup)£785–825Supports 5,000–10,000 inspections monthly

If you run this workflow for high-volume manufacturing (20,000+ inspections monthly), negotiate volume pricing with AI-Boost and Hour One; expect 20–30% discounts. Terrakotta's pricing is already fixed, so it remains cost-effective at scale.

More Recipes