Nightly OneDrive receipts to Excel expense log with Outlook summary

Drop receipts and invoices in OneDrive and every weekday at 11pm this agent parses them, fills your Excel expense log, and emails you a summary.

Agentic Task
Microsoft OneDriveMicrosoft ExcelMicrosoft OutlookFinancePersonal ProductivityDocument ProcessingDaily DigestsEmail Automation
PromptCreate

Build an agent workflow that runs on a cron trigger every weekday at 11pm in my local time zone and turns the receipts and invoices I drop in OneDrive into a clean Excel expense log, with an Outlook email summary at the end.

Inputs the workflow should accept as configuration:

- inbox_folder_path: the OneDrive folder I use as my receipts inbox (default /Receipts).

- workbook_path: the OneDrive path to my Excel expense log (must be OneDrive for Business or SharePoint, since the Excel API does not support consumer OneDrive).

- worksheet_name and table_name: the named table inside that workbook the agent should append rows to. Assume the table already has columns Date, Vendor, Amount, Currency, Tax, Category, Description, and Source File (in that order).

- summary_recipient: the email address that gets the nightly Outlook summary (default: my own).

- categories: a list of expense categories the agent should classify each receipt into (default: Travel, Meals, Software, Office, Hardware, Marketing, Professional Services, Other).

- timezone: my local IANA time zone, used both for the cron schedule and for the 'last 24 hours' window.

On each run, the agent should:

1. Use Microsoft OneDrive to enumerate files added to inbox_folder_path in the last 24 hours. Prefer search_items scoped to that folder with a recency filter, and fall back to list_children and filtering by createdDateTime if search is unavailable. Skip anything that lives inside a year/month subfolder (those are already filed).

2. For each new file, download its content with Microsoft OneDrive's download_file_content. If the file is an Office document (.docx, .doc, .xls, .xlsx, .pptx), use download_converted_format with format=pdf so the agent can read the contents as a PDF. Image formats (JPG, PNG, HEIC) and PDFs go straight through.

3. Read the file and extract: transaction date (ISO yyyy-mm-dd), vendor name, total amount, currency code (default USD if not stated), tax amount if visible, the best matching category from the configured list, and a single short description (under 80 chars). If the receipt is unreadable or any required field is missing, do not invent values: add the file to an 'unparseable' list with a short reason.

4. For each successfully parsed receipt, append one row to the configured Excel table using Microsoft Excel's add_table_row. Match the values to the existing column order, and put the original OneDrive filename (and a web URL to the file if available) in the Source File column.

5. After the row is appended, move the original file in OneDrive into inbox_folder_path/{YYYY}/{MM}/ based on the parsed transaction date (creating the year and month subfolders if they do not exist) using Microsoft OneDrive's move_item. Leave unparseable files in the inbox so I can fix them tomorrow.

6. At the end of the run, send one Microsoft Outlook email via send_mail to summary_recipient. The email should include: number of receipts processed, total amount spent grouped by currency, a count of receipts by category, the top three highest individual expenses with vendor and amount, and a clearly labeled list of any unparseable files with the reason and a direct OneDrive link to each. Use a clean HTML body, not plain text. If there were zero new receipts and zero unparseable files, send a brief 'nothing to do tonight' email so I know the agent ran.

Operational details:

- Treat Microsoft OneDrive, Microsoft Excel, and Microsoft Outlook as separate connections, even though they share a Microsoft 365 sign-in.

- Honor Microsoft Graph throttling: on 429, wait the Retry-After value and retry with backoff.

- Be idempotent: never write the same receipt twice. Before adding a row, check that no existing row in the table has the same Source File filename.

- Cap each run at processing 100 receipts; if there are more, process the oldest 100 and mention the backlog in the email.

What does this prompt do?

  • Scans your OneDrive Receipts folder every weekday at 11pm for anything you dropped in over the last 24 hours.
  • Reads each photo, PDF, or Word receipt and extracts vendor, date, amount, currency, tax, category, and a one-line description.
  • Appends every parsed receipt as a new row in your existing Excel expense log so your bookkeeping stays current.
  • Files the original into a tidy year and month subfolder in OneDrive so the inbox stays clean.
  • Emails you an Outlook summary with total spend, a count by category, and a list of any files it could not read so you can fix them.

What do I need to use this?

  • A Microsoft 365 account with OneDrive, Excel, and Outlook (work or school, since Excel for the web requires a business OneDrive).
  • An existing Excel workbook with a named table for your expense log, with columns like Date, Vendor, Amount, Currency, Tax, Category, Description, and Source File.
  • A OneDrive folder you treat as a receipts inbox (for example /Receipts) where you drop photos, PDFs, and invoices.

How can I customize it?

  • Change when it runs. Move it earlier in the evening, or have it run daily instead of weekday only.
  • Change the inbox folder, the workbook, or the table name to match your filing system.
  • Add or rename categories (Travel, Meals, Software, Office, Client billable) and tell the agent how to map vendors to them.
  • Send the nightly summary to your accountant or a shared mailbox instead of yourself, or skip the email on nights with no receipts.

FAQs

Will this work with photos of paper receipts?
Yes. The agent reads images (JPG, PNG, HEIC) the same way it reads PDFs and Word invoices. Make sure the receipt is in focus and the total is visible.
What happens if a receipt is blurry or missing key fields?
The agent skips writing a row it cannot trust and lists the file in the nightly Outlook email so you can re-shoot the photo or enter it manually.
Does it touch receipts I dropped in days ago?
No. It only looks at files added since the last run (about the last 24 hours by default), so you can safely keep older receipts in the same folder without re-processing them.
Can I keep using my current expense spreadsheet?
Yes. Point the agent at your existing workbook and table, and it appends new rows to the bottom. Your existing formulas, totals, and pivots keep working.
Does it work with personal OneDrive accounts?
OneDrive and Outlook work with both, but the Excel piece requires OneDrive for Business or SharePoint. If you only have a personal OneDrive, save the workbook in a Microsoft 365 Business or Family account.

Related templates

Spin up a OneDrive client workspace when a HubSpot deal closes won

Every time a HubSpot deal moves to Closed Won, scaffold a full OneDrive client folder, share it with the deal owner, and announce the new client in Slack.

HubSpot
Microsoft OneDrive
Slack
Agentic Task
Weekly HubSpot pipeline snapshot to Excel and Slack

Every Monday at 8am, log this week's HubSpot pipeline into an Excel workbook and post a narrative summary to your sales Slack channel.

HubSpot
Microsoft Excel
Slack
Agentic Task
Log OneDrive proposals to HubSpot deals with a daily Slack digest

Every weekday at 8am ET, summarize new proposals and contracts in OneDrive, attach a note to the matching HubSpot deal, and post a sales digest in Slack.

Microsoft OneDrive
HubSpot
Slack
Agentic Task
Nightly Fathom call filing to OneDrive client folders and a Notion CRM log

Every weekday at 7pm, sort the day's Fathom call summaries into the right OneDrive client folders and log them in a Notion customer call database.

Fathom
Microsoft OneDrive
Notion
Agentic Task
On-demand product planning partner for briefs and specs

A planning partner that turns fuzzy asks into opportunity briefs, scoped specs, sequenced rollouts, and audience-ready updates.

Notion
Linear
Jira
+8
Agentic Task
Answer Slack questions from every tool you connect

When someone asks a question in Slack, the bot searches your docs, tickets, drive, and email, then replies with a source-backed answer.

Slack
Notion
Google Drive
+11
Agentic Task

Stop typing receipts into a spreadsheet.

Connect OneDrive, Excel, and Outlook once, and Geni does your nightly bookkeeping for you.