Skip to content

Playbook: Scan to Task

Objective

Convert physical documents (mail, receipts) into actionable tasks in the task manager.

Workflow Architecture

flowchart TD
    A[Physical Document] -->|Scan| B(Nextcloud/Scans)
    B -->|Syncthing| C(Paperless-ngx Consumption)
    C -->|OCR & Classification| D{Action Required?}
    D -- Yes --> E[n8n Webhook Trigger]
    D -- No --> F[Archive]
    E -->|Extraction| G[LLM Processing]
    G -->|Create Task| H[Vikunja Task]
    H -->|Link Back| C

Pre-requisites

Step-by-Step Flow

  1. Ingestion: Physical scan via mobile app or scanner reaches the Nextcloud/Scans folder.
  2. Processing: Syncthing moves the file to the Paperless consumption directory.
  3. Understanding: Paperless performs OCR and classifies the document. If it detects a keyword like "Invoice" or "Due", it adds the tag action-required.
  4. Trigger: n8n monitors Paperless via webhook for the action-required tag.
  5. Reasoning: n8n sends the OCR text to the LLM using the Extraction and Classification Prompt.
  6. Action: n8n creates a task in Vikunja with a title, description, and due date.
  7. Linking: The Vikunja task description includes a direct link to the Paperless document.

Data Contract

Field Type Format Notes
task_title String Plain Text Max 100 chars
due_date Date YYYY-MM-DD Optional
paperless_link URL String Internal ID

Failure Modes & Recovery

  • OCR Failure: Text is garbled or unreadable.
    • Recovery: Document is tagged low-confidence in Paperless; manual review required.
  • Task Duplicate:
    • Recovery: n8n checks Vikunja for existing tasks with similar names/dates before creating.

Local LLM Optimization

For users preferring a privacy-first approach, local LLMs can replace cloud-based providers in the Reasoning step. - Recommended Model: Qwen3-Coder-Next (via Ollama) provides high-precision extraction for structured administrative data. - Hardware: Requires at least 16GB VRAM for optimal performance.

Token-Efficiency Guidance

  • Preprocessing: Strip unnecessary whitespace and common OCR noise (e.g., repeating header/footer patterns) before sending text to the LLM.
  • Prompting: Use concise system prompts and request only the required JSON fields to minimize output tokens.
  • Task Batching: If processing multiple small receipts, batch them into a single LLM call where possible to reduce per-document overhead.

Variants

  • Manual Intake: User manually uploads a PDF to Paperless and applies the tag.
  • Email Forward: User forwards an email to the intake address.

Contribution Metadata

  • Confidence: high
  • Last reviewed: 2026-03-01

Sources / References

  • https://github.com/joanmarcriera/Home-office-automations