Description
n8n-nodes-weknora
An n8n community node for WeKnora. It provides native operations for knowledge-base management, document ingestion, retrieval, sessions, and RAG chat without requiring HTTP Request or Code nodes.

> ⭐ If this node is useful to you, please give the project a star on GitHub. Your support helps more n8n and WeKnora users discover it.
>
> 如果这个节点对你有帮助,欢迎前往 GitHub 仓库点个 Star。你的支持能帮助更多 n8n 和 WeKnora 用户发现这个项目。
Features
- Store the WeKnora URL and API key in an n8n credential.
- Upload n8n binary data as a WeKnora knowledge file.
- Import a URL or create Markdown knowledge.
- Read parse status and reparse failed knowledge.
- Search one or more knowledge bases and emit one n8n item per hit.
- Create sessions and ask grounded RAG questions.
- Parse WeKnora SSE responses, combine answer tokens, and clean inline reference markers.
- No runtime npm dependencies.
Installation
n8n Community Nodes UI
Open Settings > Community Nodes, choose Install, and enter:
n8n-nodes-weknora
Unverified community nodes require a self-hosted n8n instance that allows their installation. After the package is verified, it can also be installed through the verified-node flow.
Manual self-hosted installation
From the n8n user directory:
npm install n8n-nodes-weknora
Restart n8n after installation.
Credential
Create a WeKnora API credential with:
| Field | Example |
| ——– | —————————- |
| Base URL | http://weknora:8080/api/v1 |
| API Key | sk-... |
The base URL must be reachable from the n8n runtime. In Docker, localhost refers to the n8n container itself; use the WeKnora service name when both applications share a Docker network.
The credential sends X-API-Key and tests the connection by listing one knowledge base. Each node request also includes an X-Request-ID derived from the n8n execution ID.
Operations
Knowledge Base
Additional Fields JSON.Knowledge
parse_status.id is its Knowledge ID and can be used to scope Search or Ask to specific files.WeKnora parses uploads asynchronously. An accepted upload is not immediately searchable. Use Knowledge > Get in a loop with an n8n Wait node until parse_status is completed; stop on failed or cancelled.
Search
Search Knowledge calls /knowledge-search and returns each retrieved chunk as a separate n8n item. Knowledge-base and knowledge IDs accept comma- or newline-separated values. Knowledge IDs are optional file-level filters; leave them empty to search every file in the selected knowledge bases.
Session
Create creates a WeKnora conversation container and returns its ID.
Chat
Ask calls /knowledge-chat/:session_id and consumes the SSE response as a live stream. Node version 2 offers three session-handling modes:
sessionId, to a WeKnora session in the Ask node’s n8n static data. A missing or deleted WeKnora session is recreated once after a 404 response.Automatic memory always applies a configurable finite limit for the current workflow, Ask node, and credential. After every successful Ask, the node refreshes the current mapping and evicts the least-recently-used mappings until the limit is satisfied. Remote WeKnora session deletion is optional, and cleanup failures are returned as warnings without discarding the chat answer or undoing the local eviction. No Data Table or additional workflow node is required.
Existing version 1 nodes keep their original behavior. Upgrade the node to version 2 in the n8n editor to use automatic memory.
Inline WeKnora reference markers such as , , and [ref ...] are removed from the displayable answer.
Output fields include:
{
"output": "Clean answer without citation markers",
"answer": "Clean combined answer text",
"session_id": "session-id",
"session_created": false,
"session_reused": true,
"message_id": "message-id",
"event_count": 4
}
output is intentionally compatible with n8n Chat Trigger workflows.
Example workflows
examples/file-upload.json: n8n Form Trigger to WeKnora file ingestion.examples/rag-chat.json: n8n Chat Trigger to WeKnora RAG chat.After import, select a WeKnora credential and replace the placeholder knowledge-base ID.
API compatibility
The node follows the current WeKnora /api/v1 documentation:
When a deployed WeKnora version and the Markdown documentation differ, use that instance’s Swagger UI as the source of truth.
Development
Requirements: Node.js 22.22 or newer and npm.
npm install
npm run lint
npm test
npm run dev
npm test performs a production build and tests URL/ID/JSON helpers, multipart encoding, SSE aggregation, malformed events, errors, and reference deduplication.
Publishing
Before the first public release:
1. Confirm the repository metadata points to PatrickLee243/n8n-nodes-weknora.
2. Push this directory to a public GitHub repository.
3. Create the n8n-nodes-weknora package on npm or publish the first version.
4. Configure npm Trusted Publishing for .github/workflows/publish.yml.
5. Run npm run release and push the generated version tag.
6. Submit the package through the n8n Creator Portal if verified-node distribution is desired.
The included publish workflow uses GitHub Actions OIDC and npm provenance. A scoped NPM_TOKEN can be configured as a fallback.
Security
API keys remain in n8n credentials. Do not put API keys, private WeKnora URLs, or credential exports in example workflows or issue reports. See SECURITY.md.
License
MIT