What this workflow does
This workflow reads emails automatically from your inbox using IMAP and summarizes them using an AI model from Openrouter AI.
It finds urgent emails and deadlines, makes important dates bold, and sends the summary to LINE messenger.
The goal is to save time daily by showing only key info and reminders on LINE.
Who should use this workflow
The workflow helps busy people with many emails who want quick summaries and alerts on urgent tasks.
It suits project managers or anyone who checks emails on mobile often and needs to avoid missing deadlines.
Tools and services used
- IMAP Email: To automatically read emails from inboxes like Gmail.
- Openrouter AI API: Applies the “meta-llama/llama-3.1-70b-instruct” model for email summarization.
- LINE Messaging API: Sends summarized messages to LINE messenger app.
- n8n automation platform: Manages workflow nodes and connections.
Inputs, processing, and outputs
Inputs
- Email data: sender, subject, full email content via IMAP node.
- API keys: Access tokens for Openrouter AI and LINE Messaging API.
Processing steps
- First, the IMAP email node reads new emails without marking them read.
- Next, an HTTP Request node sends email content to Openrouter AI for summarization using a specific prompt.
- The prompt instructs the AI to highlight urgent deadlines with bold text and emojis and keep unimportant mails very short.
- Then, a second HTTP Request node sends the AI summary text to LINE messenger using the LINE API and user ID.
Outputs
- A message sent to LINE messenger app with a clear, short summary of each email.
- Deadlines in bold with urgency emoji for quick attention.
Beginner step-by-step: How to use this workflow in n8n
1. Import the workflow
- Click the Download button on this page to get the workflow file.
- Open the n8n editor where you want to run automation.
- Use the “Import from File” option in n8n to load the workflow.
2. Configure credentials and IDs
- Add your IMAP email account credentials inside the IMAP Email node.
- Enter your Openrouter.ai API key in the HTTP Request node that summarizes emails.
- Update the LINE user ID and put your LINE channel access token in the second HTTP Request node to send messages.
- Check and change email folders if needed.
3. Test the workflow
- Run the workflow once manually in n8n.
- Check if emails are read, summaries are created, and LINE messages arrive.
4. Activate workflow for production
- Switch the workflow toggle in n8n to active.
- Set a schedule trigger if automatic polling is needed.
- Make sure the environment where n8n runs has internet access for API and email server calls.
- If self hosting n8n, see self-host n8n resources for setup help.
Customization ideas
- Change AI model: Edit model name in the Openrouter AI node to something like “gpt-4o” for different summarizations.
- Adjust summary prompts: Update the text in HTTP Request node’s JSON body to make summaries longer, shorter, or more detailed.
- Filter emails before summarization: Insert a Function node to let only important senders or keywords pass.
- Send summaries to multiple LINE users: Add more user IDs or split messages by groups.
Possible issues and how to fix
401 Unauthorized on AI or LINE API nodes
Check API keys include “Bearer ” prefix in Authorization header.
Verify the keys are correct and active.
IMAP node reads no emails
Make sure IMAP is enabled in your email settings.
Check credentials and test connection manually.
Summaries are too short or irrelevant
Improve the AI prompt instructions.
Make it clearer what info should be summarized or highlighted.
Summary of benefits
✓ Saves 90 minutes daily by automating email reading and summaries.
✓ Shows urgent deadlines clearly with bold and emoji marks.
✓ Sends useful reminders directly to LINE messenger for easy mobile access.
✓ Reduces risk of missing tasks or deadlines.
✓ Easy to customize for different AI models or messaging recipients.
