n8n

How to Automate LINE AI Helpdesk with Text and Vision via OpenRouter?

Turn your LINE chat into a fast AI helper for customers. Messages are read in real time, then answered by an AI model. Text and images are both supported, so users get helpful replies without waiting for an agent.

Here is how it works. A webhook receives the LINE event and starts a loading animation so users know something is happening. A switch routes by message type. Text goes to an AI text model through OpenRouter. Images are fetched from LINE, converted to base64, and sent to a vision model for analysis. The result is sent back through the LINE reply API. If the content type is not supported, a clear response is returned.

Setup needs a LINE Messaging API channel and an OpenRouter API key. Add the webhook URL in your LINE console and connect both services in n8n. Expect faster first response times and fewer tickets for your team. Use it for FAQs, simple troubleshooting with photos, and order updates from chat screenshots. Most small teams can get value on day one.

What are the key features?

  • Webhook capture of LINE events to start the flow instantly
  • Loading animation start so users see that processing has begun
  • Switch routing that separates text, image, and other message types
  • Image fetch from LINE content API and safe file extraction
  • Base64 conversion of images for vision model prompts
  • AI text replies via OpenRouter with a large instruction model
  • AI image understanding via OpenRouter vision model
  • Direct LINE reply for text and image responses with proper tokens
  • Fallback replies for unsupported message types

What are the benefits?

  • Reduce first response time from minutes to under 1 minute
  • Automate up to 70 percent of common chat questions
  • Handle 5 times more chats without adding agents
  • Give clear feedback to users with a live loading indicator
  • Support both text and image messages in one flow

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 LINE Messaging API and OpenRouter. See the Tools Required section above for links to create accounts with these services.
  3. In the LINE Developers Console, create or open your Messaging API channel. Enable the webhook feature. Copy the Webhook URL from the n8n Webhook node and paste it into the LINE console. For production, remove any test path if noted.
  4. In n8n, open the Credentials manager. Create a new HTTP Header Auth credential for LINE. Add an Authorization header with value Bearer YOUR_CHANNEL_ACCESS_TOKEN. Save and select this credential on all LINE HTTP Request nodes.
  5. Double click the Webhook node. Note the path and URL. Ensure the HTTP method is POST. Use the full URL in LINE so events reach n8n.
  6. Open the Line Loading Animation node. Ensure the method is POST and the body includes chatId and loadingSeconds. Select your LINE credential so the call is authorized.
  7. Create an OpenRouter API key in your OpenRouter account. In n8n Credentials, create a new HTTP Header Auth credential for OpenRouter with Authorization: Bearer YOUR_OPENROUTER_KEY.
  8. Open both OpenRouter HTTP Request nodes. Choose the OpenRouter credential you created. Keep the model settings as provided or adjust to your needs.
  9. Open the Get Image node. Confirm it calls the LINE content API using the message id from the incoming event. Set the response to return binary data so the next node can extract it.
  10. Open the Extract from File node. Ensure it converts the binary image into base64 so it can be sent as an image prompt to the vision model.
  11. Check the Switch node rules. Make sure text messages route to the text AI path and image messages route to the image path. Leave other types to the not supported replies.
  12. Test with your LINE account. Send a text message and confirm you see the loading animation and then a reply. Send a photo or screenshot and confirm you get an image based answer.
  13. Troubleshoot common issues: 401 errors mean your token is wrong. 400 errors on reply usually mean an expired or wrong reply token. If images fail, confirm the message id is correct and the Get Image node returns binary data.

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.

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.