Skip to content

On a schedule

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

Runs
On a schedule
Apps
Google Docs, Pinecone
AI
Yes, uses the built-in AI allowance
Access
Docs read; Pinecone key

Send this to your assistant

Create a ClickRuntime automation: keep my FAQ Google Doc indexed in Pinecone and re-index it daily. Every 10 minutes, for each new email in my inbox, find the relevant answers and save a draft reply in Gmail.

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 two-person team running an online homeware shop answers the same questions every day: delivery times, returns, care instructions, whether an item will be restocked. The answers are already written in an FAQ document, but each reply still means finding the right paragraph and rewording it for the customer.

Having a draft waiting in Gmail, built from the FAQ, turns most replies into a quick check and a click on Send. Small shops, service businesses and support teams without a help desk tool use it to answer faster while keeping every reply consistent with their policies.

What you get out of it

  • Replies start from your own answers

    Drafts are built from the FAQ document your team already maintains, not from general knowledge. Delivery times, return windows and prices match what you have written.

  • You still decide what is sent

    Nothing is sent automatically. Each reply is saved as a draft, so you can adjust tone or add details before it reaches the customer.

  • Faster first responses

    Customers get an answer in minutes rather than at the end of the day. Quick replies reduce follow-up emails and abandoned orders.

  • Update the FAQ, update the replies

    Change a policy in the Google Doc and the next day's drafts use the new wording. There is no separate set of saved replies to keep in sync.

How it works

What happens, step by step

  1. Once a day, ClickRuntime reads your FAQ Google Doc, splits it into short sections and stores them in your Pinecone index.

  2. Every 10 minutes, it checks your Gmail inbox for emails that have arrived since the last check.

  3. For each new email, it finds the FAQ sections that best match the question.

  4. AI writes a reply using only those sections, and it is saved as a draft in the same Gmail thread for you to review.

Before it runs live

  • Connect Google Docs
  • Connect Pinecone

What you get

RunsOn a schedule
Draft email replies from your FAQ Google Doctoday, 9:00Succeeded
Gmail · Draft replyHi, thanks for your order with Northwind Home. Standard delivery takes 3–5 working days, and you can return any unused item within 30 days.

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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.
email_auto_replies_grounded_in_a_docs_knowledge_base.pyexample
import base64
from datetime import date
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched

DOC_ID, INDEX = "your-doc-id", "https://faq-xxxx.svc.pinecone.io"

def pc(path, body):
    return http.post(INDEX + path, json=body, headers={"Api-Key": credentials.secret("PINECONE_API_KEY")}).json()

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    if state.get("indexed") != date.today().isoformat():
        doc = build("docs", "v1", credentials=creds, cache_discovery=False).documents().get(documentId=DOC_ID).execute()
        paras = [p for p in ("".join(r["textRun"]["content"] for r in c.get("paragraph", {}).get("elements", []) if "textRun" in r)
                 for c in doc["body"]["content"]) if p.strip()]
        pc("/records/namespaces/faq/upsert", [{"_id": f"p{i}", "text": p} for i, p in enumerate(paras)])
        state.set("indexed", date.today().isoformat())
    gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users()
    since = state.get("since")
    msgs = gmail.messages().list(userId="me", q=f"in:inbox after:{since}" if since else "in:inbox newer_than:10m").execute().get("messages", [])
    report_fetched(len(msgs))
    if not msgs:
        return {"summary": "Nothing new"}
    for m in msgs:
        full = gmail.messages().get(userId="me", id=m["id"], format="full").execute()
        hdr = {h["name"]: h["value"] for h in full["payload"]["headers"]}
        hits = pc("/records/namespaces/faq/search", {"query": {"inputs": {"text": full["snippet"]}, "top_k": 4}})
        ctx = "\n".join(h["fields"]["text"] for h in hits["result"]["hits"])
        reply = ai.generate(f"FAQ:\n{ctx}\n\nCustomer email:\n{full['snippet']}\n\nWrite a short reply using only the FAQ.", max_output_tokens=500).text
        msg = EmailMessage()
        msg["To"], msg["Subject"] = hdr.get("From"), "Re: " + hdr.get("Subject", "")
        msg.set_content(reply)
        gmail.drafts().create(userId="me", body={"message": {"threadId": full["threadId"], "raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}}).execute()
    state.set("since", int(gmail.messages().get(userId="me", id=msgs[0]["id"], format="minimal").execute()["internalDate"]) // 1000 + 1)
    return {"drafts": len(msgs)}

FAQ

Common questions

What if the FAQ does not cover the question?
The draft says so and asks the customer for any details needed, rather than guessing. Questions that come up often without an answer are a sign to add a new entry to the FAQ.
Which emails get a draft?
New emails in your inbox since the last check. You can limit it to a label such as Support, or skip messages from your own domain, newsletters and automatic notifications.
Why is the FAQ stored in Pinecone?
Pinecone holds the FAQ split into short sections so the ones matching each email can be found quickly. Only those sections are used for the draft, which keeps replies focused even when the FAQ is long.
What permissions does it need?
Docs read; Pinecone key. 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 runs (on a schedule). Checks that find nothing to do 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 email replies from your FAQ Google Doc” from your assistant

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