INVOICE PROCESSING
Nightly Batch Three-Way Match with Snowflake Audit Trail
On a nightly schedule, pulls all unmatched invoices from Postgres, runs the three-way match in bulk, releases clean payments via Stripe.
How it runs
The automated pipeline, trigger to output.
- TriggerNightly schedule after ERP batch post
- ActionFetch all PENDING_MATCH invoices with PO and receiptPostgres
- LogicMatch in bulk; partition pass vs fail
- ActionRelease payments for passing invoices via StripeStripe
- ActionWrite row-level audit records to SnowflakeSnowflake
- OutputEmit paid/held/exposure summary for finance
What it does
This batch job clears the day's invoice backlog overnight. It matches every pending invoice against its PO and receipt, pays the ones that pass, holds the ones that fail, and lands a row-level audit trail in Snowflake so finance can report match rates and exception trends.
When to use it
Choose this over event-driven matching when your ERP posts invoices in bulk and you want one predictable nightly reconciliation rather than constant trickle processing. It is ideal when finance needs warehouse-grade reporting on AP throughput and exception causes.
How it works
- 1A nightly cron trigger fires after the ERP batch posts.
- 2Postgres returns all invoices in PENDING_MATCH status with their PO and receipt links.
- 3A logic step matches each invoice and partitions results into pass and fail buckets.
- 4Stripe releases payments for every passing invoice in the batch.
- 5Each invoice's outcome, variances, and decision basis are written as audit rows to Snowflake.
- 6A summary of paid, held, and total exposure is emitted for the finance dashboard.
Set it up
What you configure once, before turning it on.
- 1Connect PostgresAny Postgres URL — query, write, migrate.
- 2Connect StripeCustomers, subscriptions, payments.
- 3Connect SnowflakeWarehouses, queries, shares.
- 4Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
- 5Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
- 6Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.
More Invoice Processing workflows
Nightly audit that flags duplicate payments already made
Runs every night to scan the last 90 days of Stripe payments against your Postgres invoice ledger.
Agent that codes Front invoices to GL accounts and drafts a bill
An agent reads each Front vendor invoice, assigns GL account codes per line item using your chart of accounts and past coding history.
AI agent that investigates suspected duplicate invoices
When a new invoice can't be cleared by exact-match rules, an AI agent reviews paid history for near-duplicates (split bills, renamed vendors, rounding) and recommends pay, hold…
Gate invoice approvals on a duplicate cross-check
When an approver clicks Approve in your AP system, a webhook re-validates the invoice against paid history in Postgres and Stripe charges.
Catch duplicate invoices as they hit your AP inbox
Watches your accounts-payable Gmail inbox for incoming invoice emails, fingerprints each one, and routes likely duplicates to a review label instead of into the approval queue.
Block duplicate Stripe payouts before they send
When a new vendor invoice is queued for payment in Stripe, cross-check it against your paid-invoice history in Postgres and halt any payout that matches an already-paid invoice.
Run it inside a business
This workflow drops into a full company template. Import the org, and this is one of the playbooks its agents run.

Run this workflow in your colony.
14-day trial. No DevOps. No Sales call. Provisioned in under a minute.
