{
  "name": "Automate pharmaceutical COA verification & vendor scoring with AI document analysis",
  "nodes": [
    {
      "id": "749d6e84-82dc-4df7-b227-26332fb8d539",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -304
      ],
      "parameters": {
        "width": 192,
        "height": 560,
        "content": "## 🚀 COA Upload Trigger\n\n• What: Webhook receives COA PDF upload from vendor portal or email.\n• Why: Instant intake for raw materials—ensures no delays in quality gatekeeping.\n• Flows to: Data extract"
      }
    },
    {
      "id": "ed586df5-0640-4cc2-b5e1-13acef3308fe",
      "name": "Load Sample COA Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1248,
        96
      ]
    },
    {
      "id": "3a53d05f-28a5-441d-8049-78b5cbc4412e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        -304
      ],
      "parameters": {
        "width": 198,
        "height": 560,
        "content": "## 📄 Parse COA Specs & Tests\n\n• What: Extracts key data like purity levels, batch IDs, and test results from PDF.\n• Why: Automates manual reading errors (common in pharma audits)—pulls 99% accuracy.\n•"
      }
    },
    {
      "id": "f88c5c6f-7c38-457a-ad4e-851a51d9cc2d",
      "name": "Analyze Specifications",
      "type": "n8n-nodes-base.code",
      "position": [
        -1024,
        96
      ]
    },
    {
      "id": "be7d9c31-e30e-423f-a556-a29b88afc991",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -304
      ],
      "parameters": {
        "width": 176,
        "height": 560,
        "content": "## 🔍 Compliance Deep Dive\n\n• What: Compares extracted test results against regulatory specs (e.g., USP limits).\n• Why: Spots deviations like impurity spikes early—avoids costly recalls downstream.\n• F"
      }
    },
    {
      "id": "fd162b9a-8f25-4b0c-a6ea-aa1a973012b7",
      "name": "Calculate Vendor Score",
      "type": "n8n-nodes-base.code",
      "position": [
        -800,
        96
      ]
    },
    {
      "id": "5cfa6d41-6c09-4b32-8b63-3a491134072a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        -304
      ],
      "parameters": {
        "width": 192,
        "height": 560,
        "content": "## 📊 Weighted Quality Rating\n\n• What: Scores vendor on factors like on-spec rate, historical compliance (0-100).\n• Why: Quantifies risk—prioritizes trusted suppliers, cuts rejection rates by 25%.\n• Fl"
      }
    },
    {
      "id": "6e4cc431-8058-40fa-8e8a-7383dba51bf1",
      "name": "Check Compliance Status",
      "type": "n8n-nodes-base.if",
      "position": [
        -576,
        96
      ]
    },
    {
      "id": "d8364d1b-f664-4a2c-9415-d7ddfb63d1d5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -304
      ],
      "parameters": {
        "width": 176,
        "height": 560,
        "content": "## ⚖️ Approval Gatekeeper\n\n• What: If score ≥85% and no flags, route to approved; else, reject path.\n• Why: Binary decision prevents gray areas—ensures FDA-traceable verdicts.\n• Branches to: Generate "
      }
    },
    {
      "id": "91d1433a-92b3-4ac3-843f-5ccb60b10cd9",
      "name": "Generate Approval Certificate",
      "type": "n8n-nodes-base.code",
      "position": [
        -352,
        0
      ]
    },
    {
      "id": "55201108-cf6f-467a-9699-77109efe1eba",
      "name": "Generate Rejection Report",
      "type": "n8n-nodes-base.code",
      "position": [
        -352,
        192
      ]
    },
    {
      "id": "2f34aa47-75e4-4375-9946-f13ade2a275f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -336
      ],
      "parameters": {
        "width": 220,
        "height": 416,
        "content": "## ✅ Cert Generator\n\n• What: Creates digital approval PDF with COA refs and release stamp.\n• Why: Speeds production release—reduces hold times from days to hours.\n• Flows to: Vendor data update; auto-"
      }
    },
    {
      "id": "5b87d6b5-d180-4f4d-8d0a-5e12b0d9433d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        336
      ],
      "parameters": {
        "width": 220,
        "height": 320,
        "content": "## ❌ Rejection Doc Creator\n\n• What: Builds detailed rejection report citing spec failures and evidence.\n• Why: Clear rationale reduces vendor disputes—documents for CAPA triggers.\n• Flows to: CAPA req"
      }
    },
    {
      "id": "64e3af9c-5ae4-483b-a3cb-8c495c70c566",
      "name": "Update Vendor Database",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -128,
        96
      ]
    },
    {
      "id": "2a0ef0b6-524c-4255-9860-e5fe05a26a19",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -320
      ],
      "parameters": {
        "width": 172,
        "height": 560,
        "content": "## 💾 Compliance Ledger Update\n\n• What: Logs approved COA to database with scores and timestamps.\n• Why: Builds audit trail—tracks vendor performance for quarterly reviews.\n• Flows to: Notifications; s"
      }
    },
    {
      "id": "51cdcd64-e3a0-421d-af69-6184c2c20b17",
      "name": "Send Email Notification",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        96,
        96
      ]
    },
    {
      "id": "12207b76-b8a1-4dfd-b0bc-ddf34e378755",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -320
      ],
      "parameters": {
        "width": 156,
        "height": 560,
        "content": "## 📧 Alert Teams: Go Live\n\n• What: Emails QA/procurement with approval details, cert link, and summary.\n• Why: Loops in stakeholders fast—enables immediate material use, no silos.\n• Flows to: Final re"
      }
    },
    {
      "id": "54c24b7d-f856-4cdd-89f4-bced87c96cb2",
      "name": "Generate Final Report",
      "type": "n8n-nodes-base.code",
      "position": [
        320,
        96
      ]
    },
    {
      "id": "c4f98f28-994e-4473-92a1-0e331c018225",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -320
      ],
      "parameters": {
        "width": 172,
        "height": 560,
        "content": "## 📈 Exec Summary Builder\n\n• What: Compiles full COA analysis with scores, flags, and verdicts into dashboard PDF.\n• Why: One-click insights for management—highlights trends like vendor improvements.\n"
      }
    },
    {
      "id": "06c39bc1-94a8-4973-8e41-f3e8e2c08087",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1472,
        96
      ]
    },
    {
      "id": "801791b8-6925-4b8c-a9ec-928aa618c0fb",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -752
      ],
      "parameters": {
        "width": 704,
        "height": 336,
        "content": "## How it works\nThis workflow automates COA (Certificate of Analysis) verification for pharmaceutical raw materials. It extracts specifications, checks compliance, rates vendor quality, and updates re"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Load Sample COA Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Sample COA Data": {
      "main": [
        [
          {
            "node": "Analyze Specifications",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Specifications": {
      "main": [
        [
          {
            "node": "Calculate Vendor Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Vendor Score": {
      "main": [
        [
          {
            "node": "Check Compliance Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Vendor Database": {
      "main": [
        [
          {
            "node": "Send Email Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Compliance Status": {
      "main": [
        [
          {
            "node": "Generate Approval Certificate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Rejection Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Notification": {
      "main": [
        [
          {
            "node": "Generate Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Rejection Report": {
      "main": [
        [
          {
            "node": "Update Vendor Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Approval Certificate": {
      "main": [
        [
          {
            "node": "Update Vendor Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}