{"record":{"id":"a6870b7734d317f0","repo":"FlowiseAI/Flowise","slug":"invalid-json-in-the-llm-node-s-prompt-input-values","errorCode":null,"errorMessage":"Invalid JSON in the LLM Node's Prompt Input Values: ${exception}","messagePattern":"Invalid JSON in the LLM Node's Prompt Input Values: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts","lineNumber":419,"sourceCode":"        humanPrompt = transformBracesWithColon(humanPrompt)\n        const llmNodeLabel = nodeData.inputs?.llmNodeName as string\n        const sequentialNodes = nodeData.inputs?.sequentialNode as ISeqAgentNode[]\n        const model = nodeData.inputs?.model as BaseChatModel\n        const promptValuesStr = nodeData.inputs?.promptValues\n        const output = nodeData.outputs?.output as string\n        const llmStructuredOutput = nodeData.inputs?.llmStructuredOutput\n\n        if (!llmNodeLabel) throw new Error('LLM Node name is required!')\n        const llmNodeName = llmNodeLabel.toLowerCase().replace(/\\s/g, '_').trim()\n\n        if (!sequentialNodes || !sequentialNodes.length) throw new Error('Agent must have a predecessor!')\n\n        let llmNodeInputVariablesValues: ICommonObject = {}\n        if (promptValuesStr) {\n            try {\n                llmNodeInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)\n            } catch (exception) {\n                throw new Error(\"Invalid JSON in the LLM Node's Prompt Input Values: \" + exception)\n            }\n        }\n        llmNodeInputVariablesValues = handleEscapeCharacters(llmNodeInputVariablesValues, true)\n\n        const startLLM = sequentialNodes[0].startLLM\n        const llm = model || startLLM\n        if (nodeData.inputs) nodeData.inputs.model = llm\n\n        const multiModalMessageContent = sequentialNodes[0]?.multiModalMessageContent || (await processImageMessage(llm, nodeData, options))\n        const abortControllerSignal = options.signal as AbortController\n        const llmNodeInputVariables = uniq([...getInputVariables(systemPrompt), ...getInputVariables(humanPrompt)])\n\n        const missingInputVars = difference(llmNodeInputVariables, Object.keys(llmNodeInputVariablesValues)).join(' ')\n        const allVariablesSatisfied = missingInputVars.length === 0\n        if (!allVariablesSatisfied) {\n            const nodeInputVars = llmNodeInputVariables.join(' ')\n            const providedInputVars = Object.keys(llmNodeInputVariablesValues).join(' ')\n","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/sequentialagents/LLMNode/LLMNode.ts#L401-L437","documentation":"The LLM Node's 'Prompt Input Values' field is JSON.parsed at init when it is a string. A malformed JSON string throws SyntaxError, which is caught and re-thrown with this prefix including the original exception.","triggerScenarios":"promptValuesStr is a non-empty string with a JSON syntax error: trailing comma, unquoted keys, smart quotes, single quotes, or truncation.","commonSituations":"Hand-typing the prompt-values JSON instead of using the structured editor; pasting from formatted text that introduced smart quotes; partial edit before testing.","solutions":["Run the Prompt Input Values string through a JSON linter and fix the reported error.","Use the structured prompt-values editor so the field stays a valid object.","Confirm the value is an object mapping placeholder names to values, e.g. {\"topic\":\"rag\"}."],"exampleFix":"// before (throws: trailing comma)\n{\"topic\": \"rag\", \"count\": 3,}\n\n// after\n{\"topic\": \"rag\", \"count\": 3}","handlingStrategy":"validation","validationCode":"function parsePromptValues(raw: unknown): Record<string, unknown> {\n  if (!raw) return {}\n  const obj = typeof raw === 'string' ? JSON.parse(raw) : raw\n  if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) throw new Error('Prompt Input Values must be a JSON object')\n  return obj as Record<string, unknown>\n}","typeGuard":"const isPromptValuesObject = (x: any): x is Record<string, unknown> => typeof x === 'object' && x !== null && !Array.isArray(x)","tryCatchPattern":"try { JSON.parse(promptValuesStr) } catch (e) { throw new Error('Prompt Input Values JSON invalid: ' + e.message) }","preventionTips":["Use the structured prompt-values editor rather than raw JSON.","Lint hand-authored JSON before pasting."],"tags":["json","llm-node","prompt","init"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}