Every 5 minutes
Sort new Outlook mail into categories
Each new email is tagged Action, Info, Newsletter or Junk, and newsletters are moved out of your way.
- Runs
- Every 5 minutes
- Apps
- Outlook
- AI
- Yes, uses the built-in AI allowance
- Access
- Mail.ReadWrite
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, sort my new Outlook emails into the categories Action, Info, Newsletter or Junk, and move anything marked Newsletter to my Reading folder.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
An operations manager receives about 150 emails a day in Outlook: supplier quotes, customer questions, invoices, internal approvals, newsletters and the occasional urgent escalation. Everything lands in one inbox, so the one message that needs an answer in the hour is buried under routine items, and sorting by hand with rules only works for senders you already know. Unread counts climb, and important mail gets answered late.
Every five minutes, new messages in the inbox are picked up, and ClickRuntime's built-in AI reads the sender, subject and body to decide what each one is about, such as Invoice, Customer question, Approval needed or Newsletter. The matching Outlook category is applied to the message, or it is moved into a folder you named, within minutes of arriving.
It is especially useful where the same inbox handles several kinds of work and rules based on sender cannot keep up.
What you get out of it
Urgent mail stands out
When an escalation arrives with a red category, you notice it among the routine items. That shortens the delay between a customer's problem and your response, which protects the relationship.
Rules for unknown senders become unnecessary
A rule needs a known sender or phrase, but a new supplier or a customer from another company has none. Reading what the message is about sorts it correctly on the first message.
Triage by category takes seconds
Filtering the inbox by Invoice or Approval needed means you can work through one type of task at a time. Doing similar tasks in one sitting is faster than switching constantly.
Fewer things fall through
Invoices and approvals that used to hide between newsletters get labeled so they are visible in the category view. That reduces late payments and forgotten sign-offs. Anything labeled Invoice can be paid on time, and anything labeled Approval needed is hard to forget.
A calmer inbox without manual sorting
Spending twenty minutes a day dragging messages into folders is time you do not get back. Letting each new message arrive already labeled returns that time to real work. That time adds up to more than an hour each week, which is better spent on real replies.
How it works
What happens, step by step
Every 5 minutes, ClickRuntime checks your Outlook inbox for new emails since the last check.
AI reads the sender, subject and opening lines of each one and labels it Action, Info, Newsletter or Junk.
Each email gets that category in Outlook, and newsletters are moved out of your inbox.
Before it runs live
- 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 Outlook steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched
GRAPH = "https://graph.microsoft.com/v1.0"
NEWSLETTER_FOLDER_ID = "AAMkAD...newsletters"
LABELS = ["Action", "Info", "Newsletter", "Junk"]
@on_trigger
def run(event):
h = {"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"}
since = state.get("since") or "2026-01-01T00:00:00Z"
msgs = http.get(f"{GRAPH}/me/mailFolders/inbox/messages", headers=h, params={
"$filter": f"receivedDateTime gt {since}", "$orderby": "receivedDateTime asc",
"$select": "id,subject,from,bodyPreview,receivedDateTime", "$top": 25}).json()["value"]
report_fetched(len(msgs))
if not msgs:
return {"summary": "Nothing new"}
numbered = "\n".join(f"{i}. From {m['from']['emailAddress']['address']}: {m['subject']} – {m['bodyPreview'][:200]}" for i, m in enumerate(msgs))
labels = ai.generate(numbered, system=f"Label each numbered email as one of {LABELS}.", max_output_tokens=20 * len(msgs),
json_schema={"type": "object", "properties": {"labels": {"type": "array", "items": {"type": "string", "enum": LABELS}}}}).json["labels"]
for m, label in zip(msgs, labels):
http.patch(f"{GRAPH}/me/messages/{m['id']}", headers=h, json={"categories": [label]})
if label == "Newsletter":
http.post(f"{GRAPH}/me/messages/{m['id']}/move", headers=h, json={"destinationId": NEWSLETTER_FOLDER_ID})
state.set("since", msgs[-1]["receivedDateTime"])
return {"labelled": len(msgs)}FAQ
Common questions
Which categories does it use?
What if the AI picks the wrong category?
Does it read my whole mailbox?
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
Pull key fields from emailed invoices and POs
Purchase orders and invoices that arrive in Outlook are read for you, and the supplier, amounts and due date reach you in one summary.
See how it worksHave reply drafts ready for customer questions
Routine customer questions get an AI-written reply saved in Drafts, ready for you to check and send.
See how it worksFile Outlook attachments in OneDrive
Attachments you receive are saved to OneDrive in a folder per sender.
See how it worksKeep exploring
Set up “Sort new Outlook mail into categories” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.