by suphachok · v0.9.7
Connect any Dify app to LINE Official Account
This community listing does not yet include every recommended support, privacy, pricing, and permission disclosure. Review the available package permissions before installing.
Available inside your emploidai workspace after installation.
Available inside your emploidai workspace after installation.
Dify Endpoint Plugin — Connect any Dify chatbot or agent app to a LINE Official Account in minutes.
LINE Connect bridges LINE Messaging API and Dify's chat API. Users chat on LINE; your Dify app answers automatically — with full conversation persistence, image/file support, and a built-in admin dashboard.
Webhook (POST)
LINE User ──message──> LINE Platform ──────────> LINE Connect Plugin
|
Dify Chat API
(stream/block)
|
LINE User <──reply──── LINE Platform <────────── LINE Connect Plugin
|
Admin Dashboard (GET)
Browser UI
Overview of your LINE Connect workspace — total conversations, active users, message activity chart, and system status at a glance.
Real-time chat view with message history, bot toggle, tags, notes, and unread indicators.
Message volume trends, response time distribution, user growth, and peak hours heatmap.
Quick reply templates, tag management, bot schedule, broadcast messaging, and storage info.
| Feature | Description |
|---|---|
| Two-way messaging | Receive LINE messages, forward to Dify, reply automatically |
| Image support | Users send images via LINE — uploaded to Dify as file variables for vision models |
| File support | Video, audio, and documents are uploaded and forwarded to Dify |
| Image debounce | Batch multiple images into a single Dify call (configurable delay) |
| Display name forwarding | Inject LINE user's display name as a Dify input variable |
| Markdown to FlexMessage | Render bot replies as rich FlexMessage bubbles with headings, bold, lists, tables, blockquotes |
| Conversation persistence | Each user/group gets a unique Dify conversation ID |
| Group & room chat | Works in 1:1, group, and multi-party room chats |
| Streaming with fallback | Stream-first with automatic blocking fallback for reliability |
| Multi-endpoint isolation | Each endpoint has its own isolated storage — fully separated |
| Admin dashboard | Password-protected web UI for managing all conversations |
| Analytics | Message volume, user growth, response time charts with daily breakdown |
| Typing indicator | Animated dots in dashboard while bot is processing |
| Unread badges | Per-chat unread count with visual indicators |
| Chat management | Custom names, tags, starred chats, notes, search |
| Broadcast | Send messages to all or starred conversations |
| Schedule | Working hours configuration with per-chat override |
| Scalable | Optimized for 1,000+ users with cached index lookups |
| Requirement | Details |
|---|---|
| Dify | v0.7.0+ with plugin support enabled |
| LINE | A LINE Official Account with Messaging API channel |
| Dify App | A published Chatbot or Agent app with an API key |
app-...)..difypkg file (download from Releases).
| Setting | Required | Default | Description |
|---|---|---|---|
| Endpoint Name | Yes | — | A name for this endpoint (e.g. BOT) |
| Channel Secret | Yes | — | LINE Developers > Basic settings |
| Channel Access Token | Yes | — | LINE Developers > Messaging API |
| Dify App API Key | Yes | — | Your Dify app's API key (app-...) |
| Admin Dashboard Password | Yes | — | Password to access the admin web UI |
| Dify API URL | No | https://api.dify.ai/v1 | Change for self-hosted Dify (e.g. http://api:5001/v1) |
| Pass LINE Display Name | No | True | Forward user's LINE name as an input variable |
| Display Name Variable | No | displayName | Variable name for the display name in your Dify app |
| Enable Image Support | No | False | Accept images and files from LINE |
| Image Variable Name | No | img | Variable name for uploaded images in your Dify app |
| Image Prompt | No | User sent an image | Query text sent to Dify when user sends an image |
| Image Debounce (seconds) | No | 0 | Wait time to batch multiple images (0 = disabled, recommended: 3) |
| Markdown to FlexMessage | No | False | Render replies as rich FlexMessage bubbles |
| Strip Markdown | No | True | Remove markdown formatting from bot replies |
| Debug Mode | No | False | Show error details in LINE replies (for development only) |
| Welcome Message | No | Welcome!... | Message sent when a user adds the bot as friend |
| Max Stored Media | No | 200 | Max media files kept for admin preview |
| Max Media Storage (MB) | No | 800 | Max total size for stored media in MB |
After installing, Dify shows the endpoint URLs:
Open the GET endpoint URL in your browser:
Enter the admin password you configured in Step 3 to access the dashboard.
| LINE Message | Behavior | Dify Variable |
|---|---|---|
| Text | Forwarded as query | — |
| Image | Uploaded and forwarded | img (configurable) |
| Video | Uploaded and forwarded | files |
| Audio | Uploaded and forwarded | files |
| File | Uploaded and forwarded | files |
| Sticker | Ignored silently | — |
When a user sends multiple images at once, each arrives as a separate webhook event. Without debounce, the bot responds to each individually:
Without debounce (0): With debounce (3):
Image 1 --> Bot reply 1 Image 1 --> queued
Image 2 --> Bot reply 2 Image 2 --> queued
Image 3 --> Bot reply 3 Image 3 --> wait 3s --> Bot reply (all 3)
Set Image Debounce to 3 seconds for the best experience with multi-image uploads.
| Command | Action |
|---|---|
/clear | Reset conversation and start fresh |
/reset | Same as /clear |
/new | Same as /clear |
1. Stream + conversation_id (fastest, preserves context)
2. Blocking + conversation_id (different transport, same context)
3. Stream + new conversation (only if conversation_id seems stale)
4. Blocking + new conversation (final fallback)
All storage keys are namespaced per endpoint using a hash of the Channel Secret, so multiple endpoints in the same plugin installation are fully isolated.
| Key Pattern | Data | Limit |
|---|---|---|
{ns}_lc_{userId/groupId} | Dify conversation ID | 1 per chat |
hist_{ns}_lc_{...} | Chat message history | 100 messages |
{ns}_cidx | Index of all conversations | 1,000 entries |
img_{messageId} | Stored media files | configurable (default: 200 files / 800 MB) |
off_{ns}_lc_{...} | Bot disabled flag | 1 per chat |
Total plugin storage quota: 1 GB
| Problem | Solution |
|---|---|
| Bot doesn't reply | Check webhook URL is correct and "Use webhook" is enabled in LINE settings |
401 error in webhook | Verify Channel Secret and Channel Access Token are correct |
| Images not working | Enable "Image Support" in settings and add a file input variable in your Dify app |
| Bot replies multiple times for images | Set Image Debounce to 3 seconds |
| Admin dashboard won't load | Use the GET endpoint URL (not the POST webhook URL) |
| Bot not responding in group chat | Make sure the bot is invited to the group and has permission to read messages |
| Conversation seems to reset | Check Dify app logs — the conversation ID may have expired or been invalidated |
See CHANGELOG.md for the full release history.
suphachok — @DomT00T