docs(n8n): version school intake workflow artifacts

This commit is contained in:
Fizzlepoof
2026-05-13 21:09:43 +00:00
parent 3269cc1fc5
commit f6482abcd6
4 changed files with 45 additions and 13 deletions

View File

@@ -1,13 +1,22 @@
# School Paperless Intake Workflow
Workflows:
- `n8n-workflows/18-school-paperless-intake.json`
- `n8n-workflows/19-paperless-school-metadata-enrichment.json`
Current workflow versions:
- `n8n-workflows/18-school-paperless-intake-v1.0.json`
- `n8n-workflows/19-paperless-school-metadata-enrichment-v1.0.json`
This workflow is meant for a Telegram chat-driven upload pipeline that sends schoolwork into Paperless-NGX while recording intake metadata in shared Postgres.
This workflow set is meant for a Telegram chat-driven upload pipeline that sends schoolwork into Paperless-NGX while recording intake metadata in shared Postgres.
## Versioning rule
When these workflow artifacts change, the version must change too:
- the filename keeps a `-vX.Y` suffix
- the internal n8n workflow `name` also carries the same version
- docs and testing notes should reference the current version explicitly
## What it does
### Workflow 18 — v1.0
1. Accepts a multipart upload at `POST /webhook/school/intake/upload`
2. Requires form fields:
- `class_name`
@@ -46,6 +55,10 @@ PAPERLESS_DOCUMENT_TYPE_SCHOOL=
PAPERLESS_TAG_SCHOOL=
PAPERLESS_TAG_ASSIGNMENTS=
PAPERLESS_TAG_TELEGRAM=
PAPERLESS_TAG_CLASS_MAP_JSON={}
PAPERLESS_TAG_SUBMISSION_KIND_MAP_JSON={}
PAPERLESS_DOCUMENT_TYPE_PAPER_KIND_MAP_JSON={}
PAPERLESS_CORRESPONDENT_CLASS_MAP_JSON={}
NODE_FUNCTION_ALLOW_BUILTIN=crypto
```
@@ -59,12 +72,17 @@ Add to the `n8n` service `environment:` block in `automation/docker-compose.yaml
PAPERLESS_TAG_SCHOOL: ${PAPERLESS_TAG_SCHOOL}
PAPERLESS_TAG_ASSIGNMENTS: ${PAPERLESS_TAG_ASSIGNMENTS}
PAPERLESS_TAG_TELEGRAM: ${PAPERLESS_TAG_TELEGRAM}
PAPERLESS_TAG_CLASS_MAP_JSON: ${PAPERLESS_TAG_CLASS_MAP_JSON}
PAPERLESS_TAG_SUBMISSION_KIND_MAP_JSON: ${PAPERLESS_TAG_SUBMISSION_KIND_MAP_JSON}
PAPERLESS_DOCUMENT_TYPE_PAPER_KIND_MAP_JSON: ${PAPERLESS_DOCUMENT_TYPE_PAPER_KIND_MAP_JSON}
PAPERLESS_CORRESPONDENT_CLASS_MAP_JSON: ${PAPERLESS_CORRESPONDENT_CLASS_MAP_JSON}
NODE_FUNCTION_ALLOW_BUILTIN: crypto
```
Notes:
- `PAPERLESS_CORRESPONDENT_SCHOOL` and `PAPERLESS_DOCUMENT_TYPE_SCHOOL` should be numeric IDs if you want those fields auto-assigned.
- Leave optional Paperless IDs blank if you prefer Paperless rules to classify later.
- `PAPERLESS_TAG_CLASS_MAP_JSON`, `PAPERLESS_TAG_SUBMISSION_KIND_MAP_JSON`, `PAPERLESS_DOCUMENT_TYPE_PAPER_KIND_MAP_JSON`, and `PAPERLESS_CORRESPONDENT_CLASS_MAP_JSON` are optional JSON maps used by workflow 19.
- Leave optional Paperless IDs and JSON maps blank/default if you prefer to start with deterministic title + generic tags only.
- `NODE_FUNCTION_ALLOW_BUILTIN=crypto` is required because the Code node hashes the uploaded file.
- `N8N_BLOCK_ENV_ACCESS_IN_NODE` must remain `false`.
@@ -80,6 +98,8 @@ Workflow 18 deliberately keeps the Paperless upload minimal and safe:
The deterministic filename/title preserve the `intake_id` for later correlation.
### Workflow 19 — v1.0
Workflow 19 handles the follow-up metadata pass after Paperless finishes processing:
- fetch Paperless document by webhook document id
- resolve `intake_id` from the stored filename