Summarize Emails with n8n, OpenRouter AI & Line Messenger

This workflow automates reading emails via IMAP, summarizes them using OpenRouter AI, highlighting important action items and deadlines, and sends concise summaries to Line Messenger. It solves the problem of email overload by delivering only critical insights directly to your messaging app.
emailReadImap
httpRequest
stickyNote
Workflow Identifier: 2279
NODES in Use: EmailReadIMAP, HttpRequest, StickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. Opening Problem Statement

Meet Sarah, a busy project manager juggling dozens of emails daily from clients, team members, and vendors. Each day, she spends nearly two hours sifting through long email threads, struggling to identify urgent tasks, deadlines, and key decisions buried in the clutter. Important emails get overlooked, leading to missed deadlines and frustrated stakeholders. The manual effort drains her energy and cuts into time better spent on actual project work.

Sarah’s challenge illustrates a common modern workplace pain: information overload from email. Sorting through lengthy emails to find actionable insights is tedious and error-prone. What she needs is a way to automatically distill her emails into concise, prioritized summaries pinpointing critical actions and deadlines — then deliver these insights directly to her preferred messaging tool for quick, on-the-go review.

2. What This Automation Does

This specific n8n workflow handles Sarah’s email overload by automating three key tasks:

  • Reads incoming emails from any IMAP-compatible email server, such as Gmail, Outlook, or company mail.
  • Sends full email content to OpenRouter AI for smart summarization with emphasis on identifying urgent matters, action items, and deadlines.
  • Receives the AI-generated summary and formats it with visual highlights like bold deadlines and urgency emojis.
  • Pushes the concise, actionable summaries directly to Sarah’s Line Messenger app for instant mobile access.
  • Eliminates manual email triage, saving Sarah almost two hours each workday and reducing the risk of missing critical tasks.
  • Ensures important deadlines and sign-up or payment dates are clearly flagged so Sarah can act before it’s too late.

3. Prerequisites ⚙️

  • n8n account (self-hosted or cloud) 🔌
  • IMAP email account credentials (e.g., Gmail, Outlook) 📧
  • OpenRouter AI account with API key for free llama-3.1-70b-instruct model 🔑
  • Line Messaging API access with Channel Access Token for message push 🔑💬
  • Header-based Authentication credentials set up in n8n for API requests 🔐

4. Step-by-Step Guide

Step 1: Create an IMAP Email Read Node to Fetch Emails

Navigate to your n8n editor and click Add Node → search EmailReadIMAP. Drag it onto the canvas and name it “Read emails (IMAP)”.

Under credentials, select or create your IMAP account. For Gmail, use hosted IMAP settings as linked in the workflow sticky notes.

You should see your recent emails fetched after executing this node manually. Common mistake: forgetting to allow “less secure app access” or enabling IMAP in your email settings.

Step 2: Add HTTP Request Node to Send Email Content to OpenRouter AI

Add a new HTTP Request node named “Send email to A.I. to summarize”.

Set method to POST and URL to https://openrouter.ai/api/v1/chat/completions. Under Authentication, choose Header Auth and use “Authorization” as username and “Bearer {your API key}” as password.

Paste the exact JSON body from the workflow JSON, which sends email sender, subject, and HTML content to the llama-3.1-70b-instruct model, asking for a prioritized summary with bold deadlines and urgency emojis.

After running, you should see response choices containing the summary text. Common mistake: incorrect API key or missing “Bearer ” prefix in password.

Step 3: Add HTTP Request Node to Push Summary to Line Messenger

Next, add another HTTP Request node called “Send summarized content to messenger”.

Set method to POST with URL https://api.line.me/v2/bot/message/push, and Header Auth with your Line Channel Access Token as “Bearer {token}”.

In the JSON body, use the expression {{ $json.choices[0].message.content.replace(/n/g, "\n") }} to send the AI’s summary text as a message.

Run this node after the AI response to confirm the message appears in your Line app. Common mistake: using the outdated official Line node instead of HTTP with header auth.

Step 4: Connect the Nodes Sequentially

Link “Read emails (IMAP)” → “Send email to A.I. to summarize” → “Send summarized content to messenger” sequentially.

This ensures new emails trigger summarization and forwarding automatically.

Step 5: Activate and Test the Workflow

Once connected, activate the workflow and monitor the execution. Send test emails matching your typical workload to verify summaries are accurate and timely.

5. Customizations ✏️

  • Change AI Model: In the “Send email to A.I. to summarize” node, adjust the model parameter in the JSON body to experiment with other OpenRouter AI models for different summary styles.
  • Modify Summary Instructions: Tailor the prompt content to highlight other aspects like sentiment analysis or different action item formats.
  • Switch Messenger Platform: Replace the Line API URL and authentication with another messaging platform API (e.g., Telegram bot API) in the last HTTP node.
  • Filter Emails: Add filters or conditions in the IMAP node to only summarize emails from specific senders or containing certain keywords.

6. Troubleshooting 🔧

  • Problem: “Authentication failed” on IMAP node.
    Cause: Incorrect IMAP credentials or disabled IMAP access.
    Solution: Verify username/password, enable IMAP in your email settings, and test connection again.
  • Problem: “401 Unauthorized” on AI HTTP Request node.
    Cause: Incorrect API key or missing “Bearer” prefix.
    Solution: Check the Header Auth credential, confirm the exact formatting of the authorization header, and retry.
  • Problem: Messages not arriving in Line app.
    Cause: Invalid channel access token or outdated Line node usage.
    Solution: Use HTTP Request node with correct header auth and verify channel access token validity in Line Console.

7. Pre-Production Checklist ✅

  • Verify IMAP account is active and can fetch emails.
  • Confirm OpenRouter AI API key is valid and active.
  • Test Line Channel Access Token by sending a manual push message.
  • Check JSON body templates for correct expression syntax.
  • Run test emails through the entire workflow and verify correct summary receipt in Line.
  • Backup n8n workflow configuration before major changes.

8. Deployment Guide

Activate the workflow in your n8n environment. Since emails arrive continuously, set the trigger to poll periodically or run the workflow on demand depending on your email volume.

Monitor executions for errors via n8n’s built-in logs. Adjust rate limits in API calls as needed to comply with usage limits. Consider setting up alerts via n8n to notify you if the workflow fails.

9. FAQs

  • Q: Can I use Gmail instead of another IMAP server?
    A: Yes, Gmail supports IMAP and works well with this workflow. Just ensure you enable IMAP and create an app password if 2FA is enabled.
  • Q: Does using OpenRouter AI consume API credits?
    A: The selected llama-3.1-70b-instruct model is free, but check your OpenRouter account quota to avoid unexpected limits.
  • Q: Is my email content secure?
    A: Data is sent securely via HTTPS to OpenRouter and Line APIs. Avoid sharing sensitive data if concerned about privacy.
  • Q: Can I scale this to hundreds of emails daily?
    A: Yes, but consider API rate limits and possibly batch emails to optimize calls.

10. Conclusion

By following this guide, you’ve built an intelligent email summarization workflow using n8n, OpenRouter AI, and Line Messenger. You’ve transformed hours of tedious email reading into quick, insightful summaries delivered directly to your mobile device—saving precious time and reducing errors in task management.

Next, consider expanding this automation to classify emails by project, or integrate calendar alerts based on detected deadlines, or connect to task management apps to auto-create actionable to-dos from summaries.

With this workflow, you’re not just automating; you’re reclaiming your day.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free