{"product_id":"gmail-ai-email-classification-with-gpt-4o-mini-labels","title":"Gmail AI Email Classification with GPT-4o-mini Labels","description":"\u003ch3\u003eTurn new Gmail emails into labeled, actionable inboxes—automatically\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your Gmail for new messages, uses \u003cstrong\u003eOpenAI (GPT-4o-mini)\u003c\/strong\u003e to classify each email, then automatically applies the matching `Gmail label` based on the predicted category—so your inbox stays organized without manual triage.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eDesigned for practical inbox automation, this “lite” build follows a simple pipeline:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers every minute\u003c\/strong\u003e when a new email arrives in Gmail.\u003c\/li\u003e\n  \u003cli\u003eBuilds the OpenAI request using a \u003cstrong\u003eclassification prompt\u003c\/strong\u003e, your selected model (\u003cstrong\u003eGPT-4o-mini\u003c\/strong\u003e), and a \u003cstrong\u003emapping of categories to Gmail label IDs\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eSends key email details to the \u003cstrong\u003eOpenAI Chat Completions API\u003c\/strong\u003e: the email \u003cstrong\u003esubject\u003c\/strong\u003e, \u003cstrong\u003esender\u003c\/strong\u003e, and a \u003cstrong\u003etruncated body\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eParses the JSON response\u003c\/strong\u003e to extract \u003cstrong\u003ecategory\u003c\/strong\u003e, \u003cstrong\u003eurgency\u003c\/strong\u003e, and a \u003cstrong\u003eshort summary\u003c\/strong\u003e, defaulting to \u003cstrong\u003e“noise”\u003c\/strong\u003e if parsing fails.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAdds the corresponding Gmail label\u003c\/strong\u003e to the original message based on the returned category.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomatically sort inbound leads, support emails, and newsletters into labeled Gmail folders.\u003c\/li\u003e\n  \u003cli\u003eReduce inbox backlog by tagging “noise” or low-priority messages without opening them.\u003c\/li\u003e\n  \u003cli\u003eSaaS operators who want consistent triage rules without maintaining complex filters.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\u003c\/strong\u003e: \u003cem\u003eGmail Trigger\u003c\/em\u003e, \u003cem\u003eSet\u003c\/em\u003e, \u003cem\u003eHTTP Request\u003c\/em\u003e, \u003cem\u003eCode\u003c\/em\u003e, and a \u003cem\u003eGmail label action\u003c\/em\u003e (plus notes via \u003cem\u003eSticky Note\u003c\/em\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations\u003c\/strong\u003e: Gmail (trigger + apply labels) and OpenAI (Chat Completions) using HTTP Header Auth.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup requirements\u003c\/strong\u003e: connect Gmail credentials, add your OpenAI API key, create Gmail labels, copy their \u003cstrong\u003elabel IDs\u003c\/strong\u003e, and replace the placeholder values in the category-to-label mapping.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003e\u003cem\u003eNote:\u003c\/em\u003e This is the lite version. A fuller build also adds a Google Sheets log, AI-drafted replies to new enquiries, and instant alerts for urgent emails (available at \u003ca href=\"https:\/\/baynhams.gumroad.com\/l\/inbox-triage\" target=\"_blank\"\u003ebaynhams.gumroad.com\/l\/inbox-triage\u003c\/a\u003e).\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46001865621683,"sku":"N8N-19459","price":36.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/bDqcu9CKzC_pnkmZTZiHA_dnDBkWay.png?v=1789117915","url":"https:\/\/buyflowscripts.com\/products\/gmail-ai-email-classification-with-gpt-4o-mini-labels","provider":"N8N Commerce","version":"1.0","type":"link"}