Automation Workflow Module

The Wiring
Nobody Sees.
Nineteen Nodes.

n8n is the glue: a single workflow accepts a document on a webhook, routes it through OCR and AI classification, hands it to the right extractor, aggregates the results across disciplines, and calls the backend to generate and distribute the report — no manual step in between.

What the Workflow Does

Nineteen nodes, one continuous path: trigger, retrieve, extract, classify, route, analyze, hand off. Every branch — S-curve, manpower, cost, or the generic fallback — rejoins before the cross-discipline analysis, so nothing produces an orphaned result.

🪝
Webhook Trigger
Accepts a POST with a PDF URL, an Excel file, and project metadata — n8n itself, a script, or another system can all kick off a run.
📥
Retrieve & Read
Fetches the PDF as binary data and reads the Excel file's sheets in parallel — both source types processed in the same run.
🤖
AI Classification Agent
A LangChain agent backed by GPT-4o-mini classifies discipline, document type, and sub-category, with a code node parsing and validating the JSON response.
🔀
Specialized Routing
A switch node sends each document to the matching extractor — S-Curve/EVR, Manpower, Cost, or a generic fallback — based on the classification result.
🧮
Merge & Analyze
All extractor outputs merge back into one stream, get grouped by discipline, and feed a cross-discipline intelligence step that ranks and recommends.
📡
Authenticated Handoff
The final payload is POSTed to the backend's webhook with an API-key header — the same contract documented on the Reports · Notifications page.

Who Touches the Workflow

Automation / DevOps Engineers

Own the n8n instance, credentials, and Docker Compose deployment — the only people who should be editing node parameters directly.

Project Controls Teams

Trigger runs by uploading documents to whatever front end calls the webhook — they never see the workflow's internals.

Backend Developers

Consume the workflow's output at the webhook endpoint and don't need to understand n8n's node graph to build against it.

IT / Security

Manage the OpenAI, OCR Space, and webhook API key credentials, plus SSL/TLS and basic-auth on the n8n instance itself.

Every Downstream Connection

The workflow is deliberately the only piece that talks to OpenAI and OCR Space directly — everything downstream only ever sees the structured JSON it produces.

OpenAI GPT-4o-mini Classification agent credential, called once per document with a fixed three-level classification prompt.
OCR Space API PDF-to-text extraction with table detection enabled, called before content is handed to the classification agent.
Backend Webhook POST /api/notifications/webhook — same endpoint documented under Reports · Notifications, authenticated via a shared WEBHOOK_API_KEY.
Deployment Docker Compose with basic auth, environment-based credentials, and a documented backup strategy for the n8n data volume.

Full Circle

Back to where the document came in

The workflow's first stop is the Data Extraction Engine — see how a raw file becomes structured metrics before it ever reaches this pipeline.