The moment it happens
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.
- Runs
- The moment it happens
- Apps
- Supabase, WhatsApp Business
- AI
- Yes, uses the built-in AI allowance
- Access
- WhatsApp messaging; Supabase read+write
Send this to your assistant
Create a ClickRuntime automation: when someone messages our WhatsApp number with a request, classify it by category and urgency, insert it into our requests table in Supabase, reply with a reference, and email me urgent ones.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Companies that build their own tools on Supabase often take requests on WhatsApp: staff HR questions, service bookings, support issues. Without a record, requests are handled from memory and urgent ones can wait behind trivial ones.
Saving every request in your own database with a category and urgency gives your internal tools a proper queue to work from, and the reference number gives the sender confidence it was received.
What you get out of it
Requests in your own database
Your existing apps and dashboards can work with them straight away.
Urgent ones flagged
Urgent requests are emailed to you as well as logged.
A reference for every request
Senders get a reference number, which makes follow-ups easier.
Consistent sorting
Every request is categorised the same way.
How it works
What happens, step by step
Someone sends a request to your WhatsApp number.
AI picks a category and urgency for the message.
The request is saved as a new row in your Supabase table.
The sender gets a reply with their reference number, and urgent requests 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
SCHEMA = {"type": "object", "properties": {"category": {"type": "string", "enum": ["HR", "Service", "Support"]},
"urgency": {"type": "string", "enum": ["urgent", "normal"]}}, "required": ["category", "urgency"]}
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):
r = ai.generate(text[:1500], system="Classify this request.", json_schema=SCHEMA, max_output_tokens=30).json
row = http.post(f"{SUPABASE_URL}/rest/v1/requests", headers={**sb(), "Prefer": "return=representation"},
json={"phone": phone, "message": text, **r}).json()[0]
wa(phone, f"Thanks, we've logged your request. Reference: #{row['id']}")
if r["urgency"] == "urgent":
notify.email_me(f"Urgent {r['category']} request #{row['id']}", f"From +{phone}:\n{text}")
return {"ok": True}FAQ
Common questions
What columns does the table need?
Can I change the categories?
Can urgent ones go to Slack instead of email?
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
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.
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 “Log WhatsApp requests in Supabase by category and urgency” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.