Skip to content

Every hour

Draft Google Docs from your stored research

Add a topic to your list and get a first draft in Google Docs built from the notes in your knowledge base.

Runs
Every hour
Apps
Google Docs, Pinecone
AI
Yes, uses the built-in AI allowance
Access
Pinecone key; Docs edit

Send this to your assistant

Create a ClickRuntime automation: every hour, check my Topics sheet for new topics, pull the most relevant notes from my Pinecone index and draft a Google Doc for each, then 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 consultancy has years of research notes, interview write-ups and past reports stored in a searchable knowledge base. When a new blog post or proposal is needed, writers still start from scratch because finding the right material takes longer than writing.

Drafting from your own stored research means the first version already contains your findings, examples and language. The writer edits and sharpens instead of searching and summarising.

What you get out of it

  • Drafts built on what you know

    Content is drawn from your own notes and reports, not generic web knowledge. The draft reflects your expertise and the examples only you have.

  • Research gets reused

    Work done for one client or project feeds later writing. The knowledge base stops being an archive nobody opens.

  • Faster first drafts

    Writers start with a structured draft and sources to check. The hours saved go into editing, which is where quality comes from.

  • A simple way to request drafts

    Anyone on the team can add a topic to the list. The draft link arrives by email, so there is no new tool to learn.

How it works

What happens, step by step

  1. Every hour, ClickRuntime checks your topics list for topics that do not have a draft yet.

  2. For each new topic, it finds the most relevant notes in your knowledge base.

  3. AI writes a first draft using those notes, with a list of sources at the end.

  4. The draft is saved as a new Google Doc, its link is added next to the topic, and you get an email with the link.

Before it runs live

  • Connect Google Docs
  • Connect Pinecone

What you get

RunsEvery hour
Draft Google Docs from your stored researchtoday, 9:00Succeeded
Email · DraftsDraft ready: How Northwind cut warehouse returns by rethinking packaging https://docs.google.com/document/d/4Qr/edit

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 Pinecone 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.
draft_documents_from_your_knowledge_base.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai, notify, report_fetched

SHEET_ID, PINECONE_HOST = "your-spreadsheet-id", "https://your-index.svc.pinecone.io"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    sheet = build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values()
    rows = sheet.get(spreadsheetId=SHEET_ID, range="Topics!A2:B").execute().get("values", [])
    new = [(i + 2, r[0]) for i, r in enumerate(rows) if r and (len(r) < 2 or not r[1])]
    report_fetched(len(new))
    if not new:
        return {"summary": "Nothing new"}
    docs = build("docs", "v1", credentials=creds, cache_discovery=False)
    for row, topic in new:
        hits = http.post(f"{PINECONE_HOST}/query", headers={"Api-Key": credentials.secret("PINECONE_API_KEY")},
                         json={"topK": 8, "includeMetadata": True, "vector": embed(topic)}).json().get("matches", [])
        notes = "\n\n".join(h["metadata"].get("text", "")[:1500] for h in hits)
        draft = ai.generate(f"Draft a document on '{topic}' using only these notes; list sources at the end.\n{notes}", max_output_tokens=2000).text
        doc = docs.documents().create(body={"title": topic}).execute()
        docs.documents().batchUpdate(documentId=doc["documentId"], body={"requests": [{"insertText": {"location": {"index": 1}, "text": draft}}]}).execute()
        link = f"https://docs.google.com/document/d/{doc['documentId']}/edit"
        sheet.update(spreadsheetId=SHEET_ID, range=f"Topics!B{row}", valueInputOption="RAW", body={"values": [[link]]}).execute()
        notify.email_me(f"Draft ready: {topic}", link)
    return {"drafted": len(new)}

def embed(text):
    r = http.post("https://api.pinecone.io/embed", headers={"Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-01"},
                  json={"model": "multilingual-e5-large", "inputs": [{"text": text}], "parameters": {"input_type": "query"}})
    return r.json()["data"][0]["values"]

FAQ

Common questions

What needs to be in the knowledge base?
Your notes stored in a Pinecone index with their text kept alongside each entry. The more specific and well-organised the notes, the better the drafts.
Does the draft show which notes it used?
Yes. A short list of the source notes is added at the end of the draft, so editors can check facts and quotes against the original.
Can it write different kinds of documents?
Yes. Add a type column to your topics list, such as blog post, proposal or briefing, and the draft follows the structure for that type.
What permissions does it need?
Pinecone key; Docs edit. 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 each time it checks. Checks that find nothing new and stop right away aren't counted.
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 “Draft Google Docs from your stored research” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.