❓ Question: How to access uploaded file (e.g., Markdown) in custom OpenWebUI pipe() for n8n integration?

:puzzle_piece: 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.


:white_check_mark: Current Flow:

  • User uploads a .md file through the OpenWebUI chat interface.
  • User adds a short instruction like “Please analyze this file.”
  • The custom pipe() function reads the content from body["messages"] and sends it to n8n via POST request.

:cross_mark: 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.


:gear: 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
}

:magnifying_glass_tilted_left: 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.


:pushpin: 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_url in JSON
  • Observation: No "files" field appears in body["messages"] despite successful upload

:folded_hands: Questions:

  1. Has anyone successfully accessed uploaded files via a custom pipe() in OpenWebUI?
  2. Is there a reason why "files" field is not passed to the pipeline function?
  3. How can I retrieve the uploaded file URL in the pipe() logic without modifying global configs?
  4. 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

I believe this issue is not belong to n8n, should ask expert in OpenWebUI community.

Here is a work around solution for your reference,
All uploads file will be stored into /openwebui/uploads
I use n8n watch this folder, when file change , then get files to n8n

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.