FINANCE

Parse Emailed Receipts, Check Policy, and Build the Expense Record

Reads receipts forwarded to a finance inbox, extracts merchant, amount, and date, validates them against policy, and creates an expense row in Postgres.

CategoryFinance
Enginesim
Difficultyintermediate
Triggerevent
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerReceipt email arrives in finance inboxGmailGmail
  • ActionExtract merchant, amount, date, category
  • LogicCheck amount and receipt against policy
  • LogicBranch: clean vs. needs-review
  • ActionInsert expense record into PostgresPostgreSQLPostgres
  • OutputReply to submitter with recorded summaryGmailGmail

What it does

Employees forward receipts to a dedicated Gmail address. The flow extracts the merchant, total, date, and category from each message, checks the charge against your expense policy, and writes a structured expense record to Postgres. Anything that violates policy or has an unreadable receipt is marked needs-review instead of silently passing.

When to use it

Use it when receipts arrive as email attachments or photos and someone is hand-keying them into a system. This removes the data entry and adds policy enforcement at the point of capture.

How it works

  1. 1A new email in the finance receipts inbox triggers the flow.
  2. 2An extraction step pulls merchant, amount, date, and category from the body and attachment.
  3. 3A policy-check step compares the amount to the category cap and confirms a receipt is attached.
  4. 4A branch separates clean charges from violations and unreadable receipts.
  5. 5Clean charges are inserted into the Postgres expenses table as Pending.
  6. 6Violations are inserted with status Needs-Review and the failing reason attached.
  7. 7A confirmation reply is sent to the submitter summarizing what was recorded.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GmailRead, draft, send, label.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.