Phase 7a: stable workflow id for the n8n import (AUD-115)

n8n 2.18.5 rejects an import whose workflow JSON has no `id`
(SQLITE_CONSTRAINT: NOT NULL constraint failed: workflow_entity.id). Give the
workflow a fixed id and record that the import -> publish -> active flow was
rehearsed in a throwaway n8n container before asking for approval.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-10-15 19:53:43 +11:00
parent 7d367f7712
commit 75e4ff12bf
2 changed files with 11 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
{ {
"id": "schoolMorningBrf",
"name": "Compass / NHS — 6:00am morning brief", "name": "Compass / NHS — 6:00am morning brief",
"nodes": [ "nodes": [
{ {

View File

@@ -70,6 +70,16 @@ The script copies the JSON into the container with `docker exec -i … sh -c 'ca
`update:workflow --active`), restarts n8n once so the 06:00 schedule registers, and `update:workflow --active`), restarts n8n once so the 06:00 schedule registers, and
prints `n8n list:workflow --active=true`. prints `n8n list:workflow --active=true`.
The JSON carries a stable `id` (`schoolMorningBrf`). n8n 2.18.5 refuses an import
whose workflow has no `id` (`SQLITE_CONSTRAINT: NOT NULL constraint failed:
workflow_entity.id`), so the id is required, not cosmetic. Re-importing the same file
updates the same workflow instead of adding a second copy.
`n8n publish:workflow` prints *"Changes will not take effect if n8n is running"*, which
is why the import script restarts n8n once. The full import → publish → active check
was rehearsed in a throwaway n8n container with a temporary data directory before this
plan was proposed; no shared instance was touched.
## Verification ## Verification
```bash ```bash