INVOICE PROCESSING

Three-Way PO Matching with Exception Routing to Postgres

Extracts data from incoming invoices, matches them against purchase orders and receiving records in Postgres.

CategoryInvoice Processing
Enginesim
Difficultyadvanced
Triggerevent
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNew invoice file in DropboxDropboxDropbox
  • ActionExtract PO number and line items with OpenAIOpenAI
  • ActionFetch matching PO and receiving record from PostgresPostgreSQLPostgres
  • LogicThree-way match on quantity and price
  • ActionMark approved-for-payment in PostgresPostgreSQLPostgres
  • OutputRoute mismatches to Slack finance channelSlack

What it does

Performs classic three-way matching: it reconciles each invoice against its purchase order and the goods-received record, approving only when all three agree and escalating discrepancies.

When to use it

Use this when you run purchase orders and need invoices validated against what was ordered and what actually arrived before paying. It catches overbilling, wrong quantities, and price drift that flat OCR pipelines miss.

How it works

  1. 1A new invoice file in the watched Dropbox folder triggers the run.
  2. 2OpenAI extracts the PO number, line items, quantities, and unit prices.
  3. 3A query pulls the matching purchase order and receiving record from Postgres.
  4. 4A logic step compares quantities and prices across all three documents within tolerance.
  5. 5Clean matches are written back to Postgres as approved for payment.
  6. 6Mismatches post to a Slack finance channel with the specific deltas highlighted for manual review.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect DropboxFiles and folders.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect PostgresAny Postgres URL — query, write, migrate.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.