Every 30 minutes
Triage your Gmail and Outlook inboxes with one digest
Both inboxes are sorted into the same categories, and you get one digest of the emails that need you.
- Runs
- Every 30 minutes
- Apps
- Gmail, Outlook
- AI
- Yes, uses the built-in AI allowance
- Access
- gmail.modify; Mail.ReadWrite
Send this to your assistant
Create a ClickRuntime automation: every 30 minutes, read new emails in my Gmail and my Outlook. Use AI to sort each into needs reply, FYI, newsletter or ignore, apply that as a Gmail label or Outlook category, and email me one digest of the ones that need a reply.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A consultant works for two clients, one on Google Workspace and one on Microsoft 365, and has their own business Gmail too. Switching between inboxes all day means emails that need a reply get buried in one while they are busy in the other.
Sorting both inboxes the same way and sending one digest of what needs a reply gives a single list to work from, wherever the email arrived.
What you get out of it
One list, two inboxes
The digest shows everything that needs a reply, from both mailboxes.
The same categories everywhere
Gmail labels and Outlook categories match, so filtering works the same way in both.
Newsletters out of the way
Bulk mail is labelled so it can be skimmed later.
Nothing moved or deleted
Emails stay in their inboxes; only a label or category is added.
How it works
What happens, step by step
Every 30 minutes, ClickRuntime collects new emails from your Gmail and your Outlook inbox.
AI sorts each one into needs reply, FYI, newsletter or ignore.
The category is added as a Gmail label or an Outlook category.
If any need a reply, you get one email listing them, with the mailbox each came from.
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 Outlook
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 Gmail and Outlook 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, report_fetched, http, credentials, ai, state, notify
api = lambda name, version: build(name, version, credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
def graph(method, path, **kw):
r = http.request(method, "https://graph.microsoft.com/v1.0" + path, headers={"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}, **kw)
return r.raise_for_status() or (r.json() if r.content else None)
LABELS = {"needs_reply": "Label_1", "fyi": "Label_2", "newsletter": "Label_3", "ignore": "Label_4"} # your Gmail label ids
@on_trigger
def run(event):
gmail, seen, since = api("gmail", "v1").users().messages(), set(state.get("seen") or []), state.get("since") or "2026-01-01T00:00:00Z"
items = [("gmail", m["id"], gmail.get(userId="me", id=m["id"], format="metadata").execute()["snippet"])
for m in gmail.list(userId="me", q="in:inbox newer_than:1d").execute().get("messages", []) if m["id"] not in seen]
out = graph("GET", "/me/mailFolders/inbox/messages", params={"$filter": f"receivedDateTime gt {since}", "$select": "id,subject,bodyPreview,receivedDateTime"})["value"]
items += [("outlook", m["id"], f"{m['subject']}: {m['bodyPreview']}") for m in out]
report_fetched(len(items))
if not items:
return {"summary": "Nothing new"}
labels = ai.generate("\n".join(f"{i}. {t[:300]}" for i, (_, _, t) in enumerate(items)), system="Label each line needs_reply, fyi, newsletter or ignore.",
json_schema={"type": "object", "properties": {"labels": {"type": "array", "items": {"enum": list(LABELS)}}}}, max_output_tokens=400).json["labels"]
todo = []
for (box, mid, text), label in zip(items, labels):
if box == "gmail":
gmail.modify(userId="me", id=mid, body={"addLabelIds": [LABELS[label]]}).execute()
seen.add(mid)
else:
graph("PATCH", f"/me/messages/{mid}", json={"categories": [label.replace("_", " ").title()]})
if label == "needs_reply":
todo.append(f"[{box}] {text[:120]}")
if todo:
notify.email_me(f"{len(todo)} emails need a reply", "\n".join(todo))
state.set("seen", sorted(seen)[-3000:])
state.set("since", max([since] + [m["receivedDateTime"] for m in out]))
return {"sorted": len(items), "needs_reply": len(todo)}FAQ
Common questions
How often does the digest arrive?
Can I change the categories?
Does it reply for me?
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
Summarise PDF attachments arriving in Gmail or Outlook
When a PDF arrives in either your Gmail or your Outlook, you get an email with a short summary of what it says.
See how it worksSend thank-you emails from the right mailbox for each brand
New buyers get a thank-you from your Gmail or your Outlook, depending on which brand they bought from.
See how it worksCheck whether your emails land in the inbox at Gmail and Outlook
Every week a test email is sent each way between your Gmail and Outlook, and you learn whether it reached the inbox or spam and whether SPF, DKIM and DMARC passed.
See how it worksKeep exploring
Set up “Triage your Gmail and Outlook inboxes with one digest” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.