Skip to content

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.

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

  1. When someone submits your support form, the question is sent to your ClickRuntime trigger link.

  2. ClickRuntime searches your Supabase documents table for the passages that best match the question.

  3. AI writes a draft answer using only those passages and lists the documents they came from.

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

RunsThe moment it happens
Draft answers to support questions from your own documentsjust nowSucceeded
Email · Draft answerQ: How do I export invoices to CSV? Draft: Open Billing, choose Export and pick CSV [1]. Sources: Acme Billing Guide

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 Drive and Supabase 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.
answer_incoming_questions_from_drive_docs_stored_in_supabase.pyexample
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?
A separate step splits your documents into passages and stores them in a Supabase table with a search index. That needs to be set up once and refreshed when documents change.
Does it reply to the customer directly?
No. The draft is emailed to you, so a person reads and sends the final answer.
What if nothing relevant is found?
The email says so and includes the question, so you can answer it yourself and consider adding the answer to your guides.
What permissions does it need?
Supabase read; Drive read (metadata). 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 “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.