On a schedule
Keep a Supabase knowledge base in sync with your FAQ sheet
Each night, new or edited rows in your FAQ sheet are turned into search-ready entries in your Supabase documents table, so your bots always answer from the latest version.
- Runs
- On a schedule
- Apps
- Google Sheets, Supabase
- AI
- Not needed
- Access
- sheet read; Supabase write
Send this to your assistant
Create a ClickRuntime automation: every night, embed new or changed rows from my FAQ Google Sheet and upsert them into my Supabase documents table.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
The support team keeps the official answers in a Google Sheet because everyone can edit it. The chatbot, though, reads from Supabase, and someone has to remember to re-import the sheet after every change. Usually they don't, and the bot gives last quarter's answers.
Syncing only the rows that changed each night keeps the bot's knowledge in step with the sheet, while the team carries on editing where they're comfortable.
What you get out of it
Bots answer from the latest version
Edits in the sheet reach the knowledge base overnight.
Edit where the team already works
Support staff keep using the sheet; nobody touches the database.
Only changes are processed
Unchanged rows are skipped, which keeps the nightly run fast and cheap.
One source of truth
The sheet stays the official list of answers.
How it works
What happens, step by step
Every night, ClickRuntime reads the questions and answers from your FAQ sheet.
It compares each row with a fingerprint saved from the last run to find new or edited rows.
It turns each changed row into a search-ready entry using an embedding service.
It adds or updates those entries in your Supabase documents table.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Supabase
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
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Sheets and Supabase steps into one automation
Under the hood
The code that runs this automation
import hashlib
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, report_fetched
SHEET_ID = "your-spreadsheet-id"
SUPABASE = "https://your-project.supabase.co/rest/v1"
def sb(method, path, **kw):
key = credentials.secret("SUPABASE_KEY")
r = http.request(method, f"{SUPABASE}/{path}", **kw, headers={"apikey": key, "Authorization": f"Bearer {key}", "Prefer": "return=representation,resolution=merge-duplicates"})
return r.raise_for_status() or (r.json() if r.content else None)
@on_trigger
def run(event):
rows = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values().get(spreadsheetId=SHEET_ID, range="FAQ!A2:B").execute().get("values", [])
seen = state.get("hashes") or {}
changed = []
for i, r in enumerate(rows, start=2):
if len(r) == 2 and seen.get(str(i)) != (h := hashlib.sha256("\n".join(r).encode()).hexdigest()):
changed.append((i, r, h))
report_fetched(len(changed))
if not changed:
return {"summary": "Nothing new"}
texts = [f"Q: {q}\nA: {a}" for _, (q, a), _ in changed]
emb = http.post("https://api.openai.com/v1/embeddings", headers={"Authorization": "Bearer " + credentials.secret("OPENAI_API_KEY")},
json={"model": "text-embedding-3-small", "input": texts}).json()["data"]
sb("POST", "documents?on_conflict=id", json=[{"id": f"faq-{i}", "content": t, "embedding": e["embedding"]} for (i, _, _), t, e in zip(changed, texts, emb)])
seen.update({str(i): h for i, _, h in changed})
state.set("hashes", seen)
return {"synced": len(changed)}FAQ
Common questions
What does embedding mean here?
How are changes detected?
What happens to deleted rows?
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
List low-stock items from Supabase in a purchasing sheet
Each night, items in your Supabase inventory that are below their reorder level are written to your purchasing sheet, and you get an email to review and approve them.
See how it worksFind people asking for tools like yours and list them in a sheet
Every hour, posts from people looking for a tool like yours are scored, stored in Supabase and added to a leads sheet for your team.
See how it worksList at-risk clients from Supabase in a sheet every morning
Every morning, clients who haven't visited in 14 days are written to your At Risk sheet and you get an email summary.
See how it worksKeep exploring
Set up “Keep a Supabase knowledge base in sync with your FAQ sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.