🎫 Automated email triage with Gmail, GPT-4o, and Slack urgency notifications

⚑ 1,739 views · 🎫 Ticket Management & Triage

Description

Hourly Email Summary: This agent scans your inbox every 4 hour and summarizes new emails into a clean, actionable Slack message. Powered by GPT-4, it classifies emails by Urgency (High, Medium, Low) and Intent (Awaiting Reply, To Respond, Comment, Notification, Marketing). No more inbox FOMO β€” just what you need to act fast.

Main Use Cases: β€’ Stay on top of important threads without refreshing your inbox constantly β€’ Prioritize tasks and replies based on urgency and context β€’ Catch missed follow-ups by surfacing emails that need a response β€’ Filter out noise like marketing emails or low-priority notifications β€’ Enable async decision-making by keeping the team updated on critical emails via Slack β€’ Reduce cognitive load by letting AI handle sorting and triaging βΈ»

βœ… Steps to Use

  1. Connect Your Accounts: Add your Gmail, Slack, Google Sheets, and OpenAI credentials inside n8n.
  2. Create Gmail Labels (Required): Go to your Gmail settings and create labels matching the following format: AI Agent/To Respond, AI Agent/Awaiting Reply, AI Agent/Notification, AI Agent/Marketing, etc. These are used by the workflow to auto-tag emails based on intent.
  3. Create a Google Sheet with 2 Tabs β€’ Name the sheet something like β€œN8N - Emails”. β€’ Add two sheets/tabs inside: β€’ Sheet1 β†’ stores all processed emails β€’ Sheet2 β†’ stores only the latest batch for digest view β€’ In both sheets, add these columns (first row): From | Summary | Intent | Category | TimeStamp | Urgency
  4. Import the Workflow: Upload or paste the .json file into your n8n instance. Make sure each node is linked to your active credentials.
  5. Configure Slack Channel: In the Slack node, select the channel where you want urgent alerts and digest summaries to be posted.
  6. Adjust Schedule (Optional): Default: runs every hour. You can tweak this to suit your preference (e.g., every 30 min or 2 hours).
  7. Run a Test: Execute manually once to check: β€’ Emails are getting processed β€’ Labels are added correctly in Gmail β€’ Slack notifications are triggered β€’ Data is logged in Google Sheets
  8. Turn It On β€’ Once everything looks good, activate the workflow. β€’ Your inbox will now be triaged in real-time β€” sorted, labeled, summarized.

Step-by-Step Breakdown:

  1. ⏰ Schedule Trigger: Runs every hour to kick off the workflow automatically.
  2. πŸ“© Fetch Emails & Labels β€’ Pulls all Gmail messages received in the last 4 hours. β€’ Also fetches Gmail labels to use for tagging messages based on intent.
  3. πŸ€– Analyze with GPT-4 β€’ Each email is analyzed using GPT-4. β€’ Output includes: β€’ Summary β€’ Urgency: High, Medium, Low β€’ Intent: To Respond, Awaiting Reply, Marketing, Notification, etc. β€’ Category: Customer, Investor, Spam, etc.
  4. Classify and Label β€’ Emails are tagged with the right intent label inside Gmail. 5.🚨 Slack Alerts for High Urgency β€’ If an email is marked High Urgency, it sends an alert to a designated Slack channel with all key details.
  5. πŸ“Š Google Sheets Logging β€’ All emails are logged to two Google Sheets: β€’ Sheet1: All messages, for long-term record. β€’ Sheet2: Temporary sheet to collect latest batch for digest.
  6. ⏳ Wait + Digest Preparation β€’ After logging, the workflow waits 30 seconds. β€’ It then fetches recent entries from Sheet2, filters out older messages, and groups them by Medium and Low urgency.
  7. πŸ“¬ Slack Digest Summary β€’ A clean digest is posted on Slack showing only the Medium and Low urgency messages from the past hour β€” helping you catch up without inbox overload.

Uses a System Prompt to define its role as an AI Chief of Staff.

Uses a User Prompt that instructs GPT-4 to analyze each email and return a structured JSON with the following: β€’ summary – One-line summary of the email β€’ urgency – High / Medium / Low β€’ category – Investor, Customer, Support, Spam, Other β€’ Intent – One of: β€’ To Respond: Needs your reply β€’ Awaiting Reply: You’re waiting for a response β€’ Notification: Auto-updates from tools or services β€’ Meeting Update: Calendar or schedule changes β€’ Marketing: Promotional or cold emails β€’ FYI: Informational emails that don’t need action

The output is clean JSON with built-in guardrails to avoid hallucinations or irrelevant content. Only real message data is used for summaries and classification.

Sections with no relevant data are omitted to keep it concise.

🧩 What’s Next

This agent already cuts through inbox noise and gives you clarity β€” but there’s more you can build on top:

πŸ’‘ Suggestions to Improve: β€’ Train on your past threads to make prioritization even smarter β€’ Allow custom rules per sender or domain (e.g. always mark investor emails as High) β€’ Add emoji tags or reactions in Slack to quickly mark emails as done or follow-up β€’ Support voice summary via Slack audio snippet or Loom integration

πŸš€ Next Features You Could Add: β€’ Reply-from-Slack: One-click smart reply suggestions that can be sent right from Slack β€’ Cross-inbox support: Add Outlook or multiple Gmail accounts β€’ Weekend Digest: A weekly email or Slack drop with trends (top senders, most flagged categories) β€’ Daily Timeline View: Generate a Notion page that logs the day’s most critical communication

πŸ”— Nodes Used

Google Sheets, Slack, Gmail, Schedule Trigger, OpenAI

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup