Turn starred Gmail emails into Todoist tasks every evening

By General Input

Every weekday at 6pm, sweep today's starred Gmail messages and turn the ones that still need a reply into Todoist tasks with a link, a sender, and a smart due date.

Integrations

  • Gmail
  • Todoist

Type

Agentic Task

Categories

  • Personal Productivity

Build an agent workflow that converts my starred Gmail emails into Todoist tasks at the end of each workday.

Trigger: cron, every weekday (Monday through Friday) at 6:00pm in my local timezone.

On the very first run only, check Gmail's labels via the List Labels operation and, if a label called "Todoist-Processed" does not exist, create it with Gmail's Create a Label operation. This label is what the workflow uses to remember which messages it has already turned into tasks.

Each run, call Gmail's List Messages with the search query: is:starred newer_than:1d -label:Todoist-Processed. That returns today's starred messages that have not been processed yet. For each message ID returned, call Gmail's Get a Message with format=full so the agent can read the subject, sender, snippet, and body.

For each thread, the agent should decide whether I actually owe the sender something — a reply, a decision, a piece of work, a scheduling action, or any other follow-up. If the email is pure FYI, a newsletter, a confirmation, or something already resolved in the thread, skip it.

When the agent decides a follow-up is owed, call Todoist's Create Task with these fields:

- content: a one-line summary of what I need to do, written in the imperative (e.g. "Reply to Sarah with the Q3 budget numbers").

- description: include the sender's name and a clickable link back to the Gmail thread (https://mail.google.com/mail/u/0/#inbox/<threadId>).

- project_id: my Inbox project. Use Todoist's List Projects operation once to find the Inbox project id and reuse it.

- due_string: a due date inferred from the email body if one is mentioned (e.g. "by Friday", "end of week", "tomorrow"). If nothing is specified, default to "next business day".

After the task is created successfully, call Gmail's Modify Message Labels on that message to add the Todoist-Processed label. This is how we prevent duplicates if the email stays starred or if the workflow runs again later.

If creating the Todoist task fails for a message, do not add the Todoist-Processed label so the next run retries it. Log the failure but keep processing the rest of the batch.

At the end of the run, no notification or digest is needed. The Todoist Inbox itself is the output.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredChase the paperwork every new client and vendor still owesFile Gmail attachments into storage with names you can findCandidate rediscovery desk for your archived Lever applicantsLaytime and demurrage claim workspace for chartering opsKajabi customer support console for member access fixesRun your application review round on Jotform submissionsRun your nutrition clients' weekly meal plans from one consoleReplace the dispatch whiteboard with a live production boardJob search command center with a self-filling pipeline board