Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Once a day ClickRuntime looks through your recent email for invoice attachments.

  2. It skips any invoice it has already saved on an earlier day.

  3. Each new invoice is saved to your Invoices folder in Google Drive.

  4. 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

RunsDaily
File new invoices in Drive and tell finance in Slacktoday, 9:00Succeeded
Slack · #financeNew invoices filed in Drive: Northwind Supplies INV-2041.pdf, Acme Hosting October.pdf

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
invoices_saved_to_drive_with_a_slack_note.pyexample
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?
Emails with a PDF attachment whose subject or file name mentions invoice or bill. You can add sender addresses or other words if your suppliers use different wording.
Can it file invoices into monthly subfolders?
Yes. It can create a folder per month inside Invoices and save each file there, which matches how most bookkeepers like to receive them.
What does the Slack note include?
The file name and a link to the file in Drive. If nothing new arrived that day, no message is posted.
What permissions does it need?
Drive write; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
No, but you can ask for an AI step (for example a summary). It then uses ClickRuntime's built-in AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.