Matt Chong | n8n Creator
Automation nerd fueled by good coffee, deep curiosity, and clean flows.
Templates by Matt Chong | n8n Creator
Automatic Gmail categorization and labeling with AI
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Who is this for? If your inbox is full of unread emails, this workflow is for you. Instead of reading through them one by one, let AI do the sorting. It reads your emails and flags only what needs action. What does it solve? This workflow reads your unread Gmail emails and uses AI to decide what’s important — and what’s not. It labels emails that need your attention, identifies receipts, and trashes everything else. No more manual reading. Just an inbox that uses AI to take care of itself. How it works Every hour, the workflow runs automatically. It searches for unread emails in your Gmail inbox. For each email: It extracts the content and sends it to OpenAI. The AI returns one of four labels: Action, Receipt, Informational or Spam. Based on the label: Emails are marked with the appropriate label. Or moved to trash it is spam. It marks the email as read once processed. How to set up? Connect these services in your n8n credentials: Gmail (OAuth2) OpenAI (API key) Create the Gmail labels: In your Gmail account, create these labels exactly as written: Action, Receipt, and Informational The workflow will apply these labels based on AI classification. How to customize this workflow to your needs Change the AI prompt to detect more types of emails like Meeting or Newsletter. Add more branches to the Switch node to apply custom logic. Change the schedule to fit your workflow. By default, it runs every hour, but you can update this in the Schedule Trigger node.
AI auto-save Gmail receipts to Google Sheets + Google Drive
Who is this for? This workflow is ideal for: For freelancers, business owners, and finance teams who receive receipts via Gmail Automatically logs expenses for tax, bookkeeping and year-end audits What problem is this workflow solving? When tax season hits, missing receipts create panic. This workflow keeps everything in one place. It uses AI to extract details from Gmail attachments, logs them in a Google Sheet, and stores the PDFs in Google Drive. No digging. No copying. Just everything where it should be. How it works? Apply the label receipt to any incoming Gmail email. Do not mark it as read. On a schedule (e.g. daily at 8:00 AM), the workflow triggers. It searches for unread emails with the label receipt. For each matching email, it downloads the attached receipt file. It extracts text content from the receipt file. It uploads the original receipt file to a specified folder in Google Drive. It merges the extracted text with email metadata. It sends this combined data to OpenAI. OpenAI extracts structured fields: date merchant category description subtotal tax total The extracted data is appended as a new row in the specific Google Sheet. Finally, the email is marked as read to prevent it from being processed again. How to set up? Connect these services in your n8n credentials: Gmail (OAuth2) Google Drive Google Sheets OpenAI Configure the Google Drive upload: In the “Upload File” node, select the target folder where you want receipt PDFs stored. Set your execution schedule: Open the “Schedule Trigger” node and choose when it should run (default is once daily at 8:00 AM). Choose your Google Sheet and tab: In the “Append to Google Sheet” node, select your document and tab Ensure the sheet contains these columns: Date, Merchant, Category, Description, Subtotal, Tax, Total. How to customize this workflow to your needs? Change the Gmail label or search filter to match your needs. Modify the OpenAI schema to extract additional fields like currency, project, or notes.
Auto-categorize Gmail emails with AI and send prioritized Slack alerts
Who is this for? Teams using Gmail and Slack who want to streamline email handling. Customer support, sales, and operations teams that want emails sorted by topic and priority automatically. Anyone tired of manually triaging customer emails. What does it solve? Stops important messages from slipping through the cracks. Automatically identifies the nature and urgency of incoming emails. Routes emails to the right Slack channel with a clear, AI-generated summary. How it works The workflow watches for unread emails in your Gmail inbox. It fetches the full email content and passes it to OpenAI for classification. The AI returns structured JSON with the email’s category, priority, summary, and sender. Based on the AI result, it assigns a label and Slack channel. A message is sent to the right Slack channel with the details. How to setup? Connect credentials: Gmail (OAuth2) Slack (OAuth2) OpenAI (API Key) Adjust email polling: Open the Gmail Trigger node and set how frequently it should check for new emails. Verify routing settings: In the “Routing Map” node, update Slack channel IDs for each category if needed. Customize AI behavior (optional): Tweak the AI Agent prompt to better match your internal categorization rules. How to customize this workflow to your needs Add more categories: Update the AI prompt and the schema in the “Structured Output Parser.” Change Slack formatting: Modify the message text in the Slack node to include links, emojis, or mentions. Use different routing logic: Expand the Routing Map to assign based on keywords, domains, or even sentiment. Add escalation workflows: Trigger follow-up actions for high-priority or complaint emails.
Declutter Gmail: archive inactive emails with GPT-4 classification
Who is this for? This workflow is for professionals, entrepreneurs, or anyone overwhelmed by a cluttered Gmail inbox. If you want to automatically archive low-priority emails using AI, this is the perfect hands-free solution. What does it solve? Your inbox fills up with old, read emails that no longer need your attention but manually archiving them takes time. This workflow uses AI to scan and intelligently decide whether each email should be archived, needs a reply, or is spam. It helps you: Declutter your Gmail inbox automatically Identify important vs. unimportant emails Save time with smart email triage How it works A scheduled trigger runs the workflow (you set how often). It fetches all read emails older than 45 days from Gmail. Each email is passed to an AI model(GPT-4) that classifies it as: Actionable Archive If the AI recommends archiving, the workflow archives the email from your inbox. All other emails are left untouched so you can review them as needed. How to set up? Connect your Gmail (OAuth2) and OpenAI API credentials. Open the "Schedule Trigger" node and choose how often the workflow should run (e.g., daily, weekly). Optionally adjust the Gmail filter in the “List Old Emails” node to change which emails are targeted. Start the workflow and let AI clean up your inbox automatically. How to customize this workflow to your needs Change the Gmail filter: Edit the query in the Gmail node to include other conditions (e.g., older_than:30d, specific labels, unread only). Update the AI prompt: Modify the prompt in the Function node to detect more nuanced categories like “Meeting Invite” or “Newsletter.” Adjust schedule frequency: Change how often the cleanup runs (e.g., hourly, daily).
Extract invoice data from Gmail with GPT-4o and send Slack notifications
Who is this for? This workflow is ideal for freelancers, accountants, and finance teams who receive invoices in Gmail and want to automate their tracking process with AI. If your inbox fills up with invoice-related messages and you want to automate how they’re handled, this AI-powered solution is for you. What does it solve? Automatically detects and processes invoices from your Gmail inbox. Uses OpenAI GPT-4o to extract payment amount, due date, subject line, and sender details. Sends real-time Slack notifications so you never miss a payment. Eliminates manual sorting of invoice-related emails. Great for improving productivity and ensuring timely payment tracking. How it works Every hour, the workflow checks for unread emails in your Gmail inbox. It sends the email content to OpenAI to determine if it's invoice-related email. If it is: It extracts key fields like due date, amount due, subject, and sender. Then sends a Slack message with these details. If it's not invoice-related, it simply ignores the email. How to setup? Connect these accounts: Gmail using OAuth2 Slack using OAuth2 OpenAI (API Key under credentials) Customize the Slack message (optional): In the Slack node, you can modify the text to show more fields or personalize the formatting. Adjust the schedule: By default, the workflow runs hourly. You can change the frequency in the Schedule Trigger node. Modify the AI logic (optional): Update the AI Agent prompt to detect additional types like receipts or payment confirmations. How to customize this workflow to your needs Notify a Slack channel instead of a user: Just switch the recipient in the Slack node. Add labels in Gmail: Add nodes to label or archive invoice emails once detected. Expand detection: Modify the AI prompt to detect other financial or transactional emails.