Quick overview This workflow polls Gmail for new emails, uses Google Gemini via an n8n AI text classifier to categorize each message by subject and snippet, and automatically applies the matching Gmail label, sending a Telegram alert if classification errors occur. How it works Checks Gmail every minute for new emails using the Gmail Trigger. Sends the email subject and snippet to a Google Gemini-powered text classifier to assign a category (Personal, Job, Study Related, Bank, Social, OTP, or Misc). Adds the corresponding Gmail label to the message in Gmail based on the predicted category. Sends a Telegram message to the configured chat ID if the classifier step produces an error. Setup Connect your Gmail account using Gmail OAuth2 and ensure the trigger has access to the mailbox you want to label. Add a Google Gemini (PaLM) API key credential for the AI classification step. Create (or choose) the target Gmail labels and replace the label IDs in each “addLabels” action with your own. Add Telegram bot credentials and set the correct chat ID in the Telegram message step (or disable it if you don’t want error alerts).
Tags
Related workflows
See all AI Automation→Send daily AI news digests from RSS feeds with OpenAI, Telegram and Gmail
Quick overview This workflow runs every morning at 8 AM, pulls articles from multiple RSS feeds, deduplicates and trims the list, uses OpenAI (GPT-5 Mini) to write a short plain-text news digest, and delivers the same digest to a Telegram chat and a Gmail inbox. How it works Runs daily at 8:00 AM on a schedule. Splits your configured RSS feed URL list into individual feeds and fetches the latest articles from each one, continuing even if a feed fails. Removes duplicate articles by link, keeps only the newest items up to your maxArticles limit, and trims each item to title, link, publish date, and a short snippet. Combines all cleaned articles into a single JSON list and sends it to OpenAI (GPT-5 Mini) to select 5–8 top stories and generate a single plain-text digest under 3,500 characters. Sends the generated digest to your specified Telegram chat. Emails the same digest as a plain-text message through Gmail. Setup Add an OpenAI credential and ensure the GPT-5 Mini model is available in your account. Create a Telegram bot with @BotFather, add the Telegram credential in n8n, and set your target telegramChatId (for example by using @get_id_bot). Connect a Gmail account in n8n and set
Verify Japanese invoice registration numbers from Gmail using Gemini, NTA API, Sheets and Slack
Quick Overview This workflow monitors Gmail for unread invoice emails with PDF attachments, extracts invoice details with Google Gemini, verifies Japanese qualified invoice registration numbers against the National Tax Agency (NTA) Invoice Web-API, logs results to Google Sheets, and sends Slack alerts for invalid, missing, or inconclusive checks. How it works Polls Gmail hourly for unread emails matching “has:attachment invoice” and downloads the first attachment. Extracts text from the attached invoice PDF. Uses Google Gemini to parse the invoice text into structured fields such as the T-registration number, issuer name, invoice date, and amounts. Normalizes and validates the registration number to ensure it matches the required “T + 13 digits” format. If the format is valid, calls the NTA Invoice Web-API to verify the registration number and interprets the response as valid, invalid, or not found. Appends the invoice details and verification status to a Google Sheets worksheet. Routes the outcome by sending the appropriate Slack alert for invalid/not found/inconclusive results or marking the invoice email as read when the number is valid. Setup Connect your Gmail OAuth2 credentia
Check Japanese ad copy compliance with Google Gemini, Sheets, Slack and Gmail
Quick Overview This workflow runs daily to review Japanese ad copy in Google Sheets using Google Gemini, writes compliance risk results back to the sheet, and alerts the right team in Slack (and drafts a Gmail revision request) based on high/medium/low risk. How it works Runs every day at 9:00 on a schedule. Reads ad copy rows from Google Sheets to find items that still need a compliance check. Sends each copy item to Google Gemini with the configured product category, target laws, and extra rules to generate a risk level, violations, and a compliant rewrite. Parses and normalizes the Gemini output into fields like risk level, violation count, and safe rewrite, and posts a Slack alert if the AI check fails. Updates the corresponding Google Sheets row with the compliance results to keep a record of the review. Routes the item by risk level and posts to Slack for legal blocking (high), marketing review (medium), publish-ready notification (low), or manual review when the result is inconclusive. For high-risk copy, also creates a Gmail draft requesting the author to revise the copy using the suggested compliant rewrite. Setup Add credentials for Google Sheets, Google Gemini (PaLM) API