Overview
This node integrates with an OpenWebUI Large Language Model (LLM) API to send chat messages and optionally attach files or knowledge base collections. It supports different API path styles and allows users to select a model exposed by their OpenWebUI instance. The node sends a user message to the selected model and returns either a short assistant reply or the full API response.
Common scenarios include:
- Automating conversational AI workflows using custom or self-hosted LLMs.
- Enhancing chatbots with additional context from knowledge base collections.
- Uploading and referencing binary files (e.g., documents, images) in conversations for richer interactions.
Practical example:
- A user uploads a PDF file as binary data, adds it to a knowledge collection, and queries the LLM about its content. The node uploads the file, attaches the collection, sends the user’s question, and returns the model’s answer.
Properties
| Name | Meaning |
|---|---|
| API Style | Which API path style to use for chat and models. Options: Auto (detect at runtime), OpenAI V1 (/v1), OpenWebUI Legacy (/api). |
| Model Name or ID | Select the model to use from those exposed by your OpenWebUI instance. You can pick from a list or specify an ID via expression. |
| User Message | The text message you want to send to the model. |
| Return | Choose whether to return only the assistant's text reply ("Short") or the full API response object ("Full Response"). |
| Knowledge Collection (Optional) Name or ID | Attach a knowledge base collection to the chat to provide additional context. Pick from a list or specify an ID via expression. |
| If a Binary Is Provided and a Collection Is Selected | Defines behavior when both a binary file and a knowledge collection are provided: "Add File to the Collection and Use the Collection" (uploads the file into the collection and references it) or "Do Not Upload; Just Use the Collection" (ignores the binary upload). |
| Binary Property (Optional) | Name of the binary property on the input item to upload. If a collection is selected and behavior is "Add & Use," the file will be uploaded into that collection. |
Output
The node outputs JSON data with the following structure depending on the "Return" mode:
Short mode (default):
{ "content": "Assistant's reply text", "finish_reason": "reason for completion end", "model": "model identifier used", "usage": { /* token usage details if available */ } }This output contains the assistant's textual response extracted from the API result along with metadata like finish reason and usage.
Full Response mode:
Outputs the entire JSON response returned by the OpenWebUI API without modification.
If binary data is provided and uploaded, it is handled internally and not directly outputted by the node.
Dependencies
- Requires an API key credential for authenticating with the OpenWebUI API.
- Needs the base URL of the OpenWebUI instance.
- Uses HTTP requests to interact with OpenWebUI endpoints for models, chat completions, file uploads, and knowledge collections.
- The node dynamically detects or uses configured API path styles (
/v1or/api) based on user selection or runtime detection.
Troubleshooting
Binary property not found error:
Occurs if the specified binary property name does not exist on the input item. Verify the binary property name matches exactly and that the input item contains binary data.No models found error:
Happens if the node cannot retrieve any models from the OpenWebUI API. Check the API base URL, ensure the API key is valid, and confirm the OpenWebUI server is accessible.Upload succeeded but no file id returned:
Indicates the file upload endpoint responded successfully but did not return a file ID. This may be due to API changes or misconfiguration. Verify the OpenWebUI version and API compatibility.Chat endpoint not found:
The node tries multiple fallback URLs if the primary chat endpoint returns 404 or 405. If all fail, this error is thrown. Confirm the OpenWebUI API paths and versions supported.General HTTP errors:
Network issues, invalid credentials, or server errors will cause HTTP request failures. Review error messages and verify connectivity and authentication.
Links and References
- OpenWebUI Documentation (replace with actual URL)
- n8n Expressions Documentation
- OpenAI Chat Completions API Spec (for reference on API style v1)