Alchemy RecipeIntermediateautomation

Manufacturing quality report generation from inspection data

Published

Quality control in manufacturing remains stubbornly manual. Your inspection team gathers data from machines, sensors, and visual assessments. Someone then spends hours collating this information, writing up findings, formatting tables, and distributing reports to stakeholders. This work is repetitive, error-prone, and delays decision-making by days................... For more on this, see Manufacturing quality inspection report generation from p.... For more on this, see Manufacturing quality report generation from inspection p....

The problem compounds when you have multiple inspection points across a facility. Data lives in different systems, formats vary wildly, and there's always a risk that someone transcribes a critical measurement incorrectly. By the time a quality report reaches management, the insights are stale and opportunities for immediate corrective action have passed.

This Alchemy recipe shows you how to automate the entire journey from raw inspection data to polished quality reports. You'll combine three specialist tools, wire them together with an orchestration platform, and eliminate the manual handoff entirely. Reports that took a day to produce now generate in minutes, consistently formatted and fully accurate.

The Automated Workflow

Overview of the workflow

The workflow follows this sequence: inspection data arrives in your system; it's standardised and enriched; a report is generated; and it's delivered to stakeholders. Here's how each step works:

  1. Accio-AI extracts and structures unstructured inspection data (photos, handwritten notes, sensor logs).
  2. Cogram transforms and validates the extracted data, applying business rules and calculations.
  3. Terrakotta-AI generates a professional quality report with charts, summaries, and compliance flags.
  4. An orchestration tool ties everything together and sends the final report where it needs to go.

Choosing your orchestration platform

For this workflow, I recommend n8n over Zapier or Make. Here's why: you'll need conditional logic (if defect count exceeds threshold, flag it), you'll want to handle retries gracefully, and you'll benefit from n8n's built-in error notifications. Zapier can work, but you'll hit its action limits quickly. Make is viable but requires more manual node configuration.

Setting up the workflow in n8n

Start a new n8n workflow. You'll need API keys from all three tools.

Step 1: Trigger on new inspection data

Your inspection data likely arrives via one of these channels: an HTTP webhook, a Google Sheet update, a database query, or an email. For this example, assume inspection records land in a PostgreSQL database table called inspections.

Set up an n8n "PostgreSQL" node with a scheduled trigger to poll for new records every 15 minutes:

SELECT
  id,
  inspection_date,
  station_id,
  inspector_name,
  notes,
  sensor_readings,
  photo_urls,
  status
FROM inspections
WHERE processed = false
AND inspection_date >= NOW() - INTERVAL '1 hour'
ORDER BY inspection_date DESC

This returns unprocessed inspections from the last hour. You'll mark them as processed once the workflow completes.

Step 2: Extract and structure data with Accio-AI

Accio-AI specialises in extracting information from messy sources. Create an Accio-AI node that sends raw inspection notes and sensor data for parsing:

{
  "content": "Inspector notes: Surface finish poor on widget batch 4521. Measurements: length 45.2mm (spec 45.0±0.3), width 23.8mm (spec 24.0±0.2), depth 12.1mm (spec 12.0±0.1). Three micro-scratches visible on face A.",
  "extraction_schema": {
    "batch_id": "string",
    "measurements": {
      "length": {
        "value": "number",
        "unit": "string",
        "spec_min": "number",
        "spec_max": "number"
      },
      "width": {
        "value": "number",
        "unit": "string",
        "spec_min": "number",
        "spec_max": "number"
      },
      "depth": {
        "value": "number",
        "unit": "string",
        "spec_min": "number",
        "spec_max": "number"
      }
    },
    "defects": [
      {
        "type": "string",
        "severity": "enum: minor|major|critical",
        "location": "string"
      }
    ],
    "surface_quality": "string"
  }
}

The Accio-AI endpoint typically looks like this:


[POST](/tools/post) https://api.accio-ai.com/v1/extract
Authorization: Bearer YOUR_ACCIO_API_KEY
Content-Type: application/json

Configure your n8n node to send the PostgreSQL row data (notes, sensor readings) to Accio-AI and capture the structured JSON response.

Step 3: Validate and transform with Cogram

Cogram takes the structured data and applies business logic. It checks whether measurements fall within tolerance, flags defects based on severity, calculates reject rates, and enriches data with historical context.

Create a Cogram node that receives the Accio-AI output:

{
  "inspection_id": "{{ $node['PostgreSQL'].json.id }}",
  "station_id": "{{ $node['PostgreSQL'].json.station_id }}",
  "extracted_data": "{{ $node['Accio-AI'].json }}",
  "rules_to_apply": [
    "check_tolerance_violations",
    "calculate_defect_density",
    "flag_batch_for_rework",
    "compare_to_historical_average"
  ],
  "include_trend_analysis": true,
  "output_format": "structured_report_data"
}

Cogram's API endpoint:


POST https://api.cogram.ai/v1/transform
Authorization: Bearer YOUR_COGRAM_API_KEY
Content-Type: application/json

Cogram returns validated, enriched data with pass/fail flags, trend indicators, and calculated metrics. Store this response in a variable for the next step.

Step 4: Generate the report with Terrakotta-AI

Terrakotta-AI creates polished, professional documents. It takes structured data and produces a formatted quality report with charts, tables, and executive summaries.

Create a Terrakotta-AI node:

{
  "report_type": "quality_inspection",
  "title": "Manufacturing Quality Report: {{ $node['PostgreSQL'].json.inspection_date }}",
  "inspection_metadata": {
    "station": "{{ $node['PostgreSQL'].json.station_id }}",
    "inspector": "{{ $node['PostgreSQL'].json.inspector_name }}",
    "date": "{{ $node['PostgreSQL'].json.inspection_date }}"
  },
  "data_sections": [
    {
      "section_name": "Dimensional Measurements",
      "data": "{{ $node['Cogram'].json.validated_measurements }}"
    },
    {
      "section_name": "Defect Analysis",
      "data": "{{ $node['Cogram'].json.defect_summary }}"
    },
    {
      "section_name": "Trend Analysis",
      "data": "{{ $node['Cogram'].json.historical_trends }}"
    },
    {
      "section_name": "Pass/Fail Determination",
      "data": "{{ $node['Cogram'].json.compliance_status }}"
    }
  ],
  "include_charts": true,
  "chart_types": [
    "measurement_distribution",
    "defect_frequency",
    "trend_line"
  ],
  "output_format": "pdf"
}

Terrakotta-AI endpoint:


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

This returns a PDF file URL and metadata. Download the PDF or store its location.

Step 5: Conditional branching for compliance issues

Add an n8n "IF" node to check the compliance status from Cogram. If the batch failed inspection or has critical defects, route it to an alert workflow. Otherwise, route to standard distribution.


IF $node['Cogram'].json.compliance_status == 'FAIL' OR
   $node['Cogram'].json.critical_defects_count > 0
THEN send alert email
ELSE send routine report

Step 6: Send the report to stakeholders

Use n8n's "Email" node or "Slack" node to distribute the report.

For email distribution:

{
  "to": "{{ $node['PostgreSQL'].json.assigned_to_email }}",
  "cc": "quality-team@company.com",
  "subject": "Quality Report: Batch {{ $node['PostgreSQL'].json.batch_id }} - {{ $node['Cogram'].json.compliance_status }}",
  "body": "Please see attached quality report for inspection conducted on {{ $node['PostgreSQL'].json.inspection_date }}.",
  "attachments": [
    {
      "url": "{{ $node['Terrakotta-AI'].json.report_url }}",
      "filename": "QualityReport_{{ $node['PostgreSQL'].json.batch_id }}_{{ now.toFormat('yyyy-MM-dd') }}.pdf"
    }
  ]
}

Step 7: Update the database to mark as processed

Finally, add a PostgreSQL node to mark the inspection as processed:

UPDATE inspections
SET processed = true, processed_at = NOW(), report_url = '{{ $node['Terrakotta-AI'].json.report_url }}'
WHERE id = {{ $node['PostgreSQL'].json.id }}

Data flow summary

The data moves like this: raw inspection record → Accio-AI extracts structure → Cogram validates and enriches → Terrakotta-AI generates PDF → email/Slack distributes → database marks complete. Each step produces output that feeds into the next, with no manual intervention.

Error handling in n8n

Set up error handlers at critical points. If Accio-AI fails to parse notes, retry twice with a 30-second delay, then alert the quality manager via Slack. If Terrakotta-AI's PDF generation times out, store the structured data in a fallback location and send an alert.

In n8n, add an error handler node to your Accio-AI step:

{
  "node_type": "error_handler",
  "trigger": "on_failure",
  "action": "retry",
  "retry_count": 2,
  "retry_interval": 30,
  "fallback_action": "send_slack_notification",
  "notification_channel": "#quality-alerts"
}

The Manual Alternative

Some teams prefer more control over each step. You could set up a Google Form for inspectors to submit data, review the Accio-AI extraction manually before sending it to Cogram, and approve each report in Terrakotta-AI before distribution.

This approach takes longer, usually 2 to 4 hours per batch, but it lets you catch errors and tweak outputs. It's useful during the first few weeks of deployment while your extraction schemas settle. Once you're confident in the accuracy, disable the approval steps and run fully automated.

You can implement this in n8n by adding a "Human Approval" node between Cogram and Terrakotta-AI. The node emails the quality lead with extracted data and asks for approval or corrections. Workflow resumes only after approval.

Pro Tips

1. Start with clean source data

Before connecting Accio-AI, audit your inspection notes for consistency. If inspectors use wildly different terminology or abbreviations, Accio-AI will struggle. Spend a few hours standardising your note templates. This pays off immediately in extraction accuracy.

2. Build extraction schemas iteratively

Don't try to define your Accio-AI schema perfectly upfront. Extract 10 sample inspections, review the output, refine the schema, and repeat. After 3 iterations, your schema will capture 95% of cases correctly. The remaining 5% often require manual intervention, which is acceptable.

3. Cache Cogram rules in n8n variables

If you run multiple workflows using the same business rules, store the rules as n8n global variables instead of hardcoding them into each workflow. You can then update rules in one place, and all workflows use the new version immediately.

4. Monitor API rate limits

Accio-AI allows 100 extractions per minute; Cogram allows 50 transformations per minute; Terrakotta-AI allows 20 reports per minute. If you have dozens of inspections arriving simultaneously, you'll hit Cogram's limit. Add a queue in n8n using a delay node to space requests across time.

5. Archive reports in object storage

Don't rely on Terrakotta-AI's URL storage indefinitely. Set up a webhook that saves each generated PDF to AWS S3 or Google Cloud Storage. This gives you a permanent archive and makes historical searches faster.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
Accio-AIStandard£1205,000 extractions/month; includes support
CogramProfessional£20010,000 transformations/month; includes API access
Terrakotta-AIBusiness£1501,000 reports/month; PDF generation included
n8n (self-hosted)Community (free)£0Requires server; can run on existing infrastructure
n8n (cloud)Pro£40Managed platform; good for smaller teams
Total£510–550Covers 1,000+ inspections/month; scales well

If you use Zapier instead of n8n, add £50-100/month depending on action volume. If you use Make (Integromat), add £15-30/month. For teams just starting out, the n8n Community edition (self-hosted) is free and handles this workflow easily on modest hardware.

The ROI typically appears within two months. If your team currently spends 20 hours per week on report generation, at £25/hour loaded cost, that's £2,000/week. Automation cuts that to 2 hours weekly for monitoring and exceptions, saving £1,800/week or £7,200/month.

More Recipes