{"record":{"id":"678a20150f171c5a","repo":"windmill-labs/windmill","slug":"missing-value-paste-a-whole-openflow-document","errorCode":null,"errorMessage":"missing 'value' - paste a whole OpenFlow document, not just its value","messagePattern":"missing 'value' - paste a whole OpenFlow document, not just its value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/flows/header/FlowYamlEditor.svelte","lineNumber":44,"sourceCode":"\tlet hasChanges = $derived(code !== initialCode)\n\n\tfunction reload() {\n\t\tcode = YAML.stringify(filteredContentForExport(flowStore.val))\n\t\tinitialCode = code\n\t\teditor?.setCode(code)\n\t}\n\n\t/** `value` is assigned unconditionally below and `FlowEditor` dereferences\n\t * `flowStore.val.value.modules`, so an OpenFlow document missing it takes the\n\t * whole editor down mid-render — after the toast has already claimed success.\n\t * Reject it up front instead. */\n\tfunction validateShape(parsed: unknown) {\n\t\tif (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {\n\t\t\tthrow new Error('the document must be a mapping (key: value)')\n\t\t}\n\t\tconst value = (parsed as Record<string, unknown>).value\n\t\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\t\tthrow new Error(\"missing 'value' - paste a whole OpenFlow document, not just its value\")\n\t\t}\n\t\tif (!Array.isArray((value as Record<string, unknown>).modules)) {\n\t\t\tthrow new Error(\"'value.modules' must be a list\")\n\t\t}\n\t}\n\n\tfunction validateGroups(groups: { start_id: string; end_id: string }[] | undefined) {\n\t\tif (!groups) return\n\t\tconst seen = new Set<string>()\n\t\tfor (const g of groups) {\n\t\t\tconst key = `${g.start_id}:${g.end_id}`\n\t\t\tif (seen.has(key)) {\n\t\t\t\tthrow new Error(`Duplicate group: '${g.start_id}' → '${g.end_id}'`)\n\t\t\t}\n\t\t\tseen.add(key)\n\t\t}\n\t}\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/flows/header/FlowYamlEditor.svelte#L26-L62","documentation":"validateShape in FlowYamlEditor.svelte parses the pasted YAML and enforces the OpenFlow document structure. The flow must be a top-level mapping containing a 'value' key whose content is itself a mapping (the actual flow body with 'modules', etc.). This error fires when the parsed YAML is missing 'value' or when 'value' is a scalar, null, or array instead of a mapping — typically because only the inner flow value was pasted.","triggerScenarios":"Calling apply() → validateShape() with YAML whose root has no 'value' key, or whose 'value' is a scalar/null/array instead of an object (e.g. pasting only the flow body, or a document that is a plain list of steps).","commonSituations":"User copies just the flow definition (steps/modules) from docs or another tool and pastes it into the YAML editor instead of the whole OpenFlow document including the 'summary' and 'value' wrapper; a hand-written YAML where 'value:' is indented wrong so it parses as a sibling key or string.","solutions":["Paste the complete OpenFlow document, wrapping the flow body under a top-level 'value:' key","Verify the YAML parses as an object: the root must be a mapping, not a list or scalar","Ensure 'value:' is at the root indentation level and its content is nested under it, not quoted as a string","Cross-check against a working flow exported from the UI (Download flow as YAML) and mimic its shape"],"exampleFix":"// before (only the flow body pasted)\nmodules:\n  - id: a\n    value:\n      type: rawscript\n// after (whole OpenFlow document)\nsummary: my flow\nvalue:\n  modules:\n    - id: a\n      value:\n        type: rawscript","handlingStrategy":"validation","validationCode":"const parsed = yaml.load(text)\nif (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed) || typeof parsed.value !== 'object' || parsed.value === null || Array.isArray(parsed.value)) {\n  alert('Paste a whole OpenFlow document (root must contain a \"value\" mapping)')\n} else {\n  editor.apply(parsed)\n}","typeGuard":"function isRecord(v: unknown): v is Record<string, unknown> {\n  return typeof v === 'object' && v !== null && !Array.isArray(v)\n}","tryCatchPattern":"try {\n  editor.apply(yamlText)\n} catch (e) {\n  if (e.message.includes(\"missing 'value'\")) {\n    sendUserToast('Paste the full OpenFlow document, not just the value section', true)\n  }\n}","preventionTips":["Always export YAML from a working flow and use it as a template","Keep 'value:' at the root indentation and nest the flow body under it","Paste the whole document including summary and value keys","Validate the YAML in a linter before pasting"],"tags":["yaml","validation","user-input"],"backgroundTag":"schema-validation-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}