Skip to content

Every 5 minutes

Draft replies to support emails from your Drive help docs

Each new support email gets a draft reply in Gmail, written from the help documents you keep in Drive.

Runs
Every 5 minutes
Apps
Google Drive, Pinecone
AI
Yes, uses the built-in AI allowance
Access
Pinecone read; Drive read; Gmail compose

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check my support inbox for new emails, look up the answer in my Pinecone index of Drive help docs, and save a draft reply in Gmail. Post the trickier ones to #support.

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

Support emails repeat the same twenty questions, and the answers are already written in your help docs. Still, someone has to find the right doc and adapt it for every email, and replies slow down whenever the person who knows the docs best is away.

Small support teams, online shops and SaaS founders use it to start every reply from the right help article, so answers are faster and consistent.

What you get out of it

  • Every email starts half-answered

    A draft based on the right help doc is waiting in Gmail.

  • Consistent answers

    Replies follow what your documentation says, not what each person remembers.

  • Tricky ones flagged

    Emails the docs do not cover are posted to Slack so someone picks them up.

  • You still press send

    Drafts are reviewed by a person before anything reaches a customer.

How it works

What happens, step by step

  1. Every 5 minutes, ClickRuntime checks your support inbox for new emails it has not handled.

  2. Each email is matched against your help documents in Pinecone.

  3. AI writes a reply using only those documents, or flags that they do not cover the question.

  4. Covered emails get a draft reply in Gmail; the rest are posted to your Slack support channel.

Before it runs live

  • Connect Google Drive
  • Connect Pinecone

What you get

RunsEvery 5 minutes
Draft replies to support emails from your Drive help docstoday, 9:00Succeeded
Gmail · DraftsRe: Can I change my delivery day? Hi Sam, yes. Go to Account, then Deliveries, and pick a new day up to 48 hours before your next box ships.

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 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_email_support_replies_from_a_drive_knowledge_base.pyexample
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, credentials, http, notify, ai
DRAFTED_LABEL_ID = "Label_789"
HOST, NS = "https://docs-abc123.svc.aped-1234.pinecone.io", "company"  # your index host and namespace
def search(text, k=5):
    r = http.post(f"{HOST}/records/namespaces/{NS}/search", json={"query": {"inputs": {"text": text}, "top_k": k}}, headers={
        "Api-Key": credentials.secret("PINECONE_API_KEY"), "X-Pinecone-API-Version": "2025-04"}).json()
    return [h["fields"] for h in r["result"]["hits"]]

@on_trigger
def run(event):
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
    new = gmail.messages().list(userId="me", q="label:Support -label:Drafted newer_than:1d").execute().get("messages", [])
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    for m in new:
        msg = gmail.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
        h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        docs = "\n\n".join(f"[{d.get('file_name')}] {d['chunk_text']}" for d in search(f"{h.get('Subject')} {msg['snippet']}", 4))
        reply = ai.generate(f"Write a helpful support reply using only these help docs. If they don't cover it, reply exactly "
                            f"NO_ANSWER.\n{docs}\n\nCustomer email: {h.get('Subject')}\n{msg['snippet']}", max_output_tokens=400).text
        if "NO_ANSWER" in reply:
            notify.slack(f"Needs a person: {h.get('Subject')} from {h.get('From')}", channel="#support")
        else:
            gmail.drafts().create(userId="me", body={"message": {"threadId": msg["threadId"], "raw": base64.urlsafe_b64encode(
                f"To: {h.get('From')}\r\nSubject: Re: {h.get('Subject')}\r\n\r\n{reply}".encode()).decode()}}).execute()
        gmail.messages().modify(userId="me", id=m["id"], body={"addLabelIds": [DRAFTED_LABEL_ID]}).execute()

FAQ

Common questions

How does it know which emails are support?
It watches the inbox or label you choose, such as a support@ address or a Support label.
What if the docs don't cover the question?
No draft is written. The email is posted to your Slack support channel instead, with a note that the docs had no answer.
Does it learn from my edits?
Not automatically. When the same question keeps needing edits, update the help doc in Drive and future drafts will follow it.
What permissions does it need?
Pinecone read; Drive read; Gmail compose. 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 replies to support emails from your Drive help docs” from your assistant

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