Skip to content

On a schedule

Back up your data to Google Drive every night

Every night your data is saved to a dated folder in Google Drive, and Discord tells you whether the backup worked.

Runs
On a schedule
Apps
Discord, Google Drive
AI
Not needed
Access
Drive drive.file; bot Send Messages

Send this to your assistant

Create a ClickRuntime automation: every night at 2am, export my workflows as JSON, save them to a dated folder in Google Drive and post the result to my Discord channel.

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 small operations team relies on dozens of workflows and configurations that live inside one tool. Nobody has a copy outside it. If someone deletes the wrong item, an update goes badly or the account has a problem, weeks of work could disappear, and there is no easy way to see what a workflow looked like last Tuesday.

This automation exports everything each night into its own dated folder in Google Drive and posts a short result in Discord. You always have yesterday's copy, and you hear straight away if a backup did not run.

What you get out of it

  • A copy that lives outside the tool

    Your data is kept in Google Drive, separate from the system it came from. An outage or accidental delete there does not take your backup with it.

  • Go back to any night

    Each night gets its own dated folder, so you can compare or restore a version from any day. Mistakes found a week later can still be undone.

  • You know the backup actually ran

    A Discord message after each run shows how many items were saved or what went wrong. Silent backup failures are the ones that hurt most.

  • One file per item

    Each workflow is saved as its own file, so restoring one does not mean digging through a large archive. Files are easy to search and compare.

How it works

What happens, step by step

  1. Every night at 2:00, ClickRuntime collects the items you want to back up.

  2. A new folder named with the date is created in your Google Drive backup folder.

  3. Each item is saved into that folder as its own file.

  4. A message in your Discord channel says how many items were saved, or what went wrong.

Before it runs live

  • Connect Discord
  • Connect Google Drive

What you get

RunsOn a schedule
Back up your data to Google Drive every nighttoday, 9:00Succeeded
Discord · #opsBackup done: 42 items saved to backup-2026-10-19

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 Discord and Google Drive 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.
nightly_backup_to_drive_with_a_discord_alert.pyexample
import json
from datetime import date
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from google.oauth2.credentials import Credentials
from clickruntime import on_trigger, credentials, http, notify

SOURCE_URL = "https://automation.example.com/api/v1/workflows"
PARENT_FOLDER_ID = "your-drive-folder-id"
CHANNEL_ID = "your-discord-channel-id"

@on_trigger
def run(event):
    def discord(text):
        http.post(f"https://discord.com/api/v10/channels/{CHANNEL_ID}/messages",
                  headers={"Authorization": f"Bot {credentials.secret('DISCORD_BOT_TOKEN')}"}, json={"content": text})
    try:
        items = http.get(SOURCE_URL, headers={"X-API-KEY": credentials.secret("SOURCE_API_KEY")}).json()["data"]
        drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
        folder = drive.files().create(body={"name": f"backup-{date.today().isoformat()}", "parents": [PARENT_FOLDER_ID],
                                            "mimeType": "application/vnd.google-apps.folder"}, fields="id").execute()["id"]
        for it in items:
            drive.files().create(body={"name": f"{it['name']}.json", "parents": [folder]},
                                 media_body=MediaInMemoryUpload(json.dumps(it, indent=2).encode(), mimetype="application/json")).execute()
    except Exception as e:
        discord(f"Backup failed: {e}")
        notify.email_me("Nightly backup failed", str(e))
        raise
    discord(f"Backup done: {len(items)} items saved to backup-{date.today().isoformat()}")
    return {"saved": len(items)}

FAQ

Common questions

What can be backed up this way?
Anything that can be exported over the web as files, such as workflows, settings, form definitions or database exports. The same pattern works for most tools with an export option.
How much Drive space does it use?
Usually very little, since configuration files are small. You can delete old dated folders after a few months if space matters.
What happens if the backup fails?
The Discord message says it failed and why, and you also get an email. The previous night's folder is left untouched.
What permissions does it need?
Drive drive.file; bot Send Messages. 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 data to Google Drive every night” from your assistant

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