The moment it happens
Answer WhatsApp questions from your Supabase knowledge base
Customers who message you on WhatsApp get an answer drawn from the docs or catalogue in your Supabase database, and you're emailed the questions it couldn't answer.
- Runs
- The moment it happens
- Apps
- Supabase, WhatsApp Business
- AI
- Yes, uses the built-in AI allowance
- Access
- WhatsApp whatsapp_business_messaging; Supabase read
Send this to your assistant
Create a ClickRuntime automation: when a customer messages our WhatsApp number, search our Supabase documents for the answer, reply on WhatsApp, and email me any question you couldn't answer.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A company with a detailed product catalogue or help centre already has the answers to most customer questions, stored in its own database. Yet customers on WhatsApp still wait for a person to look them up.
Searching your Supabase knowledge base for each question and replying in seconds turns that existing content into instant answers, while the questions it couldn't answer show you exactly what to add next.
What you get out of it
Answers from your own content
Replies are based on your documents, not general knowledge.
Instant, at any hour
Customers get answers in seconds on the app they already use.
Gaps become obvious
Unanswered questions are emailed to you, showing what's missing from your docs.
Uses what you have
Your existing Supabase tables and search work as they are.
How it works
What happens, step by step
A customer messages your WhatsApp number.
It searches your Supabase knowledge base for the most relevant documents.
AI writes a short answer from those documents only, or says it doesn't know.
The answer is sent on WhatsApp, and questions it couldn't answer are emailed to you.
Before it runs live
- Connect Supabase
- Connect WhatsApp Business
- 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 Supabase and WhatsApp Business steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, http, ai, notify
SUPABASE_URL = "https://your-project.supabase.co"
sb = lambda: {"apikey": credentials.secret("SUPABASE_SECRET_KEY"), "Authorization": f"Bearer {credentials.secret('SUPABASE_SECRET_KEY')}"}
WA = "https://graph.facebook.com/v20.0/your-phone-number-id/messages"
def wa(to, text):
http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"},
json={"messaging_product": "whatsapp", "to": to, "type": "text", "text": {"body": text}}).raise_for_status()
def incoming(event):
changes = [c for e in (event.json or {}).get("entry", []) for c in e.get("changes", [])]
return [(m["from"], m["text"]["body"]) for c in changes for m in c["value"].get("messages", []) if m.get("type") == "text"]
@on_event
def handle(event):
for phone, text in incoming(event):
docs = http.post(f"{SUPABASE_URL}/rest/v1/rpc/match_documents", headers=sb(), json={"query_text": text, "match_count": 4}).json()
context = "\n\n".join(d["content"][:1500] for d in docs)
answer = ai.generate(f"Question: {text}\n\nDocuments:\n{context}", max_output_tokens=250,
system="Answer briefly using only the documents. If they don't contain the answer, reply exactly UNKNOWN.").text.strip()
if answer == "UNKNOWN":
wa(phone, "Good question. I've passed it to the team and someone will reply shortly.")
notify.email_me("Unanswered WhatsApp question", f"From +{phone}:\n{text}")
else:
wa(phone, answer)
return {"ok": True}FAQ
Common questions
Does it need vector search?
What if the answer isn't in the documents?
Which documents can it see?
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
Log WhatsApp requests in Supabase by category and urgency
Every WhatsApp request is sorted by type and urgency, saved in your Supabase table and acknowledged, with urgent ones emailed to you.
See how it worksTake WhatsApp orders into Supabase
Customers order or ask for a quote on WhatsApp, the items are priced from your Supabase menu, the order is saved and they get a summary back.
See how it worksReply to new leads on WhatsApp in a matching tone
New leads saved in Supabase get a WhatsApp reply chosen to match the tone of their message, and the lead is marked as contacted.
See how it worksKeep exploring
Set up “Answer WhatsApp questions from your Supabase knowledge base” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.