Every 15 minutes
Sort new Drive files into the right folders
Files dropped into your Drive inbox are filed as invoices, contracts, HR or other, and your team gets a summary in Slack.
- Runs
- Every 15 minutes
- Apps
- Google Drive, Slack
- AI
- Yes, uses the built-in AI allowance
- Access
- Drive read+write; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, classify new files in my Drive 'Inbox' folder as invoice, contract, HR or other, move each to the matching folder and post a summary to #ops.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An office manager at a twenty-person firm has one shared Drive folder where everyone drops paperwork: supplier invoices, signed contracts, sick notes, insurance letters. Once a week she sorts it by hand. Until then, the accountant cannot find invoices and contracts sit next to personal HR documents.
Filing each document shortly after it arrives keeps the inbox empty and puts papers where the people who need them already look.
What you get out of it
Invoices reach finance the same day
Moving invoices into the finance folder as they arrive means they are seen before the due date, not at the end of the week.
HR documents stay out of shared view
Personal documents are moved into the HR folder quickly, so they do not sit in a folder the whole office can open.
No weekly sorting session
The hour spent opening and dragging files each week goes away. Only the files marked other need a person to decide.
A record of what was filed where
The Slack summary lists each file and its new folder, so anyone can find a document without searching, and mistakes are easy to spot and move back.
How it works
What happens, step by step
Every 15 minutes ClickRuntime looks for new files in your Inbox folder in Google Drive.
AI reads the start of each file and decides whether it is an invoice, a contract, an HR document or something else.
Each file is moved to the folder for its category.
A short summary of what was filed and where is posted in your #ops 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
- 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 Google Sheets
- Combine it with other Google Drive and Slack steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, notify, ai, report_fetched, http
INBOX = "inbox-folder-id"
FOLDERS = {"invoice": "invoices-id", "contract": "contracts-id", "hr": "hr-id", "other": "other-id"}
API = "https://www.googleapis.com/drive/v3/files"
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
files = http.get(API, headers=h, params={"q": f"'{INBOX}' in parents and trashed=false",
"fields": "files(id,name)"}).json()["files"]
report_fetched(len(files))
if not files:
return {"summary": "Inbox empty"}
lines = []
for f in files:
text = http.get(f"{API}/{f['id']}/export", headers=h, params={"mimeType": "text/plain"}).text[:2000]
label = ai.generate(f"File: {f['name']}\n{text}\nAnswer with one word: invoice, contract, hr or other.",
max_output_tokens=10).text.strip().lower()
label = label if label in FOLDERS else "other"
http.patch(f"{API}/{f['id']}", headers=h, params={"addParents": FOLDERS[label], "removeParents": INBOX})
lines.append(f"{f['name']} -> {label}")
notify.slack("Filed from Inbox:\n" + "\n".join(lines), channel="#ops")
return {"filed": len(files)}FAQ
Common questions
Can I add my own categories?
What happens to files it is unsure about?
Does it rename files?
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
Screen CVs in Drive and post the shortlist to Slack
Every CV saved to your Candidates folder gets a score against the job and a short summary in your hiring channel.
See how it worksSummarise new Drive videos in Slack
Every video added to your Recordings folder gets a short written summary and link posted to your team's Slack channel.
See how it worksGet a risk review of every new contract in Slack
Each contract PDF you drop into your Drive Contracts folder gets a short list of key terms and risky clauses posted in #legal.
See how it worksKeep exploring
Set up “Sort new Drive files into the right folders” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.