What this workflow does
- Gmail: To task label (Gmail Trigger) picks up new messages carrying your “To task” label, with the full body.
- Strip quotes and signatures (Code) removes quoted replies, reply headers, signatures and legal footers, keeps attachment names, and skips no-reply and auto-submitted senders before any model call.
- Classify and extract with Claude (HTTP Request) returns a category (new request, update, informational, automated, other) plus task fields from a strict JSON schema. Due date and assignee each carry a confidence value, so vague cases are marked rather than guessed.
- Parse and route (Code) handles refusals and truncated output, drops non-requests, maps the sender’s domain to an Asana project and named teammates to Asana users, and only sets a due date the sender actually stated.
- Route (Switch) sends tasks onward and errors to Slack.
- Look up thread (Google Sheets) checks whether this thread already has a task.
- Task exists for thread? (If) adds the new message as a comment with any proposed date change, or creates a new task.
- Create Asana task, Shape mapping row (Edit Fields) and Save thread mapping record thread ID, task ID and link.
- Label email as captured (Gmail) tags the message so the team can see it is tracked.
- Post exception to Slack collects API errors, refusals and Asana failures.
Before you import
- A Gmail account or shared mailbox, with a “To task” label applied by a filter or by hand, and a “Task captured” label.
- An Anthropic API key. The template uses
claude-opus-5-5at low effort;claude-haiku-5-5is cheaper for high-volume, simple classification. - An Asana personal access token, a “Needs review” project, and a Google Sheet with a Threads tab.
- A Slack bot in an exceptions channel.
Setup
- Import the JSON and connect Gmail, Anthropic, Asana, Google Sheets and Slack credentials.
- Replace
REPLACE_WITH_TO_TASK_LABEL_IDon the trigger andREPLACE_WITH_CAPTURED_LABEL_IDon the label node with Gmail label IDs (they look likeLabel_123). - Create the Threads tab with headers thread_id, task_id, task_url, subject, from_address, created_at, and replace
REPLACE_WITH_SHEET_IDon both Sheets nodes. - In Parse and route, fill
DOMAIN_PROJECTS,DEFAULT_PROJECTandPEOPLE. - Replace
REPLACE_WITH_ASANA_WORKSPACE_IDandREPLACE_WITH_SLACK_EXCEPTIONS_CHANNEL_ID.
Test it
Label four emails: a clear request with a date, a reply on that same thread changing the date, a newsletter and a thank-you note. The first should create one Asana task with the due date and an email link. The reply should appear as a comment on that task with the proposed date, not as a second task. The newsletter and thank-you should create nothing.
Make it production-ready
- Before switching it on, label 100 to 200 real emails by hand and measure how many created tasks are real. Favor precision first.
- Keep every task in the Needs review project for two weeks, then route by client domain.
- Log deleted or merged auto-created tasks and add them to your test set.
- Add an n8n error workflow, and watch Asana’s rate limits if the mailbox is busy.
- Optionally send the requester a short acknowledgment with the task link once accuracy is proven.
Read the full guide on turning emails into tasks with AI for classifier testing and deduplication, or talk to Lumeor about Outlook, ClickUp or Jira versions.