Context:
I’m working on a custom Pipe implementation for OpenWebUI, where I forward user input to an external n8n webhook for processing. So far, sending plain chatInput text works fine — I get responses back from n8n as expected.
The Pipe is based on a known community structure (e.g. owndev/Open-WebUI-Functions). My OpenWebUI is deployed from source on Ubuntu, and the webhook and API communication are functioning correctly.
Current Flow:
- User uploads a
.mdfile through the OpenWebUI chat interface. - User adds a short instruction like “Please analyze this file.”
- The custom
pipe()function reads the content frombody["messages"]and sends it to n8n via POST request.
Problem:
Even when the user uploads a file, the data passed to the pipe() function contains no file info. Here’s what I see in /tmp/openwebui_pipe_debug.json:
json
复制编辑
{
"model": "archive",
"messages": [
{
"role": "user",
"content": "Please analyze this file"
}
],
"stream": false
}
There is no "files" field in the messages.
However, I can confirm the file was uploaded (I see the upload progress and filename in the chat UI), so the issue is not on the frontend.
Code Sample (Simplified):
python
for msg in body.get("messages", []):
if msg.get("role") == "user":
files = msg.get("files", []) # always returns empty
text_input = msg.get("content", "")
Then I build the payload like this:
python
payload = {
"chatInput": text_input,
"file_url": ??? # Can't extract uploaded file
}
What I Want to Achieve:
Without changing OpenWebUI’s global configuration or plugin structure, I want my pipe() function to receive uploaded file information like this:
json
复制编辑
{
"file_url": "http://<server>/data/uploads/filename.md",
"file_name": "example.md",
"file_type": "text/markdown"
}
Then pass this to my n8n webhook as part of the payload.
Additional Info:
- Environment: Ubuntu 20.04, Python 3.11, OpenWebUI (from source)
- Pipe Source: Based on
owndev/Open-WebUI-Functions - File Upload: Performed via OpenWebUI chat interface (user drag/drop or attachment)
- Webhook: Fully functional and tested — supports
file_urlin JSON - Observation: No
"files"field appears inbody["messages"]despite successful upload
Questions:
- Has anyone successfully accessed uploaded files via a custom
pipe()in OpenWebUI? - Is there a reason why
"files"field is not passed to the pipeline function? - How can I retrieve the uploaded file URL in the
pipe()logic without modifying global configs? - If possible, can someone share a working example that handles file input properly?
Thanks a lot in advance!
If you’ve built something similar (OpenWebUI + n8n + file analysis), I’d love to connect and learn from your experience. If this is a known limitation, I’m also happy to collaborate on improving it upstream.
Let me know if you want a markdown forum-ready version or want me to help you find the best place to post this (GitHub, Hugging Face, Discord