From 75e4ff12bfdecb090363bb7b5824affe795f30b5 Mon Sep 17 00:00:00 2001 From: Sam Rolfe Date: Thu, 15 Oct 2026 19:53:43 +1100 Subject: [PATCH] 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 --- deploy/n8n-morning-brief.json | 1 + docs/phase-7a-n8n-schedule.md | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/deploy/n8n-morning-brief.json b/deploy/n8n-morning-brief.json index 489ff26..6022115 100644 --- a/deploy/n8n-morning-brief.json +++ b/deploy/n8n-morning-brief.json @@ -1,4 +1,5 @@ { + "id": "schoolMorningBrf", "name": "Compass / NHS — 6:00am morning brief", "nodes": [ { diff --git a/docs/phase-7a-n8n-schedule.md b/docs/phase-7a-n8n-schedule.md index f0dabfa..c56b68c 100644 --- a/docs/phase-7a-n8n-schedule.md +++ b/docs/phase-7a-n8n-schedule.md @@ -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 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 ```bash