Every hour
Draft articles from approved Airtable topics into Drive
Topics you approve in Airtable are written up as draft articles, saved as Google Docs in Drive, and linked back on the record.
- Runs
- Every hour
- Apps
- Airtable, Google Drive
- AI
- Yes, uses the built-in AI allowance
- Access
- Airtable read+write; Drive write
Send this to your assistant
Create a ClickRuntime automation: every hour, for content rows in Airtable marked 'Approved', write a draft article, save it as a Google Doc in my Drive 'Drafts' folder, and put the link back on the record with the status 'Drafted'.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A marketing lead plans the blog in an Airtable table: topic ideas, target keyword, audience and a status. Approving a topic is quick. Getting a first draft written is where things stall, because the writer starts each one from a blank page and the topic sits as 'Approved' for weeks.
Writing a first draft as soon as a topic is approved, and filing it as a Google Doc where the team already edits, means the writer starts with something to shape. The link on the Airtable record keeps the plan and the draft together.
What you get out of it
Approval leads straight to a draft
Within the hour, an approved topic has a first draft the team can open and edit.
Drafts land where you edit
Each draft is a Google Doc in your Drafts folder, so comments and suggestions work as usual.
The plan stays in Airtable
The record moves to Drafted and holds the link, so the content calendar always shows what exists.
Your brief shapes the draft
Keyword, audience and notes from the record are given to AI, so the draft follows your plan.
How it works
What happens, step by step
Every hour, ClickRuntime looks in your Airtable content table for topics marked Approved.
AI writes a first draft using the topic, keyword, audience and notes on each record.
The draft is saved as a Google Doc in your Drafts folder in Drive.
The Airtable record gets the doc link and moves to Drafted, so it is not written again.
Before it runs live
- Connect Airtable
- 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
- 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 Airtable and Google Drive steps into one automation
Under the hood
The code that runs this automation
import io
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, http, ai, report_fetched
BASE_ID, FOLDER_ID = "appXXXXXXXXXXXXXX", "1FolderIdOfDrafts"
@on_trigger
def run(event):
api = f"https://api.airtable.com/v0/{BASE_ID}/Content"
headers = {"Authorization": f"Bearer {credentials.connection('airtable', 'work')}"}
rows = http.get(api, headers=headers, params={"filterByFormula": "{Status}='Approved'", "maxRecords": 3}).json()["records"]
report_fetched(len(rows))
if not rows:
return {"drafted": 0}
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
for rec in rows:
f = rec["fields"]
draft = ai.generate(f"Topic: {f.get('Topic')}\nKeyword: {f.get('Keyword', '')}\nAudience: {f.get('Audience', '')}\nNotes: {f.get('Notes', '')}",
system="Write an 800-1000 word blog draft in simple HTML with h2 headings and short paragraphs.",
max_output_tokens=2048).text
doc = drive.files().create(
body={"name": f.get("Topic", "Draft"), "parents": [FOLDER_ID], "mimeType": "application/vnd.google-apps.document"},
media_body=MediaIoBaseUpload(io.BytesIO(draft.encode()), mimetype="text/html"),
fields="webViewLink").execute()
http.patch(api, headers=headers, json={"records": [{"id": rec["id"], "fields": {
"Status": "Drafted", "Draft": doc["webViewLink"]}}]}).raise_for_status()
return {"drafted": len(rows)}FAQ
Common questions
How long are the drafts?
Will it publish the article?
What if I approve a topic again later?
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
Screen CVs from a Drive folder into Airtable
Each CV dropped into your Drive folder is read, scored against the job, and saved as a candidate record in Airtable.
See how it worksWrite captions for Drive videos and track them in Airtable
Each video or photo you drop into a Drive folder gets a caption and hashtags and appears in your Airtable content table, ready to post.
See how it worksTurn invoice PDFs in Drive into Airtable rows
Each invoice or receipt you save to a Drive folder becomes an Airtable record with vendor, number, date, total and line items.
See how it worksKeep exploring
Set up “Draft articles from approved Airtable topics into Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.