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¶
- Ingestion: Physical scan via mobile app or scanner reaches the
Nextcloud/Scansfolder. - Processing: Syncthing moves the file to the Paperless consumption directory.
- Understanding: Paperless performs OCR and classifies the document. If it detects a keyword like "Invoice" or "Due", it adds the tag
action-required. - Trigger: n8n monitors Paperless via webhook for the
action-requiredtag. - Reasoning: n8n sends the OCR text to the LLM using the Extraction and Classification Prompt.
- Action: n8n creates a task in Vikunja with a title, description, and due date.
- 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-confidencein Paperless; manual review required.
- Recovery: Document is tagged
- 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