01Hybrid - Python + n8n
Document Intelligence
A FastAPI microservice extracts structured data from PDF invoices; n8n orchestrates the business flow over an authenticated API.
FastAPIpypdfLangChainn8nPostgresDocker
The problem
A company receives invoices as PDF email attachments and wants them as clean, structured rows in a database, automatically. The parsing + schema-constrained LLM extraction is too complex for n8n alone.
What it proves
Knowing when to escape n8n's visual limits with robust code, and connecting the two cleanly over an authenticated HTTP API.
Architecture
- 1.n8n Email Trigger downloads the PDF attachment
- 2.HTTP node POSTs the file to the Python FastAPI service (with retries + x-api-key auth)
- 3.FastAPI extracts text (pypdf) and parses it into a validated Pydantic schema via an LLM
- 4.n8n stores the structured result in Postgres and sends a Telegram confirmation
- 5.A dedicated Error Trigger workflow alerts + logs any failure
Architecture diagram

Engineering highlights
- +Validated structured JSON output (no free-text parsing)
- +Authenticated API + 10MB cap + clean error envelopes
- +Node-level retries and a central Error Trigger workflow
Demo
Demo: email in -> structured row in Postgres + Telegram confirmation.
Demo recording placeholder (add a Loom link or demo.gif)