Product

Everything you need to automate freight document processing

From supplier inbox to ERP — the complete technical picture of how Flowstate works.

The Pipeline

Every freight document takes the same deterministic path — from supplier inbox to ERP, with zero manual intervention at any step.

📧
Supplier Email
PDF attachment
📨
SendGrid
Inbound Parse
Flowstate API
FastAPI + Uvicorn
🤖
Gemini 2.5 Flash
AI extraction
Validation
Math + format checks
🏭
Your ERP
Clean JSON POST
Ingestion

Multipart form parsing extracts PDF attachments from raw SendGrid webhook payloads. Any attachment format, any PDF version.

Extraction

Gemini 2.5 Flash receives the PDF as a base64-encoded blob. It returns structured JSON with vendor, PO, line items, weights, and dates.

Egress

Validated JSON is POSTed to your ERP_WEBHOOK_URL via httpx. Flowstate logs the HTTP status, response time, and result hash.

Admin Dashboard

A real-time view into everything Flowstate is doing. Processing stats, event log, and a live PDF tester — all in one dark-mode dashboard.

Live processing stats and success rate
Timestamped event log with validation results
Drag-and-drop PDF tester for debugging
API key authentication — no login required
Open Dashboard →
flowstatelogistics.net/admin
Flowstate Admin
Processing overview — last 30 days
All systems operational
1,247
Documents processed
↑ 18% vs last month
99.2%
Success rate
↑ 0.4% vs last month
8.3s
Avg duration
↓ 1.2s improvement
10
Validation failures
All alerted in real-time
Recent Events
Timestamp Vendor PO # Status Duration
2026-03-24 14:32:11 Pacific Coast Supply PO-2847 ACCEPTED 2.3s
2026-03-24 13:18:44 Gulf Freight Solutions PO-2846 REJECTED 3.1s
2026-03-24 11:55:02 Midwest Logistics Co. PO-2845 ACCEPTED 1.9s

Validation Engine

Every extracted document is validated deterministically before any data is forwarded. Mathematical discrepancies are caught here — not discovered later in your ERP.

✓ Validation Passed
qty × unit_weight = total_weight
48 × 22.4 = 1,075.2
Stated total1,075.2 lbs
Calculated total1,075.2 lbs
Delta0.0
PO formatVALID
✓ STATUS_ACCEPTED — pushing to ERP
⚠ Validation Failed
qty × unit_weight = total_weight
48 × 20.6 = 987.6
Stated total1,075.2 lbs
Calculated total987.6 lbs
Delta87.6 lbs (8.1%)
PO formatVALID
⚠ STATUS_REJECTED — Slack + email alert sent

Tolerance handling: By default, a delta above 0.5% triggers a rejection. The threshold is configurable per client. Sub-threshold discrepancies are logged as warnings but do not block the ERP push.

Alert System

When validation fails, your team knows instantly — before bad data reaches your ERP. Alerts go to Slack and email simultaneously, with the full context needed to investigate.

Slack Alert
F
Flowstate Today at 2:32 PM
Validation failed on incoming document. ERP push has been blocked.
⚠️ Validation Failed — PO-2847
Vendor: Pacific Coast Supply Co.
Document: invoice_PO-2847.pdf
Issue: Math mismatch on line 2 — Δ87.6 lbs (8.1%)
Expected: 1,075.2 lbs  |  Got: 987.6 lbs
→ Review required before this document can be reprocessed
Email Alert

Zero Retention Architecture

Your documents are never written to disk, never persisted in any database, and never stored anywhere beyond the duration of processing. This is Ghost Protocol.

PDF Received
Raw bytes from SendGrid
BytesIO Buffer
In-memory only, never touches disk
Gemini API Call
Base64 encoded, TLS encrypted
Pydantic Validation
Structured data, still in-memory
ERP Push
JSON forwarded, original discarded
gc.collect()
Cryptographic wipe on every exit path
🔐 Zero bytes written to disk at any point in this flow
No PDF storageAttachments are never written to Railway's filesystem, S3, or any storage system. BytesIO buffers are the only container.
No document content loggingFlowstate logs event metadata — sender, timestamp, status — but never logs the contents of documents or extracted fields.
No third-party data sharingDocument content is sent only to Google Gemini for extraction. That's the only third-party service that ever sees document data — and only transiently.

Ready to see it with your documents?

Book a demo and we'll process your actual packing slips live — no setup required on your end.