Skip to content

Every 10 minutes

Sort your Outlook inbox with AI and log it to a sheet

New emails get an Outlook category and a one-line summary in a sheet, and simple questions get a reply draft waiting for you.

Runs
Every 10 minutes
Apps
Google Sheets, Outlook
AI
Yes, uses the built-in AI allowance
Access
Mail.ReadWrite; sheet edit

Send this to your assistant

Create a ClickRuntime automation: every 10 minutes, read new emails in my Outlook inbox. Use AI to give each a category (client, invoice, sales, newsletter, other) and a one-line summary, apply the category in Outlook, log it to my Inbox Log sheet, and create a reply draft for simple client questions.

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 office manager handles a shared Outlook inbox with orders, invoices, client questions and a steady stream of newsletters. Sorting it takes the first hour of every day, and there is no record of what came in or how quickly it was handled.

Categorising each email as it arrives, with a summary in a sheet and a draft for the easy ones, turns the morning sort into a quick review.

What you get out of it

  • An inbox that sorts itself

    Each email arrives with its Outlook category, so you can filter straight to what matters.

  • A log of what came in

    The sheet shows every email with its category and summary, which helps when someone asks what happened to their message.

  • Drafts for the easy ones

    Simple questions get a reply draft waiting in Outlook for you to check and send.

  • Nothing sent without you

    Drafts stay in your Drafts folder until you send them.

How it works

What happens, step by step

  1. Every 10 minutes, ClickRuntime checks your Outlook inbox for emails that arrived since its last check.

  2. AI reads each one and picks a category, writes a one-line summary and decides whether it is a simple client question.

  3. The category is applied in Outlook and a row with the sender, subject, category and summary is added to your Inbox Log sheet.

  4. For simple client questions, a reply draft is created in Outlook for you to review.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Outlook

What you get

RunsEvery 10 minutes
Sort your Outlook inbox with AI and log it to a sheettoday, 9:00Succeeded
Google Sheets · Inbox Log09:14 | accounts@northwind.example | Invoice INV-2207 | invoice | October invoice for £1,240, due 18 Nov

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 Outlook 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_sort_my_outlook_inbox_and_log_it_to_a_sheet.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, http, credentials, ai, state

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)

SHEET_ID = "your-spreadsheet-id"
SCHEMA = {"type": "object", "properties": {"category": {"enum": ["client", "invoice", "sales", "newsletter", "other"]},
          "summary": {"type": "string"}, "simple": {"type": "boolean"}, "reply": {"type": "string"}}}

@on_trigger
def run(event):
    since = state.get("since") or "2026-01-01T00:00:00Z"
    msgs = graph("GET", "/me/mailFolders/inbox/messages", params={"$filter": f"receivedDateTime gt {since}", "$orderby": "receivedDateTime",
                 "$select": "id,subject,from,bodyPreview,receivedDateTime", "$top": 50})["value"]
    report_fetched(len(msgs))
    if not msgs:
        return {"summary": "No new emails"}
    rows = []
    for m in msgs:
        sender = m["from"]["emailAddress"]["address"]
        res = ai.generate(f"From: {sender}\nSubject: {m['subject']}\n{m['bodyPreview']}", system="Categorise this email, summarise it in one line, "
                          "and if it is a simple client question write a short reply.", json_schema=SCHEMA, max_output_tokens=300).json
        graph("PATCH", f"/me/messages/{m['id']}", json={"categories": [res["category"].title()]})
        if res.get("simple") and res.get("reply"):
            graph("POST", f"/me/messages/{m['id']}/createReply", json={"comment": res["reply"]})
        rows.append([m["receivedDateTime"], sender, m["subject"], res["category"], res["summary"]])
    api("sheets", "v4").spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Inbox Log!A:E", valueInputOption="RAW", body={"values": rows}).execute()
    state.set("since", msgs[-1]["receivedDateTime"])
    return {"sorted": len(rows)}

FAQ

Common questions

Will it move emails out of my inbox?
No. It adds a coloured Outlook category and leaves the email where it is.
Which emails get a draft?
Only those the AI judges to be simple client questions. You can describe what counts as simple in the prompt.
Can I change the categories?
Yes. List your own categories in the prompt; matching categories are created in Outlook if they don't exist.
What permissions does it need?
Mail.ReadWrite; 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 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 “Sort your Outlook inbox with AI and log it to a sheet” from your assistant

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