n8n

How to Automate IMAP to LINE Inbox Summaries?

Stay on top of email without living in your inbox. This setup reads your emails, creates a short AI summary, and sends it to your LINE chat so you can act fast. It works well for managers, founders, and busy teams who want clear updates on mobile.

Here is how it runs end to end. The IMAP email node pulls new mail from your inbox. The HTTP Request node sends the email text to an AI model on OpenRouter to condense it into simple notes and action items. Another HTTP Request node then posts the summary to the LINE Messaging API as a push message. Header auth with Bearer tokens secures both API calls. Newline characters are escaped so the message looks clean in chat. The result is a single, readable summary without opening your email app.

You will need IMAP access to your email, an OpenRouter API key, and a LINE channel access token. Set the Authorization header for both APIs and confirm the folder and filters in the IMAP node. Expect faster decisions, less context switching, and a clear daily update. It is useful for team inboxes, vendor updates, or announcements that must be seen right away.

What are the key features?

  • IMAP email reader fetches messages from your chosen folder
  • HTTP Request posts email text to OpenRouter chat completions for AI summaries
  • Bearer token header auth for both OpenRouter and LINE APIs
  • LINE push API sends a text message to a specific user ID
  • Expression replaces newline characters so the chat message keeps formatting
  • JSON request bodies keep prompts and outputs structured and stable
  • Works with any email provider that supports IMAP access

What are the benefits?

  • Reduce daily inbox review from 30 minutes to 5 minutes
  • Send one clear summary to LINE instead of dozens of emails
  • Cut context switching between email and chat by 80%
  • Connect IMAP email, OpenRouter, and LINE in one flow
  • Handle heavy email days with the same effort

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 IMAP Email, OpenRouter and LINE Messaging API. See the Tools Required section above for links to create accounts with these services.
  3. Set up IMAP access: double click the Read emails (IMAP) node, then on the Credential to connect with dropdown, click Create new credential and follow the on screen steps. Enter your IMAP server, port, username, password, and enable SSL or TLS if your provider requires it.
  4. Configure the IMAP node: choose the inbox folder, set any filters you need, and note that post process action is set to nothing so messages are left as is.
  5. Create an OpenRouter API key in your OpenRouter account. In the n8n credentials manager, create a new HTTP Header credential. Add a header named Authorization with value Bearer YOUR_API_KEY. Attach it to the Send email to A.I. to summarize node.
  6. Open the OpenRouter HTTP node and confirm URL https://openrouter.ai/api/v1/chat/completions with method POST and JSON body. Keep the model set to meta-llama/llama-3.1-70b-instruct:free and ensure the email content is passed into the messages field.
  7. In the LINE Developers console, create a Messaging API channel and copy the channel access token. In n8n, create another HTTP Header credential with Authorization set to Bearer YOUR_CHANNEL_ACCESS_TOKEN. Attach it to the Send summarized content to messenger node.
  8. Set the LINE push target: in the LINE HTTP node, replace the to field with your LINE user ID or a test user. Keep the messages array as type text and leave the text expression that reads the AI output and replaces newline characters.
  9. Run the workflow once to test. Check the execution data for the OpenRouter node to confirm a choices array with message content is returned.
  10. Send a test email to your inbox and run again. You should receive a LINE message with a clean, readable summary.
  11. Troubleshoot common errors: 401 from OpenRouter means the Authorization header or API key is wrong. 401 from LINE means the token is invalid or push messaging is not enabled. If no emails load, verify IMAP folder, credentials, and that IMAP is enabled in your email account.
  12. Refine the prompt in the OpenRouter JSON body if you want shorter or more action focused summaries.

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.

IMAP Email

Sign up

LINE Messaging API

Sign up

Free plan (Communication): $0 / mo, 500 messages / mo (USA/Other regions)

OpenRouter

Sign up

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

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.