Academy · Solutions · Agentic Workflow

Build: Invoice settlement

In one line. Invoices land in a Processing collection, an Invoice Extractor agent pulls the fields and reports a verdict, the Four-Eyes lifecycle auto-approves the clean ones it’s confident in and routes the rest to two human reviewers via the Inbox, and invoices a reviewer approves export to your finance system. You’ll build. A complete, audited invoice pipeline — collection, fields, ingestion, extractor agent, an auto-approve gate, export on approval, and a scoreboard page — in about 45 minutes, entirely by configuration. You’ll use. Collections & schema · Taxonomy, lifecycle, tags & events · Ingestion & connectors · Your first agent · Document detail · Dashboards & inbox · Pages & cards

This is the canonical “decide on each document” shape — structured extraction + human-in-the-loop + export over a Processing collection. Learn it here and the triage, contract and compliance builds are variations on it. Before you start you need a project you can build in, at least one language model registered (LLMs & services), the agent-and-collection model from Core concepts, and a handful of sample invoice PDFs.

 INGESTION                COLLECTION (Processing)                    EXPORT
 Drive / Upload  ──►  Vendor Invoices                        ──►  Finance system
                       fields: vendor_name, invoice_number,         (Blob / Drive /
                               invoice_date, total_amount,          webhook)
                               due_date, line_items (table)
                       worker: Invoice Extractor fills the fields,
                               and separately reports a recommendation
                               + an overall confidence (Auto-annotate)
                       lifecycle: Four-Eyes
           recommendation=approve, confident, no flags ──► auto-approve
                         decline / low-confidence ──► L1 Review ► L2 Approval
                         needs-info ──► Needs Info (its own Inbox queue)
                       experience page: Processed / Pending / Flagged

Steps

Stage 1 — Create the “Vendor Invoices” Processing collection

Goal: a typed home for invoices, with review stages.

  1. Go to Studio > Data > Collections and click + Collection at the bottom of the list.
  2. Purpose: Processing (the default). This choice is immutable after create — pick Processing deliberately.
  3. Collection Name: Vendor Invoices. Description: Incoming supplier invoices for approval.
  4. Leave every other accordion at its default and click Save.

If you don’t see a Processing / Knowledge choice, new collections are Processing anyway — which is what this build wants. The choice can be switched off for a workspace; if you need it, ask your administrator.

Checkpoint. Vendor Invoices appears in the collection list. Select it and the right pane shows its tab strip: General · Taxonomy · Lifecycle · Tags · Events · Ingestion · Agents. The Lifecycle tab is already seeded with the 8-stage Four-Eyes flow — you tune it in Stage 5.

Full field-by-field reference: Collections & schema.

Stage 2 — Design the fields to extract

Goal: tell the platform exactly what to pull out of every invoice. Fields drive extraction — no Label, no extracted value.

  1. With Vendor Invoices selected, open the Taxonomy tab and click Taxonomy at the bottom of the list to create the Learner that owns the fields.

  2. Enter the Learner: Taxonomy Name Invoice Header, Description Top-level invoice fields, Type Document Classification (whole-document field extraction), Entity Vendor Invoices (pre-filled). Click Submit. If you have read Build: SEC filings analyst, note the contrast: that build needs Section Classification because its agent’s Output tab is schema-bound to the Learner, and a Document Classification Learner would make it pick one category and stop. Here the Learner is only where the written-back values land. If your fields come back empty, that difference is the first thing to check.

  3. Select Invoice Header, then + Label. A field’s type comes from a validation rule (under View Config) plus Record Config — there is no single “type” dropdown (Collections & schema). Add these, using Add between each:

    Label Name Description How to make its type
    vendor_name The supplier's name Plain text — no advanced settings
    invoice_number The supplier's invoice number Plain text
    invoice_date Date the invoice was issued View Config → add a date validation rule
    total_amount Grand total including tax View Config → numeric validation rule; optionally tick Enable Total Field for a column total
    due_date Date payment is due View Config → a date validation rule
  4. Now the line-items table. Click + Label again: Label Name line_items, Description One row per billed line. Open Record Config and turn on Is Record. Add child Labels as its columns: description (text), quantity (numeric), unit_price (numeric). Click Add and exit.

Watch out — the recommendation is not a field on this Learner. It’s tempting to add a recommendation Label here so it “rides along” with the extracted fields. Don’t: every Label’s value travels as a list (one entry per instance, with its own confidence/references), so a single-select Label can never deliver the plain approve / decline / needs-info string the Stage-5 gate needs — it arrives as a bundle the gate can’t parse and treats as a verdict it doesn’t recognise. Stage 4 teaches the one mechanism that actually delivers a plain verdict.

Checkpoint. The Labels tree under Invoice Header shows all six fields, with line_items as a table carrying 3 child fields. Exhaustive validation options: Schema field reference.

Stage 3 — Wire ingestion (get invoices into the collection)

Goal: a repeatable way for invoice PDFs to land in Vendor Invoices. Go to Studio > Data > Ingestion (Ingestion & connectors).

One note on old links. An older single-source setup wizard still opens from bookmarks, but it is no longer in the menu. Build new sources on Studio > Data > Ingestion.

The fast path, for testing right now: click Upload, drag in a few invoice PDFs, set Target collection = Vendor Invoices, Submit. Use this to smoke-test your fields before automating — you’ll do exactly this in Stage 9.

The recurring path, for production — a connector must exist before a job can use it:

  1. + Connector → pick Botminds Drive (this project’s internal drive — no credentials). Give it a name → Test connection → Save connector.
  2. + Job → Step 1: select that Drive connector. Step 2: Job name Invoices intake; Browse… to the invoices folder; Extensions pdf; tick Recursive; Target collection Vendor Invoices. Step 3: Recurring → every 6 Hours (check the Next 5 runs preview) → Create job.

Checkpoint. On the Jobs tab you see Invoices intake … active. Click Run now, then the Runs tab — the funnel counters (Enum → Fetch → New → … → Disp) fill, and a click on the run opens Run detail with a per-file log.

Stage 4 — Build and assign the “Invoice Extractor” agent

Goal: an AI worker that fills the six fields on every invoice. Go to Studio > Agents > Agent Toolkit > Agents → + Agent ▸ Agent at the bottom of the list. This opens the tabbed builder beside a live playground (Your first agent).

  1. Persona tab. Name Invoice Extractor; Description Extracts header fields and line items from vendor invoices. Click the co-pilot on Instructions, seed it with “Extract the key fields and line items from a vendor invoice,” then refine to roughly:

    You are an invoice-processing assistant. For each invoice, extract the
    vendor name, invoice number, invoice date, due date, total amount, and
    every line item (description, quantity, unit price). Return only values
    the document supports; never invent one. Then, separately from those
    fields, state your overall confidence (0-1) in the extraction and a
    recommendation: approve for a clean invoice you're confident in, decline
    for one that looks wrong, needs-info for anything you can't resolve from
    the document alone. Always give a confidence — an invoice with no stated
    confidence cannot auto-approve.
  2. Model tab. Pick your project’s language model (LLMs & services). Set Agent Mode = Thinking while you tune, so you can watch its reasoning; leave Advanced sampling at defaults.

  3. Output tab. Leave Structured output off and turn on Auto-annotate document instead; pick the Taxonomy/learner Invoice Header in the picker it shares with Structured output (binding a Learner for write-back needs Auto-annotate on, not Structured output). With Structured output off, the model free-generates JSON rather than being schema-bound to Invoice Header’s Labels — which is what lets it also state the plain confidence and recommendation Stage 2’s watch-out says no Label can carry. Have it reply with one flat JSON object: a key per field (vendor_name, invoice_number, invoice_date, total_amount, due_date, line_items) plus top-level recommendation and confidence — Auto-annotate maps the field-name keys onto Invoice Header’s Labels, and reads recommendation/confidence from the flat reply or a _meta block, never from a Label. You lose per-field Confidence score/References (a Structured-output-only display) in exchange. This recipe is unverified — don’t rely on it until someone has checked it on a live project.

  4. Click Save Agent — there is no autosave.

  5. Test it before wiring it up. In the right Playground pane: Input Type = Document, pick a sample invoice, press Enter. Watch the flat JSON reply stream in, recommendation and confidence alongside the field values. Watch out — with Auto-annotate on, this isn’t a side-effect-free preview: the run writes the fields back onto that real invoice and can move it through the lifecycle, the same as a live arrival. Flip Agent Mode = Fast and re-run — same result, quicker; that is your production setting.

  6. Assign it as the collection’s Worker. Go back to Studio > Data > Collections, select Vendor Invoices → Agents tab → Assign Invoice Extractor as the intake/processing agent.

Checkpoint. The Agents tab shows Invoice Extractor assigned, with a link back to the agent editor. From now on every document that lands in Vendor Invoices is run by it automatically. The Worker you set here runs on each document as it arrives; a Reader is the other relationship — an agent that answers questions over data, attached on the agent’s own Knowledge tab (Your first agent).

Stage 5 — Configure the lifecycle (auto-approve the clean ones, route the rest)

Goal: keep Four-Eyes for the ones that need it, but stop sending every clean invoice to two humans. Open Studio > Data > Collections, select Vendor Invoices → Lifecycle tab. The 8-stage Four-Eyes flow is already there (Intake → AI Processing → AI Recommendation → L1 Review → L2 Approval → Needs Info → Approved/Declined). You add one auto-approve rule and confirm the review routing — full detail in Taxonomy, lifecycle, tags & events.

  1. Auto-approve the clean ones. Below the stage graph, open the Auto-decide policy card and set:
    • Switch it to Auto-decide is ON
    • Applies to = Approve only (auto-approve only; always keep human eyes on declines)
    • Min confidence = 0.92 (the default) — the overall confidence Invoice Extractor reports itself, top-level in its reply (Stage 4).
    • Leave Require zero open flags on (its default). An open flag is a value on the invoice still marked as a problem and not cleared — a mark someone raised on it, a quality check it failed, a validation rule it broke. One is enough to hold the invoice for a person, however confident the agent was. That is what you want on a payables queue. Note the gate adds these up from more than one place, so it can count more than any single screen shows you — if an invoice you expected to auto-approve stops at review, that is the first thing to check.
    • Leave Max amount ($) empty for now. Setting it reveals a second field, Amount field name: type the Label the cap reads there — total_amount on this build. The gate finds it in the agent’s reply whatever its capitals, and with _, - or spaces treated alike. If the reply has no value under that name, or the value isn’t a number, the invoice goes to a reviewer. A dollar cap is covered in Make it production-worthy.
    • Save. The card’s summary line now reads “Auto-approve when AI confidence ≥ 92% AND zero open flags.” Three things have to be true for an invoice to take that path: recommendation = approve and confidence ≥ 0.92, both from Stage 4, and no open flag on the invoice.
  2. Confirm the review stages send to the Inbox. Click the L1 Review stage to open the State editor and confirm Send to Inbox (human review) is on; do the same for L2 Approval. These are what put items in a reviewer’s queue. In the seeded flow they’re already on — you’re verifying, not adding.

Checkpoint. A clean invoice with recommendation = approve, confidence ≥ 0.92 and no open flag now skips both reviewers. A decline, a low-confidence call, or an invoice the agent gave no verdict on at all routes to L1 Review → L2 Approval and lands in the Inbox there. If an item isn’t in the Inbox yet, refresh it: for an invoice moved automatically, the item is added when the Inbox list loads, or by a background pass within about five minutes. A needs-info verdict is different again: it routes straight to the Needs Info stage — its own Inbox queue, seeded for asking the requester for more information, not the L1/L2 reviewer queue. Do not use Reset to default on a lifecycle with live documents — it rebuilds the standard flow and asks you to confirm by typing the collection’s identifier.

Stage 6 — Walk the review path (how a human corrects and approves)

Goal: know exactly what your reviewers do, so you can design toward it. A document that doesn’t auto-approve enters L1 Review and the platform creates an Inbox item that wraps it. The reviewer’s path:

  1. Consumer app ▸ Inbox. Under Needs Review / Needs Approval, each card shows a headline (Review or Approve and the invoice’s title), a provenance line (wraps ▸ Vendor Invoices · L1 Review) and its age. The Inbox doesn’t act — it is read + snooze + dismiss only (Dashboards & inbox).
  2. Click Open — you land on the Document Detail page, a split view: the invoice on one side, the extracted fields on the other (Document detail).
  3. In the Summary pane, read the flagged fields first — the ones carrying a mark or a failed validation rule. This recipe has no per-field confidence score to sort by (Stage 4 traded it away), so check the money and the dates by hand too. Click a value — say Total : $1,240.00 — and the viewer scrolls to and highlights the source segment it was read from. That is how you catch a mis-read, such as a subtotal grabbed instead of the grand total.
  4. Correct a wrong value by editing it in place; your edit saves back to the label and becomes a teaching signal for the trainable model (AI Builder). Run Rescore if dependent values need recomputing.
  5. Advance the document from the workflow action pane: approve sends it to L2 Approval (the second eye), who finalises it to Approved. Every move is written to the audit trail — that trail is the decision. Read it at Studio > Governance > Oversight > Audit & Usage.

Checkpoint. When the reviewer advances the document past its human stage, the Inbox item resolves itself — it leaves the queue automatically. Editing needs the Reviewer role, or a persona that grants it; a Viewer gets a read-only summary.

Stage 7 — Export approved invoices

Goal: push approved invoices, with their extracted data, out to your finance system. Go to Studio > Data > Export → + Export (Ingestion & connectors).

  1. Pick the Export Type first — the rest of the form follows from it. Name: Finance export. Choose a split/bookmark type if you want structured output, or a plain type to ship the data as-is.
  2. Destination: under External Sources, either Azure Blob (Storage Name / Key / Container) or Botminds Drive (drive URL). Useful common toggles: Export input document (ship the original PDF alongside the data) and Add date-wise folders. Save (disabled while the form is invalid).
  3. Fire it on approval (recommended). So export happens the moment a reviewer approves an invoice, add an Event instead of exporting by hand: Vendor Invoices ▸ Events tab → + Event → trigger stage change, Workflow Four-eyes review — Vendor Invoices, Stage Approved, + Add Action → Webhook to your finance endpoint (Taxonomy, lifecycle, tags & events). Alternatively, an Export-type automation on the Approved stage runs the export template on entry. Neither fires for an invoice the gate auto-approves: the automatic move into Approved doesn’t raise a stage-change Event or run that stage’s automations today, so export auto-approved invoices by hand.

Checkpoint. Your export appears in the Export list with its Type, Taxonomy chips, and Storage details. Approve one invoice yourself, through both review stages, and confirm the file or POST lands.

Stage 8 — Add a scoreboard: processed / pending / flagged

Goal: a bird’s-eye score of the pile for your finance lead. Go to Studio > Experience > Designer > Pages, create a page, choose a layout, and drop in cards from the card library at Studio > Experience > Designer > Cards (Pages & cards). Placing a card is: drop it in → configure it in the inspector → point it at your data → save.

  1. Processed — a count card filtered to stage Approved.
  2. Pending — a count card filtered to stages L1 Review + L2 Approval (what’s waiting on a human).
  3. Flagged — a count card over documents carrying a review flag or a Wrong Vendor-type Tag.

Checkpoint. Preview the page to see exactly what your end users get. Page design can be switched off for a workspace — if you don’t see the Pages entry, ask your administrator.

Stage 9 — Test it end to end

About ten minutes:

  1. Upload a sample. Studio > Data > Ingestion → Upload → drag in one clean invoice PDF and one messy or ambiguous one, to see both paths → Target collection = Vendor Invoices → Submit. The result panel reports “N of M registered.”
  2. Watch it process. Open the consumer document list for Vendor Invoices. The new row shows a Processing… chip that climbs to 100% as the Invoice Extractor fills the fields — live, no refresh (Document detail). If a row sits at 0% for a long time, tell your administrator (Ingestion & connectors).
  3. See routing in action. The clean invoice — recommendation = approve, confidence ≥ 0.92, no open flag — should auto-approve; its audit entry records an automatic accept rather than a person, and it skips the humans. One with a low confidence, a decline, or no recommendation at all should land in the Inbox under Needs Review at L1 Review; one with needs-info lands in the Inbox too, but at the separate Needs Info stage.
  4. Review in the Inbox and Document Detail. Open the Inbox item → Open → on the Document Detail, click a field to verify it against its highlighted source, correct one value, then approve from the action pane. It moves to L2 Approval; approve again → Approved, and the Inbox item disappears.
  5. See it exported. Confirm the invoice you approved in step 4 triggered your Finance export — a file in Blob/Drive, or a POST to your webhook. The clean invoice that auto-approved in step 3 doesn’t trigger it: an automatic move into Approved raises no stage-change Event and runs none of that stage’s automations today.
  6. Read the scoreboard. On your page, Processed ticks up and Pending reflects anything still in review.

If all six happened, you have a working, audited invoice pipeline — built entirely by configuration.

Make it production-worthy

Four upgrades, in rough order of effort:

  1. More fields. Add purchase_order_number and tax_amount Labels to the Invoice Header Learner (Stage 2), then name the two new keys in the agent’s Instructions so its JSON reply carries them (Stage 4), and Rescore existing documents. The Learner’s Label names and the agent’s reply keys must agree, or the field stays empty.
  2. A “Wrong Vendor” tag and an Overdue view. On the Tags tab add Duplicate, Missing PO, Wrong Vendor for reviewers to apply (Taxonomy, lifecycle, tags & events). Then define an Overdue Invoices View from the Documents list: open Vendor Invoices’ Documents surface, add columns Vendor, Total, Due Date, Status, filter on due date / status, then Options ▸ Save View as (Save Under = Project Views) and Options ▸ Allowed Roles to scope it. Studio > Data > Views lists it afterwards — list, inspect, delete, not where you build it. Your reviewers now get a one-click “what’s overdue” list.
  3. A webhook with an SLA alert. Extend the Stage-7 Event — under Show Advanced Settings set Check SLA Breach and SLA Time so you’re alerted when an invoice sits in review too long (Taxonomy, lifecycle, tags & events).
  4. A stricter approval threshold. Raise Min confidence to 0.97 so more invoices get human eyes, or set Applies to = Both approve and decline only once you trust the agent on declines too (Stage 5). To add a dollar cap, set Max amount ($) and put total_amount in Amount field name; an invoice over the cap, or one whose reply has no number under that name, goes to a reviewer instead.

Where to go next

Prefer learning inside the product? The same academy lives in the platform's Learn menu — every screen links to the chapter that explains it.

See the platform live