Build an invoice intake workflow that reads a file, extracts a fixed set of fields, and writes a row to a table. Start with one document before adding batch processing.
Prepare the inputs
Create a table with columns for source_file, invoice_number, vendor, invoice_date, total, and review_status. Choose column types that match the values you want to store. Keep the source file reference so you can check an extraction against the original.
Build the workflow
- Pass an invoice into the workflow through an upload or an integration attachment. Use the File block to read it, or pass it to an Agent model that supports the file type.
- Configure an Agent block to extract the table fields. Define a structured output and instruct it to leave missing fields empty instead of inferring a value.
- Add a Condition to check required fields before writing. Route incomplete results to a review path.
- Use the Table block to insert the extracted values, source reference, and review status.
Check the result
Run one complete invoice and compare the stored values with the original. Then test a document missing its invoice number and a document the reader cannot parse. Confirm that those cases reach the review path instead of creating a complete-looking row.
Once the single-file workflow behaves as expected, use a Loop or Parallel block to process a collection. Inspect the logs for each document.