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.
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
Every hour, ClickRuntime checks your topics list for topics that do not have a draft yet.
For each new topic, it finds the most relevant notes in your knowledge base.
AI writes a first draft using those notes, with a list of sources at the end.
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
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 Pinecone 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_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?
Does the draft show which notes it used?
Can it write different kinds of documents?
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
Index reports in Pinecone and write an analysis to Google Docs
Your report documents are indexed in Pinecone, and each quarter an AI analysis drawing on them is written into a new Google Doc.
See how it worksDraft email replies from your FAQ Google Doc
New customer emails get a draft reply in Gmail based on the answers in your FAQ Google Doc, ready for you to check and send.
See how it worksGive your Telegram bot a long-term memory
Tell your Telegram bot things as they come up and ask about them later; it remembers what you said and keeps a running notes Doc.
See how it worksKeep exploring
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.