Every 15 minutes
Turn emails that need action into Todoist tasks
Emails that ask you to do something become Todoist tasks with a clear title, due date and next step.
- Runs
- Every 15 minutes
- Apps
- Gmail, Todoist
- AI
- Yes, uses the built-in AI allowance
- Access
- gmail.modify; Todoist write
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, read my new inbox emails. If one needs me to do something, create a Todoist task with a short title, the due date if mentioned, and a link to the email, then label the email Tasked.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
For most people, the inbox is a to-do list in disguise. Requests sit among newsletters and notifications, and the one that needed an answer by Friday gets buried under Thursday's mail.
Pulling the actionable emails out into Todoist, with a clear title and due date, puts them in the list you actually work from. The inbox can then be treated as a place to read, not a place to remember.
What you get out of it
Nothing slips through
Requests hidden in long emails become tasks you will see, so deadlines are not missed.
Clear, short tasks
AI writes a task title that says what to do, not the email's subject line.
Due dates picked up
Dates mentioned in the email become the task's due date, so Todoist reminds you on time.
One click back to context
Each task links to the original email, so you have the details when you start.
How it works
What happens, step by step
Every 15 minutes ClickRuntime looks at new emails in your inbox that have not been checked yet.
AI decides whether each email asks you to do something, and if so writes a short task title, due date and next step.
A Todoist task is created with a link back to the email.
The email gets a Tasked label, so it is never turned into a task twice.
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 Todoist
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 Todoist 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, http, ai
LABEL_ID = "Label_456" # your "Tasked" label
SCHEMA = {"type": "object", "required": ["actionable"], "properties": {"actionable": {"type": "boolean"},
"title": {"type": "string"}, "due": {"type": "string"}, "next_step": {"type": "string"}}}
@on_trigger
def run(event):
gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
msgs = gmail.messages().list(userId="me", q="in:inbox newer_than:1d -label:Tasked -category:promotions", maxResults=20).execute().get("messages", [])
report_fetched(len(msgs))
if not msgs:
return {"tasks": 0}
todoist, made = {"Authorization": "Bearer " + credentials.connection("todoist", "main")}, 0
for m in msgs:
msg = gmail.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
head = {h["name"]: h["value"] for h in msg["payload"]["headers"]}
r = ai.generate(f"From: {head.get('From')}\nSubject: {head.get('Subject')}\n{msg['snippet']}", json_schema=SCHEMA, max_output_tokens=120,
system="Does this email need the reader to act? If so give a short task title, due date (YYYY-MM-DD or empty) and next step.").json
if r["actionable"]:
http.post("https://api.todoist.com/api/v1/tasks", headers=todoist, json={"content": r["title"], "due_date": r.get("due") or None,
"description": f"{r.get('next_step', '')}\nhttps://mail.google.com/mail/u/0/#all/{m['id']}"}).raise_for_status()
made += 1
gmail.messages().modify(userId="me", id=m["id"], body={"addLabelIds": [LABEL_ID]}).execute()
return {"checked": len(msgs), "tasks": made}FAQ
Common questions
Will newsletters and notifications become tasks?
Which Todoist project do tasks go to?
Does it change my 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
Get one morning email with tasks and important mail
Each weekday morning one email lists today's and overdue Todoist tasks and sums up your unread important emails.
See how it worksLabel new emails automatically
New mail is sorted into labels like Inquiry, Invoice and Newsletter within minutes of arriving.
See how it worksGet draft replies to emails that need an answer
Emails that need a reply get a draft in the same thread, ready for you to edit and send.
See how it worksKeep exploring
Set up “Turn emails that need action into Todoist tasks” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.