Hourly invoice intake from email to Google Sheets with a Slack digest

By General Input

Every hour, this agent reads your finance inbox, pulls vendor invoices and receipts into a tracking sheet, and posts a Slack digest with totals and anomalies.

Integrations

  • AgentMail
  • Google Sheets
  • Slack

Type

Agentic Task

Categories

  • Finance
  • Operations

Build me an invoice and receipt intake agent that runs on a cron schedule every hour during business hours (9am to 6pm on weekdays, in my local timezone). I want it to keep my finance tracking sheet and my #finance Slack channel up to date automatically.

On each run, the agent should call AgentMail List Messages on my finance@ inbox to fetch every message that arrived since the last run. For each new message, it should call AgentMail Get Message to pull the full body plus any PDF or HTML attachments.

Filter the messages down to vendor invoices and receipts. Treat a message as an invoice candidate when the sender domain looks like a real business (not a personal mail provider), the subject contains invoice or receipt language (invoice, receipt, statement, bill, payment due, paid), and there is at least one PDF attached or the body itself clearly reads as an invoice. Anything that does not match the filter should be ignored.

For every message that passes the filter, parse out: vendor name, invoice number, amount, currency, issue date, due date, and a short line item summary. Before logging anything, call Google Sheets Get Values on the invoice number column of my tracking sheet and check whether the parsed invoice number is already present. If it is, treat it as a duplicate and do not append.

For new invoices that parsed cleanly and are not duplicates, call Google Sheets Append Values to add one row per invoice to the tracking sheet. The row columns should be: vendor name, invoice number, amount, currency, issue date, due date, line item summary, and a link back to the AgentMail thread.

After each batch, call Slack Send a Message to post a digest to #finance. The digest should list every invoice that was logged this run with vendor, invoice number, and amount, the total dollar value across the batch, and a separate anomalies section. Anomalies include: messages that looked like invoices but could not be parsed cleanly, invoice numbers that were already in the sheet, and suspicious senders (lookalike domains, free mail providers claiming to be a vendor). For every anomaly, include a link back to the AgentMail thread so a human can pick it up.

Important: never silently drop anything. If parsing fails or something looks off, surface it in the Slack digest under anomalies rather than skipping it. If there are no new invoices and no anomalies on a given run, do not post a digest at all.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats