Skip to content

On a schedule

Back up your Supabase storage files to Google Drive every night

Every night new and changed files in your Supabase storage bucket are copied to a Drive folder, and you get an email summary.

Runs
On a schedule
Apps
Google Drive, Supabase
AI
Not needed
Access
Supabase service key; Drive write

Send this to your assistant

Create a ClickRuntime automation: every night, check my Supabase storage bucket for new or updated files, upload them to my Drive 'Backups' folder and email me a summary.

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

A two-person startup stores customer uploads in Supabase storage. Everything works, but there is no second copy anywhere. One mistaken delete or a broken migration, and contracts and images customers uploaded would simply be gone.

This automation copies new and changed files from your storage bucket to Google Drive every night and emails you what it did. You get an independent backup without running any servers or scripts of your own.

What you get out of it

  • A second copy outside your database provider

    Keeping files in Drive as well as Supabase means one account problem or mistaken delete does not lose everything.

  • Only what changed is copied

    Files already backed up are skipped, so each night's run is quick and Drive does not fill with duplicates.

  • Proof the backup ran

    The nightly email shows how many files were copied, so you notice quickly if something stops working.

  • Easy to browse and restore

    Files sit in an ordinary Drive folder, so finding and downloading one does not need any technical tools.

How it works

What happens, step by step

  1. Every night ClickRuntime lists the files in your Supabase storage bucket.

  2. It compares each file with what it backed up before and skips anything unchanged.

  3. New and changed files are downloaded and uploaded to your Drive 'Backups' folder.

  4. You get an email with the number of files copied and their names.

Before it runs live

  • Connect Google Drive
  • Connect Supabase

What you get

RunsOn a schedule
Back up your Supabase storage files to Google Drive every nighttoday, 9:00Succeeded
Email · Nightly backupSupabase backup: 4 files copied. contracts/acme-2026.pdf, avatars/northwind.png …

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • 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

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.
back_up_files_tracked_in_supabase_to_google_drive.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_trigger, credentials, http, state, notify

SUPABASE_URL, BUCKET, FOLDER_ID = "https://yourproject.supabase.co", "uploads", "your-backups-folder-id"

@on_trigger
def run(event):
    key = credentials.secret("SUPABASE_SERVICE_KEY")
    h = {"Authorization": f"Bearer {key}", "apikey": key}
    files = http.post(f"{SUPABASE_URL}/storage/v1/object/list/{BUCKET}", headers=h,
                      json={"prefix": "", "limit": 1000, "sortBy": {"column": "updated_at", "order": "asc"}}).json()
    done = state.get("versions") or {}
    changed = [f for f in files if f.get("id") and done.get(f["name"]) != f["updated_at"]]
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    for f in changed:
        content = http.get(f"{SUPABASE_URL}/storage/v1/object/{BUCKET}/{f['name']}", headers=h).content
        drive.files().create(body={"name": f"{f['updated_at'][:10]} {f['name']}", "parents": [FOLDER_ID]},
                             media_body=MediaInMemoryUpload(content, mimetype=f.get("metadata", {}).get("mimetype", "application/octet-stream"))).execute()
        done[f["name"]] = f["updated_at"]
    state.set("versions", done)
    notify.email_me(f"Supabase backup: {len(changed)} files copied", "\n".join(f["name"] for f in changed) or "No changes tonight.")
    return {"copied": len(changed), "total": len(files)}

FAQ

Common questions

Which files are backed up?
All files in the storage bucket you choose. You can limit it to a folder inside the bucket, such as uploads or invoices.
What happens to a file that changes?
The new version is uploaded alongside the old one with the date in its name, so earlier versions are kept.
Are deleted files removed from Drive?
No. Files deleted from Supabase stay in Drive, which is what makes it useful as a backup.
What permissions does it need?
Supabase service key; Drive write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (on a schedule). 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 “Back up your Supabase storage files to Google Drive every night” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.