{"record":{"id":"12bf00f4198b2de5","repo":"windmill-labs/windmill","slug":"invalid-flow-setting-path-issue-message","errorCode":null,"errorMessage":"Invalid flow setting ${path}: ${issue?.message ?? 'unknown error'}","messagePattern":"Invalid flow setting (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/flow/editableFlowJson.ts","lineNumber":362,"sourceCode":"\n\t// Reject unknown top-level keys: silently dropping them would make patch\n\t// tools report success for edits that never land on the flow.\n\tconst allowedKeys = new Set<string>([\n\t\t...EDITABLE_FLOW_STRUCTURAL_KEYS,\n\t\t...FLOW_VALUE_SETTINGS_KEYS\n\t])\n\tconst unknownKeys = Object.keys(flow).filter((key) => !allowedKeys.has(key))\n\tif (unknownKeys.length > 0) {\n\t\tthrow new Error(\n\t\t\t`Unknown top-level flow key(s): ${unknownKeys.join(', ')}. Allowed keys: ${[...allowedKeys].join(', ')}`\n\t\t)\n\t}\n\n\tconst settingsResult = flowValueSettingsSchema.safeParse(flow)\n\tif (!settingsResult.success) {\n\t\tconst issue = settingsResult.error.issues[0]\n\t\tconst path = issue?.path?.join('.') ?? 'settings'\n\t\tthrow new Error(`Invalid flow setting ${path}: ${issue?.message ?? 'unknown error'}`)\n\t}\n\tconst settings = pickFlowValueSettings(settingsResult.data)\n\n\tconst modules = validateFlowModules(flow.modules, ctx)\n\tconst schema = validateFlowSchema(flow.schema)\n\tconst preprocessorModule = validateOptionalFlowModule(\n\t\tflow.preprocessor_module,\n\t\t'preprocessor_module'\n\t)\n\tconst failureModule = validateOptionalFlowModule(flow.failure_module, 'failure_module')\n\tconst groupModuleIds = new Set(collectAllFlowModuleIdsFromModules(modules))\n\tconst groups = validateFlowGroups(flow.groups, groupModuleIds)\n\tconst notes = validateFlowNotes(flow.notes, groupModuleIds)\n\n\tif (preprocessorModule) {\n\t\tif (preprocessorModule.id !== SPECIAL_MODULE_IDS.PREPROCESSOR) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid preprocessor_module: id must be \"${SPECIAL_MODULE_IDS.PREPROCESSOR}\"`","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/flow/editableFlowJson.ts#L344-L380","documentation":"The flow's value settings (extra top-level settings carried alongside modules, e.g. timeout/retry-related keys covered by flowValueSettingsSchema) are parsed with zod; the first issue is rethrown as `Invalid flow setting <dotted-path>: <message>`. The dotted path pinpoints exactly which nested setting failed and why.","triggerScenarios":"Calling flowTools parsedFlow/patch tools with a settings key present but with a wrong type or value — e.g. a string where a number is expected, or an invalid enum value at settings.priority.","commonSituations":"An LLM writes \"timeout\": \"30s\" where a number of seconds is required; a user copies a setting from an older flow format; an enum-like setting gets an out-of-vocabulary value.","solutions":["Read the dotted path in the message and correct that setting's type/value per flowValueSettingsSchema.","Use the exact keys and shapes listed in the error's 'Allowed keys' output from the unknown-key check.","Omit the setting entirely if the default is acceptable."],"exampleFix":"// before\n{\"timeout\":\"30s\"}\n// after\n{\"timeout\":30}","handlingStrategy":"validation","validationCode":"import { flowValueSettingsSchema } from './flowValueSettings'\nconst r = flowValueSettingsSchema.safeParse(flow)\nif (!r.success) {\n  for (const i of r.error.issues)\n    console.error(`${i.path.join('.')}: ${i.message}`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  const editable = validateEditableFlowJson(raw)\n} catch (e) {\n  const m = /^Invalid flow setting (.+?): (.*)$/.exec(String(e.message))\n  if (m) {\n    // m[1] is the dotted settings path, m[2] the zod reason; fix and retry\n  } else throw e\n}","preventionTips":["Match setting value types exactly (numbers for numeric settings, no formatted strings)","Only set settings keys that flowValueSettingsSchema defines","Omit settings to accept defaults rather than guessing shapes"],"tags":["validation","zod","settings"],"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"}