Skip to content

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.

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

  1. A customer messages your WhatsApp number.

  2. It searches your Supabase knowledge base for the most relevant documents.

  3. AI writes a short answer from those documents only, or says it doesn't know.

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

RunsThe moment it happens
Answer WhatsApp questions from your Supabase knowledge basejust nowSucceeded
WhatsApp · CustomerThe Northwind X2 router supports Wi-Fi 6 and has four gigabit ports. Setup takes about 10 minutes with the app.

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 Supabase and WhatsApp Business 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.
whatsapp_assistant_that_answers_from_your_supabase_knowledge_base.pyexample
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?
No. It works with a Supabase function that returns matching documents, which can use full-text search or pgvector.
What if the answer isn't in the documents?
The customer is told the team will follow up, and the question is emailed to you.
Which documents can it see?
Only what your search function returns. Keep internal notes in a separate table.
What permissions does it need?
WhatsApp whatsapp_business_messaging; Supabase read. 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 “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.