{"record":{"id":"246fbb2bec9ecad4","repo":"FlowiseAI/Flowise","slug":"invalid-json-in-executeflowoverrideconfig-parse","errorCode":null,"errorMessage":"Invalid JSON in executeFlowOverrideConfig: ${parseError.message}","messagePattern":"Invalid JSON in executeFlowOverrideConfig: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts","lineNumber":174,"sourceCode":"            const startAgentflowNode = previousNodes.find((node) => node.name === 'startAgentflow')\n            const state = startAgentflowNode?.inputs?.startState as ICommonObject[]\n            return state.map((item) => ({ label: item.key, name: item.key }))\n        }\n    }\n\n    async run(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const baseURL = (nodeData.inputs?.executeFlowBaseURL as string) || (options.baseURL as string)\n        const selectedFlowId = nodeData.inputs?.executeFlowSelectedFlow as string\n        const flowInput = nodeData.inputs?.executeFlowInput as string\n        const returnResponseAs = nodeData.inputs?.executeFlowReturnResponseAs as string\n        const _executeFlowUpdateState = nodeData.inputs?.executeFlowUpdateState\n\n        let overrideConfig = nodeData.inputs?.executeFlowOverrideConfig\n        if (typeof overrideConfig === 'string' && overrideConfig.startsWith('{') && overrideConfig.endsWith('}')) {\n            try {\n                overrideConfig = parseJsonBody(overrideConfig)\n            } catch (parseError) {\n                throw new Error(`Invalid JSON in executeFlowOverrideConfig: ${parseError.message}`)\n            }\n        }\n\n        const state = options.agentflowRuntime?.state as ICommonObject\n        const runtimeChatHistory = (options.agentflowRuntime?.chatHistory as BaseMessageLike[]) ?? []\n        const isLastNode = options.isLastNode as boolean\n        const sseStreamer: IServerSideEventStreamer | undefined = options.sseStreamer\n\n        try {\n            const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n            const chatflowApiKey = getCredentialParam('chatflowApiKey', credentialData, nodeData)\n\n            if (!baseURL || !isValidURL(baseURL)) throw new Error('Invalid base URL: must be a valid URL')\n\n            if (selectedFlowId === options.chatflowid) throw new Error('Cannot call the same agentflow!')\n\n            let headers: Record<string, string> = {\n                'Content-Type': 'application/json',","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts#L156-L192","documentation":"ExecuteFlow.run treats executeFlowOverrideConfig as a JSON object string only when it starts with '{' and ends with '}'; it then calls parseJsonBody. If parsing fails, it throws 'Invalid JSON in executeFlowOverrideConfig: <SyntaxError message>'. The error is raised before the outbound prediction call, so no request is sent.","triggerScenarios":"executeFlowOverrideConfig set to a string that looks like a JSON object (brace-wrapped) but has syntax errors: trailing comma, unquoted keys, single quotes, unescaped newlines, or a copy-paste with smart quotes.","commonSituations":"Operator hand-typing override config in the node; UI text field accepting malformed JSON; template variable left unresolved inside the JSON (e.g. {{var}} breaking syntax); mixed tab/space or BOM characters from a paste.","solutions":["Paste the override config through a JSON validator/linter and fix reported syntax errors.","Use double quotes for all keys and string values, remove trailing commas.","If using template variables, ensure they resolve to valid JSON-compatible values before the node runs.","Prefer passing overrideConfig as a real object rather than a string when the caller supports it."],"exampleFix":"// before\nexecuteFlowOverrideConfig = \"{ sessionId: 'abc', }\" // unquoted key + trailing comma\n\n// after\nexecuteFlowOverrideConfig = '{\"sessionId\":\"abc\"}'","handlingStrategy":"validation","validationCode":"function parseOverrideConfig(raw) {\n  if (typeof raw === 'string' && raw.startsWith('{') && raw.endsWith('}')) {\n    try { return JSON.parse(raw) }\n    catch (e) { throw new Error('executeFlowOverrideConfig is not valid JSON: ' + e.message) }\n  }\n  return raw\n}\noverrideConfig = parseOverrideConfig(nodeData.inputs?.executeFlowOverrideConfig)","typeGuard":"function isJsonObjectString(s) {\n  return typeof s === 'string' && s.trim().startsWith('{') && s.trim().endsWith('}')\n}","tryCatchPattern":"try { await executeFlow.run(nodeData, '', options) }\ncatch (e) {\n  if (/Invalid JSON in executeFlowOverrideConfig/.test(e.message)) {\n    // prompt user to fix the JSON in the node, then retry\n  } else throw e\n}","preventionTips":["Provide a JSON editor widget with live validation for override config.","Avoid hand-typing JSON; prefer a structured form that serializes to JSON.","Resolve template variables to JSON-safe values before injection."],"tags":["execute-flow","json-parse","validation","configuration"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}