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.
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
Every night at 2:00, ClickRuntime collects the items you want to back up.
A new folder named with the date is created in your Google Drive backup folder.
Each item is saved into that folder as its own file.
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
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
- 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
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?
How much Drive space does it use?
What happens if the backup fails?
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
Save Discord attachments to Google Drive
Every file shared in your Discord channel is copied to a Google Drive folder within 15 minutes, named with the channel, author and date.
See how it worksAnnounce new Google Drive files in Discord
When someone drops a file into your Drive inbox folder, your Discord channel gets a message with its name, owner and link.
See how it worksKnow the moment your website goes down
Your team hears in Slack when the site stops responding or slows down, and again when it's back.
See how it worksKeep exploring
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.