Skip to content

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.

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

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

  1. Someone sends a request to your WhatsApp number.

  2. AI picks a category and urgency for the message.

  3. The request is saved as a new row in your Supabase table.

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

RunsThe moment it happens
Log WhatsApp requests in Supabase by category and urgencyjust nowSucceeded
WhatsApp · RequestsThanks, we've logged your request. Reference: #4821

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.
classify_incoming_whatsapp_requests_and_log_them_in_supabase.pyexample
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?
Phone, message, category, urgency and created_at. The reference is the row's ID.
Can I change the categories?
Yes. List the ones you use, such as HR, Service and Support.
Can urgent ones go to Slack instead of email?
Yes, if you'd rather the team sees them in a channel.
What permissions does it need?
WhatsApp messaging; Supabase read+write. 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 “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.