On a schedule
Back up your Airtable base to S3 every night
Every night each table in your Airtable base is saved as a CSV in a dated S3 folder, backups older than 30 days are removed, and Slack confirms it worked.
- Runs
- On a schedule
- Apps
- AWS, Slack
- AI
- Not needed
- Access
- s3:PutObject/ListBucket/DeleteObject; chat:write
Send this to your assistant
Create a ClickRuntime automation: every night at 2am, export each table of my Airtable base to CSV in S3 under today's date, delete backups older than 30 days, and post a confirmation to #ops.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small team runs its operations from an Airtable base: clients, projects, inventory. One bad bulk edit or a deleted table and months of work are gone, and the built-in history doesn't always go back far enough.
A nightly export to your own S3 bucket is a simple insurance policy. Keeping 30 days of dated copies means you can go back to any night, and a Slack confirmation proves the backup actually ran.
What you get out of it
Recover from mistakes
A bad import or accidental delete can be undone from last night's copy.
Backups you control
The files sit in your own AWS account, independent of Airtable.
Storage stays tidy
Copies older than 30 days are removed, so costs don't keep growing.
Proof it ran
A message every morning in #ops means silence is a warning sign, not the normal state.
How it works
What happens, step by step
Every night at 2am, ClickRuntime reads each table in your Airtable base.
It saves each one as a CSV file in your S3 bucket, in a folder named with today's date.
It deletes backup folders older than 30 days.
It posts a confirmation to #ops in Slack with the number of tables and records saved.
Before it runs live
- Connect AWS
- 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
- 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 Google Sheets
- Combine it with other AWS and Slack steps into one automation
Under the hood
The code that runs this automation
import csv, io, boto3
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
BASE_ID = "appXXXXXXXXXXXXXX"
REGION, BUCKET = "us-east-1", "northwind-files"
def aws(service):
return boto3.client(service, region_name=REGION, aws_access_key_id=credentials.secret("AWS_ACCESS_KEY_ID"),
aws_secret_access_key=credentials.secret("AWS_SECRET_ACCESS_KEY"))
@on_trigger
def run(event):
at = {"Authorization": "Bearer " + credentials.secret("AIRTABLE_TOKEN")}
s3, today, total = aws("s3"), date.today(), 0
tables = http.get(f"https://api.airtable.com/v0/meta/bases/{BASE_ID}/tables", headers=at).json()["tables"]
for t in tables:
records, offset = [], None
while True:
page = http.get(f"https://api.airtable.com/v0/{BASE_ID}/{t['id']}", headers=at, params={"offset": offset} if offset else {}).json()
records += page["records"]
if not (offset := page.get("offset")):
break
out, fields = io.StringIO(), sorted({k for r in records for k in r["fields"]})
w = csv.DictWriter(out, fieldnames=["id"] + fields)
w.writeheader()
w.writerows({"id": r["id"], **{k: str(v) for k, v in r["fields"].items()}} for r in records)
s3.put_object(Bucket=BUCKET, Key=f"backups/{today}/{t['name']}.csv", Body=out.getvalue().encode())
total += len(records)
old = [o for o in s3.list_objects_v2(Bucket=BUCKET, Prefix="backups/").get("Contents", []) if o["Key"].split("/")[1] < str(today - timedelta(days=30))]
if old:
s3.delete_objects(Bucket=BUCKET, Delete={"Objects": [{"Key": o["Key"]} for o in old]})
notify.slack(f":white_check_mark: Backup done: {len(tables)} tables, {total} records to s3://{BUCKET}/backups/{today}/ ({len(old)} old files removed)", channel="#ops")
return {"tables": len(tables), "records": total}FAQ
Common questions
Are linked records and attachments included?
How do I restore a table?
Can I keep backups longer?
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
Move old Salesforce files to S3 and report in Slack
Every week, Salesforce files older than a year are moved to your S3 bucket to free up storage, and Slack reports how many files and megabytes were archived.
See how it worksSave a copy of any web page to S3 and share the link in Slack
Send a URL to your automation's link and a copy of the page is saved to S3, with a download link posted to your research channel.
See how it worksPost a summary of each invoice uploaded to S3 to Slack
Each new invoice in your S3 bucket is read, and Slack gets the vendor, amount and due date within 15 minutes.
See how it worksKeep exploring
Set up “Back up your Airtable base to S3 every night” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.