feat: add paperless intake triage workflow

This commit is contained in:
Fizzlepoof
2026-05-13 03:38:31 +00:00
parent 30e01a9a09
commit 7fe24d1956
6 changed files with 522 additions and 0 deletions

View File

@@ -86,3 +86,22 @@ _Last updated: 2026-05-10_
| 07 | Hardcoded LiteLLM API key (working but tech debt) | Low |
| 15 | `includeData: false` means error messages show as "Unknown error" | Low |
| 09 v1.0 | Still active in n8n alongside v1.1 — should be deactivated | Low |
---
### 17 — Paperless Intake Triage → Doris Review Queue v1.0
**What it does:** Paperless post-consumption webhook → fetch document → LiteLLM strict JSON triage → enforce review-first safety gate → write sanitized Doris Dashboard queue JSON → optional urgent Gotify notification. Safe title-only Paperless update branch exists but is disabled unless `PAPERLESS_TRIAGE_APPLY_SAFE=true`.
**Local artifact checks completed:**
- [x] Workflow JSON validates with `python3 -m json.tool`
- [x] Fixture JSON files validate with `python3 -m json.tool`
- [x] Dashboard example queue JSON validates with `python3 -m json.tool`
**Pre-test checklist:**
- [ ] Paperless webhook configured to POST `https://n8n.paccoco.com/webhook/paperless/intake-triage`
- [ ] `PAPERLESS_API_TOKEN` and `LITELLM_API_KEY` exposed to n8n through env vars; no hardcoded secrets
- [ ] `NODE_FUNCTION_ALLOW_BUILTIN=fs,path` set for queue file writer
- [ ] n8n has a writeable mount to `doris-dashboard/data/paperless_review.json`
- [ ] `PAPERLESS_TRIAGE_APPLY_SAFE=false` during initial validation
**Test approach:** Upload a harmless test document to Paperless, POST `{"document_id": <id>}` to the webhook, and confirm `doris-dashboard/data/paperless_review.json` contains a sanitized review item. Use a bill/due-date fixture to verify forced human review.