Skip to content

The moment it happens

Sort incoming requests by urgency into Supabase and a team sheet

Each customer request is classified by urgency with AI, saved to Supabase and added to the sheet your team works from, with urgent ones posted to Slack.

Runs
The moment it happens
Apps
Google Sheets, Supabase
AI
Yes, uses the built-in AI allowance
Access
Supabase write; sheet edit

Send this to your assistant

Create a ClickRuntime automation: when a request is posted to this link, classify its urgency and type with AI, insert it into my Supabase requests table, add a row to my Dispatch sheet, and post urgent ones to #dispatch.

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 maintenance company receives requests from a website form and a messaging line. A burst pipe and a dripping tap arrive in the same queue, and the dispatcher reads every message to decide what to do first.

Classifying each request as it arrives and adding it to the dispatch sheet with its urgency means urgent jobs are seen first, and the full record lands in Supabase for reporting.

What you get out of it

  • Urgent jobs first

    Emergencies are flagged in Slack the moment they come in.

  • A sheet the team already uses

    Dispatchers work from a sorted list without learning a new tool.

  • Complete records

    Every request is stored in Supabase for reporting and billing.

  • Consistent triage

    Every message is judged by the same rules, at any hour.

How it works

What happens, step by step

  1. A customer request arrives at your automation's link.

  2. AI reads it and decides the urgency and type of job.

  3. The request is saved to your Supabase requests table.

  4. A row is added to your Dispatch sheet with the urgency.

  5. Urgent requests are also posted to #dispatch in Slack.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Supabase
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Sort incoming requests by urgency into Supabase and a team sheetjust nowSucceeded
Slack · #dispatch🚨 Urgent plumbing: Acme Cafe, 12 High St – water coming through the ceiling above the kitchen

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 Google Sheets and Supabase 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.
log_incoming_requests_to_supabase_and_a_team_sheet.pyexample
from datetime import datetime, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, notify, ai

SHEET_ID = "your-spreadsheet-id"
SUPABASE = "https://your-project.supabase.co/rest/v1"

def sb(method, path, **kw):
    key = credentials.secret("SUPABASE_KEY")
    r = http.request(method, f"{SUPABASE}/{path}", **kw, headers={"apikey": key, "Authorization": f"Bearer {key}", "Prefer": "return=representation,resolution=merge-duplicates"})
    return r.raise_for_status() or (r.json() if r.content else None)

SCHEMA = {"type": "object", "properties": {"urgency": {"enum": ["urgent", "soon", "routine", "review"]}, "type": {"type": "string"}}}

@on_event
def handle(event):
    req = event.json or {}
    c = ai.generate(f"Classify this maintenance request. Urgent = safety risk or active damage.\n{req.get('message', '')[:2000]}",
                    json_schema=SCHEMA, max_output_tokens=40).json
    row = sb("POST", "requests", json={"name": req.get("name"), "phone": req.get("phone"), "address": req.get("address"),
                                         "message": req.get("message"), **c, "event_id": event.event_id})[0]
    build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Dispatch!A:F", valueInputOption="RAW", body={"values": [[
        datetime.now(timezone.utc).isoformat(timespec="minutes"), c["urgency"], c["type"], req.get("name"), req.get("address"), row["id"]]]}).execute()
    if c["urgency"] == "urgent":
        notify.slack(f":rotating_light: Urgent {c['type']}: {req.get('name')}, {req.get('address')} – {req.get('message', '')[:200]}", channel="#dispatch")
    return {"id": row["id"], **c}

FAQ

Common questions

What urgency levels are used?
Urgent, soon and routine by default. You can describe your own levels and examples.
What if AI isn't sure?
Requests it can't classify confidently are marked for review rather than routine.
Where can requests come from?
Any form, inbox or messaging tool that can send the request to your automation's link.
What permissions does it need?
Supabase write; sheet edit. 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 “Sort incoming requests by urgency into Supabase and a team sheet” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.