Email Automation
Triage Gmail with Gemini, label emails, log invoices to Sheets, and send Telegram alerts
When a new email arrives, it handles email with Google Gemini using Data Table, Gmail, Google Sheets, Telegram.
What it does
## Triage Gmail with Gemini: label every email, draft replies, log invoices to Sheets and get urgent alerts on Telegram ### How it works This workflow watches Gmail for new messages, loads configurable user settings, reads the email, and asks Gemini to classify it. Based on Gemini’s structured result, it applies or creates Gmail labels, leaves draft replies when needed, logs invoice details to Google Sheets, sends urgent alerts to Telegram, and records each triage decision in an n8n data table. ### Setup steps - Connect Gmail credentials for the trigger, reading emails, listing/creating labels, applying labels, and creating drafts. - Connect Google Gemini credentials and confirm the primary and backup classification prompts/models are configured. - Create or select the Google Sheets spreadsheet for invoice logging, then set the correct invoices_sheet_id in the Set Email Parameters node. Its first row must have: Date, Issuer, Number, Net, VAT, Total, Currency, Subject, Link to the email. - Connect Telegram bot credentials and configure the chat or recipient used by the alert node. - Review the Set Email Parameters node values for your_name, business, tone, and any other workflow-specific defaults before activating the workflow. Leave telegram_chat_id empty to skip alerts; set create_drafts to false for labels only. - Nothing is ever sent for you: replies stay as drafts, and anything Gemini does not know stays in [brackets]. ### Customization Adjust the Gemini classification prompt, label mapping, reply tone, invoice row fields, and urgency criteria to match your mailbox and business process. Made by Amelqa · amelqa.com
The steps
- When Email Received
- Set Email Parameters
- Fetch Gmail Labels
- Create Log Table
- Retrieve Email Content
- Process Email Content
- Classify Email with Gemini
- Backup Classify with Gemini
- Analyze Classification Result
- Select Appropriate Label
- Check Label Presence
- Generate New Gmail Label
- Store New Label ID
- Assign Label to Email
22 steps in total.
Similar automations