Paperless-ngx, n8n and Ollama: document tagging setup
Learn how n8n connects Paperless-ngx to Ollama with gpt-oss:20b to assign document metadata, and why the demo needs safer credential handling.
Player not loading? Watch on YouTube
This tutorial builds a self-hosted document classification workflow with Paperless-ngx, n8n and Ollama. The speaker demonstrates automatic titles and classification with a fictional utility bill and laboratory report, then explains the workflow behind those results. The example uses gpt-oss:20b as its local LLM.
A Paperless-ngx workflow sends a webhook when a document arrives. n8n extracts the document ID from its URL, retrieves the full text and metadata through the API, and fetches the available tags and document types. It passes that data to the model, then applies the returned title, tags and document type through an HTTP PATCH request.
The prompt restricts classification to existing entries and permits empty selections when nothing fits. It also requests strictly JSON output so later nodes can process the response. The speaker uses examples to explain category boundaries, including why letter attachments should not automatically count as correspondence.
The setup assumes a running Paperless-ngx instance, n8n and an AI server. The speaker suggests a computer with a powerful graphics card, a Mac Mini or a Mac Studio; n8n and Paperless-ngx must be able to reach each other. The downloadable workflow is a demo with a hardcoded API key. The speaker explicitly says it needs appropriate authorization handling before production use.