Starbase / 01 PlainAgent

PlainAgent / Templates / Invoice data extraction agent

Operations template

Invoice data extraction agent

Pulls supplier, date, totals and line items from invoice PDFs into a spreadsheet.

Job

Read invoice PDFs and write the key fields into a sheet for checking.

Trigger

An invoice PDF arrives by email or lands in a folder.

Hand off to a person when

Rows where totals don't add up or confidence is low.

Inputs & knowledge
  • Invoice PDF (text or image)
Tools / actions
  • Extract fields
  • Append a row to a spreadsheet
  • Flag low-confidence rows
Rules
  • Copy values exactly as printed.
  • If a field isn't visible, return null.

How to build it

  1. List the exact fields you need.
  2. Use a model that can read PDFs or images.
  3. Return JSON with a confidence flag.
  4. Check totals add up in a formula column.
  5. A person approves before anything is paid.

System prompt

Replace the parts in {BRACES}. Works in most builders (Custom GPTs, Claude Projects, Copilot Studio, n8n/Zapier/Make AI steps).

Extract these fields from the invoice. Return JSON only.
{"supplier": "", "invoice_number": "", "invoice_date": "YYYY-MM-DD", "currency": "", "subtotal": 0, "tax": 0, "total": 0, "line_items": [{"description": "", "amount": 0}], "confident": true|false}
Copy values exactly. Use null for anything not visible.

Test before you switch it on

  • A scanned, blurry invoice: confident should be false.

New to this? Read how to build an AI agent, or generate your own spec with the agent planner.

Want a ready-made workflow for this? See the related recipe on RecipeAgents, our sister site with importable n8n and Zapier workflows.

Related templates

Newsletter

One agent template a week

A short Friday email: one agent spec, the system prompt, and what to test before you switch it on. Free, and the unsubscribe link is in every email.