An AI extraction step can return a well-formed invoice row with a made-up number. Use a schema to control the shape of the response and a separate check to evaluate the fields that matter.

Make the smallest batch that can fail

Create three dummy invoices and paste their text into a manual test run. Put an invoice number and total in the first, omit the invoice number from the second, and add an old amount as a credit reference on the third. In a real workflow the text could come from an OCR or PDF extraction step. Pasting it first isolates the model step from any problems with the scan.

Where a chain supports a structured output parser, give it separate fields for invoice number, total, currency and the source text around the total. Allow a missing value. In the extraction instruction, explain that an invoice number may be absent and that a credit reference is a different field. Put the original input alongside the generated fields for review.

Decide what can reach the spreadsheet

Check required values before the worksheet step. Put any row with a missing invoice number or unrecognized currency in a review queue. For the test batch, confirm that the first row is accepted, the second is held and the third uses the actual amount due. Read the source line before you decide that the third result is correct.

If the system invents a value and claims it came from the invoice, keep the run in review and tighten the extraction question. Check in the execution history which step changed the value. That is the fastest way to tell whether the problem began in source text, model output or a later field mapping.

Sources