n8n

How to Automate Gmail Inbox Management with Telegram?

Clear your inbox without babysitting email. A Telegram message kicks off an AI powered sort that archives noise and labels the rest so you can act fast. It suits founders, operations teams, and assistants who live in Gmail and need quick status updates.

When you ping the bot, the flow pulls new messages from the Gmail INBOX. A filter skips emails that were already handled to save model calls and time. An AI agent on OpenRouter reviews each message and decides two things: which labels to apply and whether to archive by removing the INBOX label. Results are grouped, a short report is written by a second model, and a recap lands back in your Telegram chat for quick review.

Connect your Gmail account, Telegram bot, and OpenRouter API key, then adjust the prompt and label rules to match your priorities. Expect major time savings on daily triage and more consistent labels across the team. This is great for shared inboxes, vendor updates, newsletters, and alerts that should be labeled or archived fast.

What are the key features?

  • Telegram Trigger starts sorting when you message the bot.
  • Gmail node fetches emails from the INBOX label.
  • Filter node skips emails already processed to avoid repeats.
  • AI agent via OpenRouter chooses labels and archive actions.
  • Gmail Tool nodes add labels and remove the INBOX label to archive.
  • Aggregate and Reporter nodes create a clear summary of actions.
  • Telegram node sends the final report back to your chat.
  • Manual Trigger lets you run tests without Telegram.

What are the benefits?

  • Reduce manual triage from 60 minutes a day to under 5 minutes
  • Automate 80 percent of email sorting and labeling
  • Improve inbox accuracy by applying the same rules every time
  • Connect Gmail and Telegram for quick control and feedback
  • Handle higher email volume without adding headcount

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Telegram and OpenRouter. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create Gmail OAuth2 credentials: double click the Gmail nodes, choose 'Credential to connect with', click 'Create new credential', and follow the on screen steps to authorize your Google account with Gmail access.
  4. Create a Telegram Bot with BotFather, copy the bot token, then in the n8n credentials manager create Telegram credentials by pasting the token. Start a chat with your bot so it can receive messages.
  5. Get your OpenRouter API key from your OpenRouter account. In the n8n credentials manager, create OpenRouter credentials and paste the API key. Double click both OpenRouter Chat Model nodes and select this credential.
  6. Open the Gmail 'Get mails in INBOX' node and confirm it pulls from the INBOX label. Adjust max results if you want to limit the first run.
  7. Open the 'Filter processed' node and set the condition to skip emails that already have your chosen label, for example a label named PROCESSED or any label your team uses to mark handled messages.
  8. Open the 'Categoriser' agent node and refine the prompt so the AI knows which messages to archive and which labels to apply. Keep the rules simple and clear.
  9. Check the 'mail_label_setter' and 'mail_archiver' Gmail Tool nodes. Ensure the credential is set and that label IDs you plan to use exist in Gmail. Create missing labels in Gmail if needed.
  10. Send a message to your Telegram bot to trigger the flow. Watch the execution in n8n and confirm that emails are labeled or archived and that a summary message appears in Telegram.
  11. If Gmail authentication fails, reauthorize the Gmail credential and ensure the correct scopes are granted. If Telegram does not respond, make sure you started the bot and the token is valid.
  12. If the AI does not apply labels, check your OpenRouter key limits and review the agent prompt. Also verify label names match exactly what exists in Gmail or use label IDs.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

OpenRouter

Sign up

Free models: $0 via API, 20 requests/min; 50/day or 1000/day with ≥10 credits

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.