gitwtfhub

wtf is invoice-automation?

elvaceishim/invoice-automation — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 4/5Setup · hard

TL;DR

An AI pipeline that reads incoming invoices with an LLM, checks them against business rules, and auto-approves or flags them for human review, tested on synthetic data with measured accuracy.

Mindmap

mindmap
  root((invoice-automation))
    What it does
      Reads PDF invoices
      Validates against rules
      Auto-approves or flags
      Logs every decision
    Tech stack
      Python
      FastAPI
      PostgreSQL
      n8n
      Docker Compose
    Use cases
      Invoice extraction
      Automated approval
      Human escalation
    Testing
      Synthetic PDFs
      Measured accuracy
      Deliberate edge cases

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Automatically extract vendor, total, and invoice number from incoming PDF invoices using an LLM.

REASON 2

Run extracted invoice data through business rules to auto-approve or flag it for a manager.

REASON 3

Route only the invoices that fail validation to a human, with an explanation of what looked wrong.

What's in the stack?

PythonFastAPIPostgreSQLn8nDocker ComposeTelegram Bot API

How it stacks up

elvaceishim/invoice-automation0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires running multiple services (n8n, FastAPI, PostgreSQL) plus an OpenRouter API key, full steps are in SETUP.md.

No license is stated in the README, so usage rights are unclear.

Wtf does this do

This project automates a task that most companies still do by hand: opening every incoming invoice, checking whether it is from a known vendor, checking whether the math adds up, checking whether it needs a manager's sign-off, and deciding whether to pay it or flag it for review. The author built two AI-backed services that split this work the way two people in a small back office might. The first service only reads. It takes a PDF invoice and pulls out who it is from, what was bought, and what the total is, using a large language model instead of a rigid template matcher, so it keeps working even when a vendor changes their invoice layout. The second service only judges. It takes that extracted summary and checks it against a set of business rules, such as whether the vendor is approved, whether the total matches, and whether the amount is within a spending limit. If everything checks out it approves the invoice automatically, if something is wrong, it states exactly what and why, so a human reviewer does not have to start from scratch. Because the author did not have access to real company invoices, they built a test set of 30 synthetic PDF invoices with known correct answers, deliberately broken in six specific ways. On that test set, extraction succeeded on 29 of 30 invoices with full field accuracy, and validation made the correct approve-or-flag decision on all 29 that reached it. The one extraction failure, caused by a free-tier model timing out, was logged and routed to a human rather than guessed at. The pipeline runs as a webhook that receives a PDF, calls the extraction service, then the validation service, stores every decision and reason in Postgres, and sends a Telegram alert only when a human needs to look at something. n8n orchestrates the whole flow. The README also documents specific bugs the author hit and fixed during development, including a model garbling part of an invoice number and free-tier rate limits interrupting a run. The stack is n8n, FastAPI, PostgreSQL, Docker Compose, Python, an LLM accessed through OpenRouter, and the Telegram Bot API. Full setup and evaluation steps are documented in a separate SETUP.md file rather than the README itself.

Yoink these prompts

Prompt 1
Explain how invoice-automation's extraction service and validation service divide the work between them.
Prompt 2
Walk me through how to set up invoice-automation locally using SETUP.md and Docker Compose.
Prompt 3
What business rules does the validation service check, and how would I add a new one?
Prompt 4
How does invoice-automation's n8n workflow route a PDF from webhook to Telegram alert?

Frequently asked questions

wtf is invoice-automation?

An AI pipeline that reads incoming invoices with an LLM, checks them against business rules, and auto-approves or flags them for human review, tested on synthetic data with measured accuracy.

What language is invoice-automation written in?

Mainly Python. The stack also includes Python, FastAPI, PostgreSQL.

What license does invoice-automation use?

No license is stated in the README, so usage rights are unclear.

How hard is invoice-automation to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is invoice-automation for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.