The moment it happens
Draft answers to support questions from your own documents
Each question from your support form comes back to you as a drafted answer with links to the documents it used.
- Runs
- The moment it happens
- Apps
- Google Drive, Supabase
- AI
- Yes, uses the built-in AI allowance
- Access
- Supabase read; Drive read (metadata)
Send this to your assistant
Create a ClickRuntime automation: when my support form posts a question to my trigger link, search my Supabase documents table for the most relevant passages and email me a drafted answer with sources.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A software company with a two-person support team has hundreds of pages of guides in Google Drive. Most questions are already answered somewhere in those guides, but finding the right page takes longer than writing the reply.
A drafted answer built from the most relevant passages, with links to the source documents, lets the team check and send a reply in minutes instead of searching first.
What you get out of it
Answers grounded in your own guides
Drafts are written from passages in your documents, so they reflect how your product actually works rather than general advice.
Sources to check against
Each draft lists the documents it drew on, so the person replying can confirm the answer in seconds.
Faster replies with the same team
Removing the search step lets a small team answer more questions in a day without cutting corners.
Shows gaps in your documentation
Questions that come back with weak sources point to topics your guides do not cover yet.
How it works
What happens, step by step
When someone submits your support form, the question is sent to your ClickRuntime trigger link.
ClickRuntime searches your Supabase documents table for the passages that best match the question.
AI writes a draft answer using only those passages and lists the documents they came from.
You get an email with the question, the draft answer and links to the source documents in Drive.
Before it runs live
- Connect Google Drive
- Connect Supabase
- 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 Drive and Supabase steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, notify, ai, http
SUPABASE = "https://yourproject.supabase.co"
@on_event
def handle(event):
q = event.json["question"]
key = credentials.secret("SUPABASE_KEY")
h = {"apikey": key, "Authorization": f"Bearer {key}"}
emb = http.post("https://api.openai.com/v1/embeddings", headers={"Authorization": f"Bearer {credentials.secret('OPENAI_API_KEY')}"},
json={"model": "text-embedding-3-small", "input": q}).json()["data"][0]["embedding"]
chunks = http.post(f"{SUPABASE}/rest/v1/rpc/match_documents", headers=h, json={"query_embedding": emb, "match_count": 5}).json()
if not chunks:
notify.email_me("Support question with no sources", q)
return {"sources": 0}
context = "\n\n".join(f"[{i}] {c['content'][:1500]}" for i, c in enumerate(chunks, 1))
answer = ai.generate(f"Answer using only these passages and cite [n]:\n{context}\n\nQuestion: {q}", max_output_tokens=500).text
gtoken = credentials.connection("google", "work")
links = []
for c in chunks:
meta = http.get(f"https://www.googleapis.com/drive/v3/files/{c['file_id']}", params={"fields": "name,webViewLink"},
headers={"Authorization": f"Bearer {gtoken}"}).json()
links.append(f"{meta.get('name')}: {meta.get('webViewLink')}")
notify.email_me(f"Draft answer: {q[:80]}", f"Q: {q}\n\n{answer}\n\nSources:\n" + "\n".join(links))
return {"sources": len(chunks)}FAQ
Common questions
How do my Drive documents get into Supabase?
Does it reply to the customer directly?
What if nothing relevant is found?
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
Turn a website address into a company profile in Supabase and Drive
Submit a company's website and get its mission, services, contacts and keywords saved as a row in Supabase and a profile doc in Drive.
See how it worksCategorise bank statement transactions into Supabase
Drop a bank statement CSV into Drive and each transaction is sorted into your own categories and saved to your Supabase database.
See how it worksKeep a Drive folder searchable in your Supabase vector table
New and updated documents in your Drive Knowledge folder are split into chunks, embedded and kept in step in your Supabase documents table, so your app always searches current content.
See how it worksKeep exploring
Set up “Draft answers to support questions from your own documents” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.