{"slug": "n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes", "title": "n8n workflow that sorts support emails into Gmail labels (Returns, Warranty, Quotes, Other) with the Text Classifier node and Claude. Paste it into an empty n8n workflow.", "summary": "A developer published a ready-to-import n8n workflow that uses the Text Classifier node with an Anthropic Claude model to sort incoming support emails into Gmail labels for Returns, Warranty, Quotes and Other. The workflow polls a support address via a Gmail Trigger, classifies subject and body text against described categories, and applies the matching label, with a fallback branch routing uncategorized mail to Other so no messages are dropped.", "body_md": "|  | { | \n|  | \"name\": \"Support email sorter\", | \n|  | \"nodes\": [ | \n|  | { | \n|  | \"parameters\": { | \n|  | \"content\": \"## Setup steps\\n1. In Gmail, create four labels: **Returns, Warranty, Quotes, Other**.\\n2. **Gmail Trigger:** choose your Gmail credential and change the filter to your support address, for example `to:yourname+support@gmail.com`.\\n3. **Anthropic Chat Model:** choose your Anthropic credential and a Claude model.\\n4. In each **Add ... label** node, choose your Gmail credential and pick the matching label.\\n5. Run a test with **Fetch Test Event**, then publish the workflow.\\n\\nEmails that fit no category go to the Other branch and get the Other label, so none are dropped.\", | \n|  | \"height\": 340, | \n|  | \"width\": 460 | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.stickyNote\", | \n|  | \"typeVersion\": 1, | \n|  | \"position\": [ | \n|  | -520, | \n|  | -160 | \n|  | ], | \n|  | \"id\": \"e6a58e30-b529-4474-b7a6-8e64691d957a\", | \n|  | \"name\": \"Setup steps\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"pollTimes\": { | \n|  | \"item\": [ | \n|  | { | \n|  | \"mode\": \"everyMinute\" | \n|  | } | \n|  | ] | \n|  | }, | \n|  | \"simple\": false, | \n|  | \"filters\": { | \n|  | \"q\": \"to:yourname+support@gmail.com\" | \n|  | }, | \n|  | \"options\": {} | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.gmailTrigger\", | \n|  | \"typeVersion\": 1.4, | \n|  | \"position\": [ | \n|  | 0, | \n|  | 80 | \n|  | ], | \n|  | \"name\": \"Gmail Trigger\", | \n|  | \"id\": \"4a861507-1003-4528-9ea6-9f9b7370ae32\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"inputText\": \"={{ $json.subject }}\\n{{ $json.text }}\", | \n|  | \"categories\": { | \n|  | \"categories\": [ | \n|  | { | \n|  | \"category\": \"Returns\", | \n|  | \"description\": \"The customer wants to send an item back, exchange it, or get a refund.\" | \n|  | }, | \n|  | { | \n|  | \"category\": \"Warranty\", | \n|  | \"description\": \"A product broke, stopped working or has a defect, and the customer wants it repaired or replaced.\" | \n|  | }, | \n|  | { | \n|  | \"category\": \"Quotes\", | \n|  | \"description\": \"The customer asks for a price, a bulk or business order, or a quote before buying.\" | \n|  | } | \n|  | ] | \n|  | }, | \n|  | \"options\": { | \n|  | \"fallback\": \"other\" | \n|  | } | \n|  | }, | \n|  | \"type\": \"@n8n/n8n-nodes-langchain.textClassifier\", | \n|  | \"typeVersion\": 1.1, | \n|  | \"position\": [ | \n|  | 224, | \n|  | 80 | \n|  | ], | \n|  | \"name\": \"Text Classifier\", | \n|  | \"id\": \"1682084f-1849-48df-bb8b-ebf1b3d4eced\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"model\": { | \n|  | \"__rl\": true, | \n|  | \"value\": \"claude-haiku-5-5\", | \n|  | \"mode\": \"list\", | \n|  | \"cachedResultName\": \"Claude Haiku 5.5\" | \n|  | }, | \n|  | \"options\": {} | \n|  | }, | \n|  | \"type\": \"@n8n/n8n-nodes-langchain.lmChatAnthropic\", | \n|  | \"typeVersion\": 1.6, | \n|  | \"position\": [ | \n|  | 296, | \n|  | 376 | \n|  | ], | \n|  | \"name\": \"Anthropic Chat Model\", | \n|  | \"id\": \"8c8039fb-752f-4a3a-9489-069e6411f939\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"operation\": \"addLabels\", | \n|  | \"messageId\": \"={{ $json.id }}\", | \n|  | \"labelIds\": [] | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.gmail\", | \n|  | \"typeVersion\": 2.2, | \n|  | \"position\": [ | \n|  | 576, | \n|  | -16 | \n|  | ], | \n|  | \"name\": \"Add Warranty label\", | \n|  | \"id\": \"12618590-5636-48ad-b3ad-1856de3130af\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"operation\": \"addLabels\", | \n|  | \"messageId\": \"={{ $json.id }}\", | \n|  | \"labelIds\": [] | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.gmail\", | \n|  | \"typeVersion\": 2.2, | \n|  | \"position\": [ | \n|  | 576, | \n|  | -208 | \n|  | ], | \n|  | \"name\": \"Add Returns label\", | \n|  | \"id\": \"01721f9d-08ad-4285-9cd3-ef8c4adde52c\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"operation\": \"addLabels\", | \n|  | \"messageId\": \"={{ $json.id }}\", | \n|  | \"labelIds\": [] | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.gmail\", | \n|  | \"typeVersion\": 2.2, | \n|  | \"position\": [ | \n|  | 576, | \n|  | 176 | \n|  | ], | \n|  | \"name\": \"Add Quotes label\", | \n|  | \"id\": \"67c5558c-2064-4937-bd12-0c4b4ad991ff\" | \n|  | }, | \n|  | { | \n|  | \"parameters\": { | \n|  | \"operation\": \"addLabels\", | \n|  | \"messageId\": \"={{ $json.id }}\", | \n|  | \"labelIds\": [] | \n|  | }, | \n|  | \"type\": \"n8n-nodes-base.gmail\", | \n|  | \"typeVersion\": 2.2, | \n|  | \"position\": [ | \n|  | 576, | \n|  | 368 | \n|  | ], | \n|  | \"name\": \"Add Other label\", | \n|  | \"id\": \"27557aaa-8749-43a8-91bc-1acd523bc5e0\" | \n|  | } | \n|  | ], | \n|  | \"pinData\": {}, | \n|  | \"connections\": { | \n|  | \"Gmail Trigger\": { | \n|  | \"main\": [ | \n|  | [ | \n|  | { | \n|  | \"node\": \"Text Classifier\", | \n|  | \"type\": \"main\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ] | \n|  | ] | \n|  | }, | \n|  | \"Anthropic Chat Model\": { | \n|  | \"ai_languageModel\": [ | \n|  | [ | \n|  | { | \n|  | \"node\": \"Text Classifier\", | \n|  | \"type\": \"ai_languageModel\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ] | \n|  | ] | \n|  | }, | \n|  | \"Text Classifier\": { | \n|  | \"main\": [ | \n|  | [ | \n|  | { | \n|  | \"node\": \"Add Returns label\", | \n|  | \"type\": \"main\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ], | \n|  | [ | \n|  | { | \n|  | \"node\": \"Add Warranty label\", | \n|  | \"type\": \"main\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ], | \n|  | [ | \n|  | { | \n|  | \"node\": \"Add Quotes label\", | \n|  | \"type\": \"main\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ], | \n|  | [ | \n|  | { | \n|  | \"node\": \"Add Other label\", | \n|  | \"type\": \"main\", | \n|  | \"index\": 0 | \n|  | } | \n|  | ] | \n|  | ] | \n|  | } | \n|  | }, | \n|  | \"active\": false, | \n|  | \"settings\": { | \n|  | \"executionOrder\": \"v1\" | \n|  | } | \n|  | } |", "url": "https://wpnews.pro/news/n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes", "canonical_source": "https://gist.github.com/alzanalzamora/eb94b56e57369f540f3a36f2e85005f0", "published_at": "2026-10-12 09:53:10+00:00", "updated_at": "2026-10-20 05:14:26.214809+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "large-language-models", "artificial-intelligence"], "entities": ["n8n", "Anthropic", "Claude", "Gmail", "Google"], "also_reported_by": [], "takeaway": "Pairing n8n's Text Classifier node with a Claude model and a fallback category lets a Gmail-triggered workflow auto-label support mail into Returns, Warranty, Quotes and Other without dropping unmatched emails.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes", "markdown": "https://wpnews.pro/news/n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes.md", "text": "https://wpnews.pro/news/n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes.txt", "jsonld": "https://wpnews.pro/news/n8n-workflow-that-sorts-support-emails-into-gmail-labels-returns-warranty-quotes.jsonld"}}