Skip to content

Every 5 minutes

Classify incoming email by urgency and log it in Airtable

Every new email is tagged with a category and urgency and logged in Airtable, and urgent ones are posted to you in Slack.

Runs
Every 5 minutes
Apps
Airtable, Gmail
AI
Yes, uses the built-in AI allowance
Access
Gmail gmail.readonly; Airtable write

Send this to your assistant

Create a ClickRuntime automation: classify every new email by urgency and category, log it to my Airtable Inbox table, and message me in Slack if it's urgent.

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

An operations lead at a logistics firm shares an inbox with two colleagues. Customer complaints, carrier updates and invoices all mix together, and when a manager asks how many complaints came in last month, nobody can say.

Classifying every email as it arrives and keeping a log in Airtable gives you both a quick alert for urgent messages and a record you can count, filter and report on.

What you get out of it

  • Urgent email is never buried

    Messages marked urgent are posted to Slack within minutes, wherever you are working.

  • A searchable log of every email

    Each email becomes an Airtable record with sender, subject, category and urgency, ready to filter and report on.

  • Answers to 'how many' questions

    Counting complaints, supplier emails or refund requests per week is a simple Airtable view.

  • Shared inboxes get clearer ownership

    Categories make it easy to assign types of email to the right person.

How it works

What happens, step by step

  1. Every 5 minutes ClickRuntime checks your Gmail for new emails.

  2. It skips emails it has already logged.

  3. AI reads each email and assigns a category, an urgency level and a one-line summary.

  4. Each email is added to your Airtable table, and urgent ones are also posted in your Slack channel.

Before it runs live

  • Connect Airtable
  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail

What you get

RunsEvery 5 minutes
Classify incoming email by urgency and log it in Airtabletoday, 9:00Succeeded
Slack · #opsUrgent email from claims@northwind.example: pallet damaged in transit, customer wants a call before 3pm.

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 Airtable and Gmail 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.
ai_email_triage_with_alerts_logged_in_airtable.pyexample
from clickruntime import on_trigger, credentials, http, state, ai, notify, report_fetched

G, AT = "https://gmail.googleapis.com/gmail/v1/users/me", "https://api.airtable.com/v0/appXXXXXXXXXXXXXX/Inbox"
SCHEMA = {"type": "object", "properties": {"category": {"type": "string", "enum": ["complaint", "carrier", "invoice", "other"]},
          "urgency": {"type": "string", "enum": ["low", "normal", "urgent"]}, "summary": {"type": "string"}}, "required": ["category", "urgency", "summary"]}

@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
    seen = set(state.get("seen") or [])
    msgs = [m for m in http.get(f"{G}/messages", headers=h, params={"q": "in:inbox newer_than:1d"}).json().get("messages", []) if m["id"] not in seen]
    report_fetched(len(msgs))
    if not msgs:
        return {"new": 0}
    at = {"Authorization": f"Bearer {credentials.secret('AIRTABLE_API_KEY')}"}
    for m in msgs:
        msg = http.get(f"{G}/messages/{m['id']}", headers=h, params={"format": "metadata", "metadataHeaders": ["From", "Subject"]}).json()
        hdr = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        r = ai.generate(f"From: {hdr.get('From')}\nSubject: {hdr.get('Subject')}\n{msg['snippet']}", json_schema=SCHEMA, max_output_tokens=80).json
        http.post(AT, headers=at, json={"fields": {"From": hdr.get("From"), "Subject": hdr.get("Subject"), "Category": r["category"],
                  "Urgency": r["urgency"], "Summary": r["summary"], "Link": f"https://mail.google.com/mail/#all/{m['id']}"}})
        if r["urgency"] == "urgent":
            notify.slack(f"Urgent email from {hdr.get('From')}: {r['summary']}", channel="#ops")
        seen.add(m["id"])
    state.set("seen", list(seen)[-2000:])
    return {"logged": len(msgs)}

FAQ

Common questions

Does it store the whole email in Airtable?
No. It stores the sender, subject, a short summary, category and urgency, with a link back to the email in Gmail.
Can I choose the categories?
Yes. Give it your own list, such as complaint, carrier, invoice and other, and it will only use those.
Where do urgent alerts go?
To the Slack channel you choose, such as #ops, with the sender and a one-line summary.
What permissions does it need?
Gmail gmail.readonly; Airtable 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 each time it checks. Checks that find nothing new and stop right away aren't counted.
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 “Classify incoming email by urgency and log it in Airtable” from your assistant

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