Daily
File new invoices in Drive and tell finance in Slack
Every invoice that arrives by email lands in your Drive Invoices folder, and #finance gets a daily list with links.
- Runs
- Daily
- Apps
- Google Drive, Slack
- AI
- Optional
- Access
- Drive write; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every day, save new invoice attachments from my email to my Drive 'Invoices' folder and post the list with links to #finance.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An office manager at a small design studio gets supplier invoices by email all week. Some get forwarded to the bookkeeper, some sit in her inbox, and at month end she spends an afternoon digging through threads to find the missing ones.
Having every invoice saved in one shared folder, with the finance channel told each day what arrived, means nobody chases paperwork at month end and nothing is paid twice or missed.
What you get out of it
One place for every invoice
Invoices stop living in individual inboxes. Anyone in finance can open the Drive folder and find a bill without asking who received it.
Finance sees new bills the same day
A daily note in #finance lists what came in, so payments can be scheduled before due dates rather than after a reminder from the supplier.
Month end gets shorter
When the accountant asks for all invoices from a period, the folder already has them. There is no hunt through old email threads.
Nothing filed twice
Each attachment is saved once, so the folder stays clean and the daily list only shows genuinely new invoices.
How it works
What happens, step by step
Once a day ClickRuntime looks through your recent email for invoice attachments.
It skips any invoice it has already saved on an earlier day.
Each new invoice is saved to your Invoices folder in Google Drive.
A short list of the new invoices, with links, is posted in your #finance Slack channel.
Before it runs live
- Connect Google Drive
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
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
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Google Drive and Slack steps into one automation
Under the hood
The code that runs this automation
import base64, json
from clickruntime import on_trigger, credentials, http, state, notify
FOLDER_ID = "your-invoices-folder-id"
G = "https://gmail.googleapis.com/gmail/v1/users/me"
UPLOAD = "https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,webViewLink"
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
seen = set(state.get("seen") or [])
msgs = http.get(f"{G}/messages", headers=h, params={"q": "has:attachment filename:pdf (invoice OR bill) newer_than:2d"}).json().get("messages", [])
saved = []
for m in [m for m in msgs if m["id"] not in seen]:
msg = http.get(f"{G}/messages/{m['id']}", headers=h).json()
for part in msg["payload"].get("parts", []):
if part.get("filename", "").lower().endswith(".pdf"):
data = http.get(f"{G}/messages/{m['id']}/attachments/{part['body']['attachmentId']}", headers=h).json()["data"]
meta = json.dumps({"name": part["filename"], "parents": [FOLDER_ID]})
f = http.post(UPLOAD, headers=h, files={"metadata": (None, meta, "application/json"),
"file": (part["filename"], base64.urlsafe_b64decode(data), "application/pdf")}).json()
saved.append(f"• <{f['webViewLink']}|{part['filename']}>")
seen.add(m["id"])
if saved:
notify.slack("New invoices filed in Drive:\n" + "\n".join(saved), channel="#finance")
state.set("seen", list(seen)[-500:])
return {"saved": len(saved)}FAQ
Common questions
Which emails does it treat as invoices?
Can it file invoices into monthly subfolders?
What does the Slack note include?
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
Write a weekly AI brief, save it as a PDF in Drive and share it in Slack
Every Monday a written brief from your notes lands in Drive as a PDF, with the link posted in your Slack channel.
See how it worksGet a weekly Drive cleanup report in Slack
Every Monday you see the duplicate files, old backups and long-untouched files in your Drive, so cleanup takes minutes.
See how it worksMerge daily CSV exports in Drive into one clean master file
Each evening the day's CSV exports are combined into one deduplicated file in Drive, and your team sees row counts and problems in Slack.
See how it worksKeep exploring
Set up “File new invoices in Drive and tell finance in Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.