Every 5 minutes
Get your important emails in Slack
New mail is sorted and labelled for you, and the urgent ones are posted to Slack with a one-line summary.
- Runs
- Every 5 minutes
- Apps
- Gmail, Slack
- AI
- Yes, uses the built-in AI allowance
- Access
- Gmail gmail.modify; Slack chat:write
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, sort my new emails into urgent, client, invoice or newsletter, add a matching Gmail label, and post the urgent ones to me in Slack with a one-line summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A busy founder or account manager gets a hundred emails a day, and perhaps eight of them matter: a customer reporting an outage, a contract question from legal, a payment problem. The rest are newsletters, receipts and notifications. Reading everything to find the eight takes an hour, and the one urgent email still gets missed because it arrived in a stack of promotions at 4:55pm.
Every 5 minutes new Gmail messages come in, and the built-in AI in ClickRuntime assigns a category and writes a one-line summary. A matching label is applied in Gmail, and only the messages judged important are posted to Slack with the sender, the summary and a link, so the channel shows what deserves attention now.
It works well for people who live in Slack but still receive mission-critical mail in Gmail, such as founders and customer-facing managers. It is also handy for people who share an inbox with an assistant.
What you get out of it
Urgent mail reaches you in minutes
An angry customer or a failing payment surfaces in Slack as soon as it lands, so you can answer before the problem gets worse or the customer starts looking at competitors.
Your inbox sorts itself
Category labels in Gmail mean you can open Invoices or Customers and see only what belongs there, which makes later searching faster and weekly cleanups almost trivial. Later searches and clean-ups become far quicker as a result.
One-line summaries save reading time
Seeing the gist in the Slack message lets you decide in five seconds whether to deal with an email now or later, without opening it and losing your train of thought.
Less low-value checking of email
When you trust that important messages will appear in Slack, you stop refreshing the inbox every few minutes, which gives back focus time across the whole day. Fewer inbox refreshes mean longer stretches of deep, uninterrupted work.
No AI account to set up
Classification and summaries use ClickRuntime's built-in AI, so there is nothing to purchase or configure on the AI side before the sorting begins. Getting started takes a few minutes of conversation with your assistant.
How it works
What happens, step by step
Every 5 minutes, ClickRuntime checks your Gmail inbox for new messages, skipping any it has already sorted.
AI reads each one, sorts it as urgent, client, invoice or newsletter, and writes a one-line summary.
The matching label is added to the email in Gmail.
Urgent emails are also posted to your #me Slack channel with the sender and summary.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
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 Google Sheets
- Combine it with other Gmail and Slack steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, state, ai, notify, report_fetched
LABELS = ["urgent", "client", "invoice", "newsletter"]
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
seen = set(state.get("seen") or [])
msgs = gmail.users().messages().list(userId="me", q="in:inbox newer_than:1d", maxResults=25).execute().get("messages", [])
new = [m for m in msgs if m["id"] not in seen]
report_fetched(len(new))
if not new:
return {"new": 0}
label_ids = {l["name"]: l["id"] for l in gmail.users().labels().list(userId="me").execute()["labels"]}
for m in new:
msg = gmail.users().messages().get(userId="me", id=m["id"], format="metadata",
metadataHeaders=["From", "Subject"]).execute()
h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
r = ai.generate(f"From: {h.get('From')}\nSubject: {h.get('Subject')}\n{msg['snippet']}", max_output_tokens=60,
json_schema={"type": "object", "properties": {"category": {"enum": LABELS}, "summary": {"type": "string"}}}).json
if r["category"] in label_ids:
gmail.users().messages().modify(userId="me", id=m["id"], body={"addLabelIds": [label_ids[r["category"]]]}).execute()
if r["category"] == "urgent":
notify.slack(f"🚨 {h.get('From')}: {r['summary']}", channel="#me")
state.set("seen", [m["id"] for m in msgs])
return {"triaged": len(new)}FAQ
Common questions
How does it decide which emails are important?
Does it read every email in my Gmail?
Will it archive or delete emails?
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
Draft answers to RFP questionnaires
When an RFP arrives by email, answers are drafted from your company details and saved as a Gmail reply for you to check.
See how it worksGet a quick summary of every CV you receive
When a CV arrives by email, your hiring channel gets a short profile of the candidate.
See how it worksSend support emails to your team in Slack
Every new support email is summarised with a priority and posted to your support channel.
See how it worksKeep exploring
Set up “Get your important emails in Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.