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

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.

Agentic Task
AgentMailGoogle SheetsSlackFinanceOperationsDocument ProcessingEmail AutomationData Sync
PromptCreate

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.

What does this prompt do?

  • Checks your finance inbox every hour during business hours and pulls every new vendor invoice or receipt, including PDF and HTML attachments.
  • Extracts vendor name, invoice number, amount, currency, issue date, due date, and a line item summary, then appends one row per invoice to your tracking sheet.
  • Checks the sheet first so the same invoice number is never logged twice, and links each row back to the original email thread.
  • Posts a Slack digest to your finance channel after each run with the invoices logged, the total dollar value, and any anomalies that need a human.

What do I need to use this?

  • An AgentMail inbox you use for finance mail, like finance@yourcompany.com.
  • A Google Sheets tracking sheet with columns for vendor, invoice number, amount, currency, issue date, due date, line items, and a link back to the email.
  • A Slack workspace and a channel where the digest should post, like #finance.

How can I customize it?

  • Change the schedule. Run it every 30 minutes during month end close, or once a day if your invoice volume is lower.
  • Tune the filters. Add trusted vendor domains, expand the subject keyword list, or require an attached PDF before logging.
  • Swap the Slack channel, change the digest format, or send a separate alert when an invoice over a certain amount comes in.

FAQs

What kinds of invoices and receipts does this catch?
Anything that arrives as email in your finance inbox with either a PDF or HTML attachment, or a body that clearly reads as an invoice. The agent uses sender, subject keywords, and the attachment to decide what to log.
Will it log the same invoice twice if a vendor resends it?
No. Before adding a new row, the agent reads the existing invoice numbers in your sheet. If the number is already there, it flags the duplicate in the Slack digest instead of appending.
What happens when an email cannot be parsed cleanly?
The agent never silently drops anything. Anything it cannot parse with confidence shows up in the Slack digest under anomalies with a link back to the email thread so a human can take it from there.
Does it work with multiple currencies?
Yes. The agent captures the currency listed on the invoice and stores it in its own column, so you can filter or sum by currency later.
Can I point it at a different inbox or channel later?
Yes. The inbox address, the tracking sheet, and the Slack channel are all easy to change after the workflow is running.

Related templates

Call overdue Xero customers with an AI collections agent

Every weekday at 10am, an AI voice agent phones your most overdue Xero accounts, logs what each customer promised, and reports back to finance in Slack.

LiveKit
Xero
Deepgram
+2
Agentic Task
Local listing health board for every location you manage

See every Google Maps listing you manage on one screen, ranked worst first, with an audit button that writes the fix list for you.

Local Business Data
Google Sheets
App
Win back LiveChat visitors whose chats went unanswered

Every couple of hours we find the chats your team never answered, email those visitors a real reply, and hand the sensitive ones to a support lead.

LiveChat
Gmail
Slack
Agentic Task
Let support send one-off Loops emails without an engineer

Your team picks a template, finds the customer, checks they are safe to email, then sends it, with every send logged where the whole team can see it.

Loops.so
Stripe
Google Sheets
App
Stop cold emails to anyone with a live deal in Pipedrive

Every night at 2am, pull the contacts on your open and won deals and block them from your cold outreach before the next send goes out.

Mailshake
Pipedrive
Google Sheets
Deterministic Code
iMessage campaign console with pre-flight checks and delivery board

Build every text campaign in one screen: check who is actually reachable, see a realistic send plan, then watch delivery land row by row.

LoopMessage
Google Sheets
HubSpot
App

Stop hand keying vendor invoices into a spreadsheet.

Connect your finance inbox, your tracking sheet, and Slack once, and Geni handles the rest every hour.