Every 15 minutes
Log new emails in a sheet and turn action items into tasks
Every new email is sorted and logged in your sheet, and the ones that need you become Google Tasks.
- Runs
- Every 15 minutes
- Apps
- Google Sheets, Google Tasks
- AI
- Yes, uses the built-in AI allowance
- Access
- Sheets write; tasks
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, sort my new emails into action needed, waiting, FYI or newsletter, log each in my Email log sheet and create a Google Task for anything I need to act on.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
In a busy inbox, the emails that ask you to do something look much like the ones that only keep you informed. Requests get read, mentally noted, and then buried under the next twenty messages.
Office managers, assistants and small business owners use it to keep a simple record of what came in and to make sure every request turns into a task they can tick off.
What you get out of it
Requests become tasks you can see
An email asking for a quote or a signature becomes a task in Google Tasks, next to the rest of your to-do list.
A searchable log of your inbox
The sheet shows sender, subject, category and date for every message, which helps when you need to report on volume or find a thread from last month.
FYI mail stays out of your task list
Newsletters and updates are logged but do not create tasks, so your list stays about real work.
Your inbox is left as it is
Emails are not moved or deleted. The sorting happens in the sheet and the task list.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your Gmail inbox for messages it has not seen yet.
AI reads the sender, subject and opening lines and picks a category.
Each email is added as a row in your log sheet with its category.
Emails that need action also become a Google Task, with a link back to the message.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Google Tasks
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 Google Sheets and Google Tasks 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, credentials, state, ai
SHEET_ID = "your-spreadsheet-id"
@on_trigger
def run(event):
creds = Credentials(credentials.connection("google", "work"))
gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users().messages()
done = set(state.get("done") or [])
new = [m for m in gmail.list(userId="me", q="in:inbox newer_than:1d", maxResults=50).execute().get("messages", [])
if m["id"] not in done]
report_fetched(len(new))
if not new:
return {"new": 0}
rows = []
for m in new:
msg = gmail.get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject", "Date"]).execute()
h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
cat = ai.generate("Pick one of Action needed, Waiting, FYI, Newsletter for this email. Reply with the category only."
f"\nFrom: {h.get('From')}\nSubject: {h.get('Subject')}\n{msg['snippet']}", max_output_tokens=10).text.strip()
rows.append([h.get("Date", ""), h.get("From", ""), h.get("Subject", ""), cat])
if cat == "Action needed":
build("tasks", "v1", credentials=creds, cache_discovery=False).tasks().insert(tasklist="@default", body={
"title": h.get("Subject") or "Email to action", "notes": f"https://mail.google.com/mail/u/0/#all/{m['id']}"}).execute()
build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(
spreadsheetId=SHEET_ID, range="Email log!A:D", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
state.set("done", sorted(done | {m["id"] for m in new})[-1000:])
return {"logged": len(rows)}FAQ
Common questions
Does it read the whole email?
Can I use my own categories?
Does the task link back to the email?
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
Create a task with an explanation when a sheet row is marked failed
When a row in your sheet changes to Failed, a Google Task appears with a likely cause, and you get an email.
See how it worksTrack a web page for new items and get a task to review each
New items on a page you follow are summarised into your sheet, and each one gets a Google Task so you review it.
See how it worksTurn the top items in your task sheet into today's Google Tasks
Each morning the most important open items from your sheet are added to Google Tasks, and the rows are marked as added.
See how it worksKeep exploring
Set up “Log new emails in a sheet and turn action items into tasks” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.