Collects as they arrive, acts daily
Get a weekly list of invoices from your inbox
Each week you get the vendor, amount and due date of every invoice and receipt that arrived by email.
- Runs
- Collects as they arrive, acts daily
- Apps
- Gmail
- AI
- Yes, uses the built-in AI allowance
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: when an email with an invoice or receipt attached arrives, pull out the vendor, amount and due date. Every Friday, email me the list.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Invoices and receipts reach a freelancer or small finance team as PDF attachments scattered over months of email. At tax time or month-end close, someone opens each one, reads the supplier, date, total and VAT, and types them into a spreadsheet. A dozen a month is tolerable, but a hundred is a lost weekend, and one transposed digit means the books do not reconcile with the bank.
Messages with an invoice or receipt attachment are found with a Gmail search as they arrive. The attachment is read, ClickRuntime's built-in AI extracts fields such as supplier, invoice number, date and amount, and each record is stored. Once a week an email summarizes everything collected, so the totals are already waiting.
Freelancers, bookkeepers and owners of small companies who receive supplier bills by email can use it to keep their records current.
What you get out of it
Month-end stops being a data entry job
Fields already pulled from each document replace hours of retyping, so closing the books becomes a review of a ready list and not a weekend with a stack of PDFs.
Fewer transcription mistakes
Numbers read from the document and stored automatically avoid the wrong digit or swapped date that makes a reconciliation fail and costs an hour to hunt down. Fewer corrections later also means less friction with your accountant.
Nothing important is missed
Every email matching the search is processed, so an invoice sent to your inbox in a busy week is captured, which prevents late payment fees and unclaimed deductions. Catching them in time can save real money each quarter.
A weekly summary shows what is owed
The email lists suppliers and amounts that arrived during the week, giving a regular picture of upcoming bills and spending, which helps with cash planning. Nothing about the figures has to be recalculated by hand.
Records are ready for your accountant
A consistent stored list of dates, suppliers and totals can be handed over at year end, which shortens the accountant's work and may reduce what they charge. Good records also help if a tax office asks questions.
How it works
What happens, step by step
Every day ClickRuntime looks in your Gmail for new emails with attachments that mention an invoice or receipt.
AI reads each attachment and pulls out the supplier, the amount and the due date.
It skips emails it has already processed and keeps the details until the end of the week.
Once a week you get an email listing every invoice found, with supplier, amount and due date.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import base64
from datetime import datetime
from zoneinfo import ZoneInfo
from clickruntime import on_trigger, credentials, state, ai, notify
SCHEMA = {"type": "object", "properties": {"vendor": {"type": "string"}, "amount": {"type": "string"},
"due_date": {"type": "string"}}, "required": ["vendor", "amount", "due_date"]}
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
found, done = state.get("invoices") or [], set(state.get("done") or [])
msgs = gmail.users().messages().list(userId="me", q="has:attachment (invoice OR receipt) newer_than:2d").execute().get("messages", [])
for m in [m for m in msgs if m["id"] not in done]:
msg = gmail.users().messages().get(userId="me", id=m["id"]).execute()
names = [p["filename"] for p in msg["payload"].get("parts", []) if p.get("filename")]
text = next((base64.urlsafe_b64decode(p["body"]["data"]).decode(errors="ignore")
for p in msg["payload"].get("parts", []) if p["mimeType"] == "text/plain" and p["body"].get("data")), msg["snippet"])
found.append(ai.generate(f"Extract vendor, total amount and due date. Attachments: {names}\n{text[:4000]}",
json_schema=SCHEMA, max_output_tokens=100).json)
done.add(m["id"])
now = datetime.now(ZoneInfo("Europe/London"))
if now.weekday() == 4 and now.hour == 16 and found: # Friday 4pm: send the week's list
notify.email_me(f"{len(found)} invoices this week",
"\n".join(f"{i['vendor']}: {i['amount']}, due {i['due_date']}" for i in found))
found = []
state.set("invoices", found)
state.set("done", sorted(done)[-1000:])
return {"pending": len(found)}FAQ
Common questions
Which fields does it extract?
How accurate is the extraction?
Does it work with receipts that are not attachments?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Collect unsubscribes and bounces for your list
Unsubscribe requests and bounced emails are labelled, and you get the addresses once a day to clean your list.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksGet draft replies to emails that need an answer
Emails that need a reply get a draft in the same thread, ready for you to edit and send.
See how it worksKeep exploring
Set up “Get a weekly list of invoices from your inbox” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.