The problem
A builder with dozens of jobs running gets several subcontractor invoices by email every day. Each one means opening the file, working out which project it belongs to, typing the subcontractor, invoice number, amount and payment details into the books and dropping the document into the right job folder, and a misfiled invoice turns up months later as a dispute.
Architecture
- Channel
- Invoices arriving by email
- Agent
- Script written with ChatGPT
- Reads invoice, matches the job
- Tools
- Your email account
- Google Drive job folders
- Zoho Books
- Human
- Owner books and approves payment
Where the data stays: Invoices stay in your email and your Google Drive; the script runs in your own accounts, and only sample invoices with details blanked go into the chat while you build it.
Design flow
- A subcontractor invoice lands in the inbox
- Script collects it into one Drive folder and reads it
- Matched to one of about 30 job folders
- No confident match: left in Unmatched for youOnly sometimes
- Owner opens the filed invoice, books it and approves paymentHuman checkpoint
Setup
Total time: 3 h 20 min our estimate
- 20 min
Done when: One list holds every active job with its exact Drive folder name, site address and the subcontractors working on it; the script matches against this list.
- 2 h
The source does not say which scripting platform the builder used; ask ChatGPT for the simplest one that fits your email provider. OpenAI's operations guide suggests Codex when the work is building an internal workflow tool like this.
Done when: Using the prompt above, ChatGPT has walked you through connecting a script to your email and Drive, and a test invoice moves from the inbox into the right job folder.
- 45 min
Done when: Every invoice from last week landed in the folder you would have chosen, and the ones the script was unsure about sit in Unmatched rather than in a wrong job.
- 15 min
Done when: Your routine is set: each day you open the newly filed invoices, post them in Zoho Books and approve payment, and a misfiled one gets moved and the job list corrected.
Ticks are saved on this browser.
Starter prompt
Written from how the use case works and its sources. Replace the parts in square brackets.
I run a [construction] business and get several subcontractor invoices by email every day. Help me build a script that connects to my [Gmail] account, collects every email attachment that is an invoice into one folder in my [Google Drive], reads each invoice, works out which job it belongs to from my list of about [30] active jobs (names and addresses below) and moves it into that job's folder. If it cannot match a job with confidence, it leaves the file in a folder called Unmatched for me. Walk me through it step by step: what to set up first, what to copy where, how to test it on five old invoices, and how to run it every [hour]. I will still post every invoice in my accounting software myself. My job list: [job name, site address, subcontractors on it].
Risks and data
Data
The script reads your inbox and writes to your Drive, so it runs under your own account with the narrowest access that works, and the chat where you build it only ever sees sample invoices with bank details blanked. Invoices from sole traders are personal data: keep the job folders restricted.
How it goes wrong
It goes wrong when two jobs share a subcontractor and a similar address, so an invoice is filed under the wrong one and paid against the wrong budget, or when a renamed folder breaks the matching silently. You notice at the booking step, or when a job's costs look too high. Keep the Unmatched folder for anything uncertain, check it daily, and update the job list the day a job opens or closes.
How the agent works
It starts
The owner describes the job to ChatGPT and, with its help, builds a script connected to his email account.
The agent works
The script puts every incoming invoice in one folder, reads it, identifies which job it belongs to and moves the document into that job's folder in Google Drive, where about 30 active jobs each have their own. The first version took about two hours to build. The booking step stays with you: open the filed invoices, post them in your accounting software and approve payment yourself, so a wrongly matched invoice is caught there.
The result
The same pattern works for any business that receives supplier documents by email and keeps one folder per project or customer.
Worked example
Beach Cities Builder is a general contracting firm in Hermosa Beach, California, run by Morgan Sterling, doing new construction, additions and remodels with 10 to 15 subcontractors on a typical job (OpenAI Academy story, 8 May 2026). Several subcontractor invoices arrive by email each day across about 30 active job folders. Before, each one meant opening it, identifying the project, entering the subcontractor, invoice number, amount due and payment details into Zoho Books and filing the document in the right Google Drive folder. With ChatGPT's help he built a script connected to his email that puts every invoice in one folder, reads it, identifies the job and moves it to the right place. The first version took about two hours to build, saves him roughly 5 to 6 hours a week, and he says the workflow is now effectively accurate every time. He also used ChatGPT to rebuild his website's SEO pages and metadata, which he credits with about 25% more inbound contacts, and a calendar script that adds a note when the seven day forecast shows more than a 40% chance of rain.
ChatGPT's part is writing the script and talking the owner through connecting it to his email; OpenAI's own guide points to Codex when the work is building an internal workflow tool. Any assistant that writes code, or Claude Code in the folder itself, produces the same script, and the email, Drive and accounting tools are whatever you already use.
Join the Agent OS Club
Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.
Founding offer, ends 31 December 2026 or at member 100
Join the Agent OS ClubBuilding this for an organization? Learn more at theagentiv.com
Sources
- https://academy.openai.com/public/blogs/how-chatgpt-became-a-contractors-back-office-2026-05-07
- https://academy.openai.com/public/clubs/work-users-ynjqu/resources/chatgpt-work-for-business-operations-teams-webinar-resource-guide-2026-08-26
Published: 2026-11-14