Every 30 minutes
Categorise bank statement transactions into Supabase
Drop a bank statement CSV into Drive and each transaction is sorted into your own categories and saved to your Supabase database.
- Runs
- Every 30 minutes
- Apps
- Google Drive, Supabase
- AI
- Yes, uses the built-in AI allowance
- Access
- Drive read; Supabase write
Send this to your assistant
Create a ClickRuntime automation: when a new CSV appears in my Drive 'Statements' folder, categorise each transaction with AI using my categories table in Supabase and insert them into the 'transactions' table.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A freelancer downloads her bank statements each month and spends an evening tagging every line as software, travel, client income or personal so she can see her spending and prepare for her tax return. Her bank's own categories are too vague, and the spreadsheet she keeps grows harder to manage.
Sorting each transaction into your own categories as soon as the statement is saved, and storing it in a database you control, gives you an accurate picture of where money goes. Freelancers, small business owners and developers building their own finance dashboards use it to keep their books current with one file drop.
What you get out of it
Your categories, not the bank's
Transactions are sorted into the categories you keep in Supabase, so reports match how you think about your money.
Month-end bookkeeping in minutes
Dropping the CSV in a folder is the only manual step. The categorised transactions are ready to review.
Data you own and can query
Everything lands in your own database, ready for dashboards, tax summaries or your own tools.
Consistent categorisation
Similar transactions are labelled the same way each month, which makes month-to-month comparisons reliable.
How it works
What happens, step by step
Every few minutes ClickRuntime checks your Drive Statements folder for new CSV files.
It skips any file it has already processed.
It reads your list of categories from Supabase, and AI assigns one to each transaction.
Every transaction is saved to your transactions table with its date, description, amount and category.
Before it runs live
- Connect Google Drive
- Connect Supabase
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 Google Drive and Supabase steps into one automation
Under the hood
The code that runs this automation
import csv, io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched
FOLDER_ID, SUPABASE = "your-statements-folder-id", "https://yourproject.supabase.co"
@on_trigger
def run(event):
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
seen = set(state.get("seen") or [])
files = drive.files().list(q=f"'{FOLDER_ID}' in parents and mimeType='text/csv' and trashed=false", fields="files(id,name)").execute()["files"]
new = [f for f in files if f["id"] not in seen]
report_fetched(len(new))
if not new:
return {"summary": "Nothing new"}
key = credentials.secret("SUPABASE_SERVICE_KEY")
sb = {"apikey": key, "Authorization": f"Bearer {key}"}
cats = [c["name"] for c in http.get(f"{SUPABASE}/rest/v1/categories", headers=sb, params={"select": "name"}).json()]
for f in new:
rows = list(csv.DictReader(io.StringIO(drive.files().get_media(fileId=f["id"]).execute().decode())))
for i in range(0, len(rows), 50):
batch = rows[i:i + 50]
listing = "\n".join(f"{n + 1}. {r['Description']} {r['Amount']}" for n, r in enumerate(batch))
labels = ai.generate(f"Categories: {', '.join(cats)}\nGive one category per line for:\n{listing}", max_output_tokens=600).text.splitlines()
http.post(f"{SUPABASE}/rest/v1/transactions", headers=sb, json=[{"date": r["Date"], "description": r["Description"], "amount": float(r["Amount"]),
"category": (labels[n].split(". ", 1)[-1].strip() if n < len(labels) else "Uncategorised")} for n, r in enumerate(batch)])
seen.add(f["id"])
state.set("seen", list(seen)[-500:])
return {"files": len(new)}FAQ
Common questions
Which banks' CSV files work?
What if a transaction does not fit any category?
Will transactions be added twice if I upload an overlapping statement?
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
Keep a Drive folder searchable in your Supabase vector table
New and updated documents in your Drive Knowledge folder are split into chunks, embedded and kept in step in your Supabase documents table, so your app always searches current content.
See how it worksDraft answers to support questions from your own documents
Each question from your support form comes back to you as a drafted answer with links to the documents it used.
See how it worksTurn a website address into a company profile in Supabase and Drive
Submit a company's website and get its mission, services, contacts and keywords saved as a row in Supabase and a profile doc in Drive.
See how it worksKeep exploring
Set up “Categorise bank statement transactions into Supabase” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.