How moseskakuno/ai-workflow-automation works
This Streamlit application takes a user-uploaded PDF invoice through text extraction, AI-based field extraction, deterministic financial validation and risk flagging, then presents results for human approval or clarification. The app also persists invoice records and timestamped workflow events in SQLite, displays the archive and history, and offers a JSON report download. The sampled code shows the processing and persistence calls; approval routing is partly handled in the UI. Other README capabilities are represented where documented, but no external OCR or separate routing service is evidenced.
Main entry points: workflow.py PDF processing · database.py Persistence operations · app.py Streamlit workflow UI · ai_processor.py AI field extraction
Components 16
Invoice interface
- Streamlit workflow UI
app.py - PDF upload
app.py - Review and decisions
app.py - History and archive views
app.py - JSON report export
app.py - Human approval
app.py
Invoice processing
- PDF processing
workflow.py - PDF text extraction
workflow.py - AI field extraction
ai_processor.py - Financial validation
validators.py - Risk assessment
validators.py - Approval routing
app.py
Workflow records
- Persistence operations
database.py - SQLite archive and history
database.py
Other components
- Invoice user
- OpenAI API
Connections 18
- Invoice user → Streamlit workflow UI: uses
README.md - Streamlit workflow UI → PDF upload: presents
app.py - PDF upload → PDF processing: submits PDF
app.py - PDF processing → PDF text extraction: extracts text
workflow.py - PDF processing → AI field extraction: requests extraction
workflow.py - AI field extraction → OpenAI API: sends invoice text
ai_processor.py - PDF processing → Financial validation: validates data
workflow.py - Financial validation → Risk assessment: flags threshold
validators.py - PDF processing → Review and decisions: returns results
workflow.py - Review and decisions → Approval routing: uses validation
app.py - Approval routing → Human approval: allows review
app.py - Streamlit workflow UI → Persistence operations: initializes and records
app.py - Review and decisions → Persistence operations: saves status
app.py - History and archive views → Persistence operations: queries records
app.py - JSON report export → Invoice user: downloads report
app.py - Persistence operations → SQLite archive and history: reads and writes
database.py - Human approval → Persistence operations: updates status
app.py - Invoice user → Human approval: decides
README.md