Background
Two upsert variants exist in MDL:
CREATE OR MODIFY — updates the existing document in-place, preserving its UUID/ID. References from other documents (navigation, microflow calls, page references) remain intact.
CREATE OR REPLACE — deletes the existing document and creates a new one with a fresh UUID. This silently breaks any in-project reference to the old UUID.
Problem
CREATE OR REPLACE is actively unsafe for any document that is referenced from elsewhere in the project. A page replaced this way gets a new ID; any microflow with a show page action targeting the old ID becomes a dangling reference that only surfaces when Studio Pro opens the file.
Additionally, the error message on plain CREATE MICROFLOW currently reads:
microflow 'Module.Name' already exists (use create or replace to overwrite)
This steers users toward the unsafe variant. Microflows don't even have CREATE OR REPLACE syntax — only CREATE OR MODIFY — so the message is both misleading and wrong.
Proposed change
- Standardise on
CREATE OR MODIFY as the idempotent upsert for all document types. Where a type currently only has CREATE OR REPLACE (JSON structure, image collection, published REST service, business event service), add CREATE OR MODIFY and consider deprecating OR REPLACE.
- Fix the error message in
cmd_microflows_create.go to say use create or modify to overwrite instead of use create or replace.
- Document the distinction in MDL_QUICK_REFERENCE.md and the relevant skill files:
OR MODIFY preserves UUID (safe for referenced documents), OR REPLACE does not (avoid unless the document is guaranteed unreferenced).
Affected files
mdl/executor/cmd_microflows_create.go — misleading error message (line ~73)
- Grammar and executor for types that only have
OR REPLACE: JSON structure, image collection, published REST service, business event service
docs/01-project/MDL_QUICK_REFERENCE.md
Background
Two upsert variants exist in MDL:
CREATE OR MODIFY— updates the existing document in-place, preserving its UUID/ID. References from other documents (navigation, microflow calls, page references) remain intact.CREATE OR REPLACE— deletes the existing document and creates a new one with a fresh UUID. This silently breaks any in-project reference to the old UUID.Problem
CREATE OR REPLACEis actively unsafe for any document that is referenced from elsewhere in the project. A page replaced this way gets a new ID; any microflow with ashow pageaction targeting the old ID becomes a dangling reference that only surfaces when Studio Pro opens the file.Additionally, the error message on plain
CREATE MICROFLOWcurrently reads:This steers users toward the unsafe variant. Microflows don't even have
CREATE OR REPLACEsyntax — onlyCREATE OR MODIFY— so the message is both misleading and wrong.Proposed change
CREATE OR MODIFYas the idempotent upsert for all document types. Where a type currently only hasCREATE OR REPLACE(JSON structure, image collection, published REST service, business event service), addCREATE OR MODIFYand consider deprecatingOR REPLACE.cmd_microflows_create.goto sayuse create or modify to overwriteinstead ofuse create or replace.OR MODIFYpreserves UUID (safe for referenced documents),OR REPLACEdoes not (avoid unless the document is guaranteed unreferenced).Affected files
mdl/executor/cmd_microflows_create.go— misleading error message (line ~73)OR REPLACE: JSON structure, image collection, published REST service, business event servicedocs/01-project/MDL_QUICK_REFERENCE.md