Skip to content

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.

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 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

  1. When a topic arrives at the automation's trigger link, ClickRuntime searches Google for it through SerpApi.

  2. AI writes a draft for each of your channels from the top results and lists the sources.

  3. A new Google Doc named after the topic is created in your Drafts folder with the drafts inside.

  4. 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

RunsThe moment it happens
Turn a topic into a Google Doc of researched draftsjust nowSucceeded
Email · Drafts readyDrafts ready: new lease accounting rules for small businesses. docs.google.com/document/d/...

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

  • 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

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.
research_a_topic_into_a_google_doc_of_drafts.pyexample
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?
Any you list, such as a blog outline, a LinkedIn post and a newsletter paragraph. Each gets its own heading in the document.
Who can see the documents?
Anyone with access to the Drive folder you choose. The documents belong to the Google account you connect.
Does it publish anything?
No. It only creates the document. Publishing happens after your team has reviewed it.
What permissions does it need?
SerpApi key; folder shared with service account. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “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.