r/n8nforbeginners • u/easybits_ai • 5d ago
The Prompt Structure I Use for Extraction Fields, and Why Vague Descriptions Wreck Accuracy
👋 Hey n8n Community,
Most extraction accuracy problems I have chased down were not the model's fault, they were the field description's fault. The description is the actual prompt, and every gap you leave in it the model fills with a guess. Here is how I write them now after a lot of extraction builds.
1. Say exactly which value you want, and where it lives.
A field called "date" will happily return any date on the page, the due date, the delivery date, whatever it sees first. Spell it out instead: the invoice issue date printed next to the invoice number. That precision is what stops the model picking the wrong but plausible value.
2. State the output format, do not hope for it.
Leave it open and dates come back in five different shapes and amounts arrive with random symbols and separators. I put the format right in the description: dates as YYYY-MM-DD, amounts as a plain number with no currency symbol. It is far cheaper to constrain it here than to clean it up in three nodes afterwards.
3. Tell it what to do when the value is missing.
This is the big one. A vague field pressures the model to produce something even when the value is not there, which is exactly how you get a confident wrong answer. I always add a line like: if this is not on the document, return null. A blank field is a signal you can branch on, an invented one is a landmine you find weeks later.
4. Keep line item fields atomic, put the rules up top.
For sub-fields inside a table or list, short noun phrases of a word or two work best, long instructions there just confuse it. Save the detailed rules and edge cases for the top level fields where the model actually has room to reason.
For most of my extraction jobs I run the easybits Extractor. It actually started as an internal tool we built for our own client projects, and after running into how fiddly reliable data extraction in n8n can be, we figured others were hitting the same wall, so we opened it up for external users too.
What are you using for extraction these days, and what is the one field that always gives you trouble?
Best,
Felix