The moment it happens
Take 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.
- 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 a customer sends an order on WhatsApp, pick out the items and quantities, price them from our menu table in Supabase, save the order, and reply with a summary and total.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A bakery, caterer or wholesaler takes orders on WhatsApp because customers like it, but someone has to read each message, look up prices, add it up and type it into the order system. Mistakes creep in during busy periods.
Reading each order message, pricing it from your own menu table and saving it straight into Supabase removes the retyping, and the instant summary lets the customer catch any misunderstanding before it's made.
What you get out of it
No retyping orders
Orders go straight into your database from the message.
Correct prices
Prices come from your menu table, so totals are always current.
Customers confirm what you understood
The reply lists the items and total, so mistakes are caught early.
Orders any time
Customers can order at midnight and it's ready for you in the morning.
How it works
What happens, step by step
A customer sends an order to your WhatsApp number.
AI picks out each item and quantity from the message.
Prices are looked up in your Supabase menu table and the total is worked out.
The order is saved in Supabase and the customer gets a summary with the total.
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
SCHEMA = {"type": "object", "properties": {"items": {"type": "array", "items": {"type": "object",
"properties": {"name": {"type": "string"}, "qty": {"type": "integer"}}}}}, "required": ["items"]}
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):
menu = {m["name"].lower(): m["price"] for m in http.get(f"{SUPABASE_URL}/rest/v1/menu", headers=sb(), params={"select": "name,price"}).json()}
for phone, text in incoming(event):
items = ai.generate(text[:1500], system=f"Extract ordered items, matching these names where possible: {', '.join(menu)}",
json_schema=SCHEMA, max_output_tokens=300).json["items"]
lines, total, missing = [], 0, []
for i in items:
price = menu.get(i["name"].lower())
if price is None:
missing.append(i["name"]); continue
total += price * i["qty"]; lines.append(f"{i['qty']} x {i['name']} = {price * i['qty']:.2f}")
http.post(f"{SUPABASE_URL}/rest/v1/orders", headers=sb(), json={"phone": phone, "items": items, "total": total, "message": text})
note = f"\nNot on our menu: {', '.join(missing)}" if missing else ""
wa(phone, "Thanks! Your order:\n" + "\n".join(lines) + f"\nTotal: {total:.2f}{note}")
return {"ok": True}FAQ
Common questions
What if an item isn't on the menu?
Can customers change an order?
Does it take payment?
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 worksLog 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 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 “Take WhatsApp orders into Supabase” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.