The moment it happens
Turn a topic into a Google Doc of researched drafts
Send a topic to your trigger link and get a new Google Doc with researched drafts for your channels, such as a blog outline and social posts, in your shared folder.
- Runs
- The moment it happens
- Apps
- Google Docs, SerpApi
- AI
- Yes, uses the built-in AI allowance
- Access
- SerpApi key; folder shared with service account
Send this to your assistant
Create a ClickRuntime automation: when I send a topic to this link, search Google with SerpApi, write drafts for my blog, LinkedIn and newsletter, put them in a new Google Doc in my Drafts folder and email me the link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A two-person marketing team at a regional accounting firm reviews everything in Google Docs: drafts are written there, partners leave comments there, and the final version gets copied to the website and LinkedIn. Each piece starts with the same research and a blank document, which slows down the whole cycle.
This automation hands them a starting point. They send a topic to the trigger link, it searches Google through SerpApi, AI writes drafts for each channel from the results, and a new Google Doc appears in their shared Drafts folder. The link arrives by email, and the review process carries on as usual in Docs.
What you get out of it
Start with a draft, not a blank page
Editing a researched draft is much faster than writing from scratch. The team spends its time improving content instead of starting it.
Fits the review process you already have
Drafts land in Google Docs, where your team already comments and suggests edits. Nobody has to learn a new tool.
All channels from one topic
Blog, LinkedIn and newsletter drafts come together in one document. The message stays consistent across channels.
Research travels with the drafts
Sources are listed at the bottom of the document. Reviewers can check facts without redoing the search.
How it works
What happens, step by step
When a topic arrives at the automation's trigger link, ClickRuntime searches Google for it through SerpApi.
AI writes a draft for each of your channels from the top results and lists the sources.
A new Google Doc named after the topic is created in your Drafts folder with the drafts inside.
You get an email with a link to the document.
Before it runs live
- Connect Google Docs
- Connect SerpApi
- Paste your automation's link into the other app's webhook settings
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 Google Docs and SerpApi steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, ai, notify
FOLDER_ID = "your-drive-folder-id"
CHANNELS = "Blog outline, LinkedIn post, Newsletter paragraph"
def new_doc(title, text):
creds = Credentials(credentials.connection("google", "work"))
docs = build("docs", "v1", credentials=creds, cache_discovery=False)
doc_id = docs.documents().create(body={"title": title}).execute()["documentId"]
docs.documents().batchUpdate(documentId=doc_id, body={"requests": [{"insertText": {"location": {"index": 1}, "text": text}}]}).execute()
build("drive", "v3", credentials=creds, cache_discovery=False).files().update(fileId=doc_id, addParents=FOLDER_ID, fields="id").execute()
return f"https://docs.google.com/document/d/{doc_id}/edit"
@on_event
def handle(event):
topic = ((event.json or {}).get("topic") or "").strip()
if not topic:
return {"error": "no topic"}
results = http.get("https://serpapi.com/search", params={"engine": "google", "q": topic, "api_key": credentials.secret("SERPAPI_API_KEY")}).json().get("organic_results", [])[:8]
sources = "\n".join(f"- {r['title']}: {r.get('snippet', '')} ({r['link']})" for r in results)
drafts = ai.generate(f"Topic: {topic}\nResearch:\n{sources}\nWrite drafts with a heading for each: {CHANNELS}. End with a Sources list.", max_output_tokens=1500).text
url = new_doc(f"Drafts: {topic}", drafts)
notify.email_me(f"Drafts ready: {topic}", url)
return {"doc": url}FAQ
Common questions
Which channels does it write for?
Who can see the documents?
Does it publish anything?
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
Create a research brief on a client or property in Google Docs
Send a client name or a property address and get a Google Doc with background, recent news and talking points, built from fresh search results.
See how it worksGet error alerts with a plain-English explanation
When one of your jobs or systems fails, #ops gets the error and a one-line guess at the cause, without the same error twice in an hour.
See how it worksSend your best leads to sales straight away
Every contact form message is scored, and the promising ones reach #sales while they're still warm.
See how it worksKeep exploring
Set up “Turn a topic into a Google Doc of researched drafts” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.
