This AI reads your intake forms and never guesses (free n8n workflow)
Aqib Mehmood
0:00 / 0:00
This AI reads your intake forms and never guesses (free n8n workflow)
10 просмотров · 7 дн. назад
Aqib Mehmood
7 подписчиков
10 просмотров · 7 дн. назад
An n8n workflow that reads law firm intake documents and insurance claims, pulls out the fields that matter, and scores its own confidence on every one. If the weakest field on a document is below the threshold, the whole record waits for a person. If every field clears it, the record writes itself in with no one touching it.
One AI call in the whole workflow. Everything else exists to decide when to trust it.
The build, step by step:
Two ways in. A hosted form trigger gives you an upload page with no front end to build: pick a document type, attach the PDF. The second entrance is a webhook the review app calls when someone hits reprocess. It looks up the saved row, downloads the original PDF from storage, and rebuilds the same input the form path builds, so the rest of the workflow cannot tell the difference. Change the threshold later and any stored document can be rerun against the new number without anyone uploading it again.
Extract and build the prompt. The PDF text is pulled out with the original file kept alongside it for storage. A code node picks the field list for the document type (six fields for law intake, six for an insurance claim) and writes the prompt at runtime. A third document type is one new entry in that lookup table.
One call to Gemini. It returns raw JSON: for every field, a value, a confidence between 0 and 1, and one line of reasoning for that number.
Parse and validate. If the JSON fails to parse, every field drops to zero confidence and the document goes to review. Nothing is silently dropped. And if a field comes back empty but marked confident, its confidence is capped at 0.4. That rule exists because a missing case number once came back at 90%: the model was sure the field was empty, not sure what belonged in it.
The gate. One comparison: the weakest confidence on the document against the threshold (75% here). Five fields at 98% and one at 65% go to review, the same as a document where every field is uncertain.
Write it down. Both branches build the same row, store the source PDF, and either insert a new row or update the same row in place on a reprocess run. A document that needs review pings Slack with a link to it, and every outcome writes to an events table, so each document's full history is queryable on its own.
The review app. A dashboard with live counts and a queue that shows only what needs a person. Open one and the source PDF sits next to every extracted field, with the low-confidence field highlighted and the model's reason underneath. Correct it and approve, or hit reprocess.
All names and documents in this demo are made up.
Comment "intake" and I'll send you the workflow file.
Chapters:
0:00 Cold open
0:23 The trust problem with AI on real data
0:44 Way in 1: the upload form
1:11 Setting up the run
1:29 Way in 2: the reprocess webhook
2:25 Pulling text out of the PDF
3:01 One lookup table, two document types
3:52 The only AI call
4:24 Parsing, and the empty-field rule
5:15 The idea worth stealing: the weakest-field gate
5:59 Building the record and storing the PDF
6:34 Insert or update
7:20 Slack alert and the events table
8:01 The review app
8:53 Recap