FlowiseAI/Flowise · error · Error
Invalid JSON in the Condition Agent's Prompt Input Values: $
Error message
Invalid JSON in the Condition Agent's Prompt Input Values: ${exception} What it means
Same JSON-parse guard as error 281 but on the ConditionAgent node. When `promptValuesStr` is a non-empty string and `JSON.parse` throws, the exception is wrapped with the Condition Agent-specific prefix.
Source
Thrown at packages/components/nodes/sequentialagents/ConditionAgent/ConditionAgent.ts:416
agentPrompt = transformBracesWithColon(agentPrompt)
let humanPrompt = nodeData.inputs?.humanMessagePrompt as string
humanPrompt = transformBracesWithColon(humanPrompt)
const promptValuesStr = nodeData.inputs?.promptValues
const conditionAgentStructuredOutput = nodeData.inputs?.conditionAgentStructuredOutput
const model = nodeData.inputs?.model as BaseChatModel
if (!sequentialNodes || !sequentialNodes.length) throw new Error('Condition Agent must have a predecessor!')
const startLLM = sequentialNodes[0].startLLM
const llm = model || startLLM
if (nodeData.inputs) nodeData.inputs.model = llm
let conditionAgentInputVariablesValues: ICommonObject = {}
if (promptValuesStr) {
try {
conditionAgentInputVariablesValues = typeof promptValuesStr === 'object' ? promptValuesStr : JSON.parse(promptValuesStr)
} catch (exception) {
throw new Error("Invalid JSON in the Condition Agent's Prompt Input Values: " + exception)
}
}
conditionAgentInputVariablesValues = handleEscapeCharacters(conditionAgentInputVariablesValues, true)
const conditionAgentInputVariables = uniq([...getInputVariables(agentPrompt), ...getInputVariables(humanPrompt)])
if (!conditionAgentInputVariables.every((element) => Object.keys(conditionAgentInputVariablesValues).includes(element))) {
throw new Error('Condition Agent input variables values are not provided!')
}
const abortControllerSignal = options.signal as AbortController
const conditionalEdge = async (state: ISeqAgentsState, config: RunnableConfig) =>
await runCondition(
conditionName,
nodeData,
input,
options,View on GitHub (pinned to abe4a8601a)
Solutions
- Provide a valid JSON object string, e.g. `{"topic":"sports"}`.
- Pass the value as an already-parsed object so the `typeof === 'object'` branch skips JSON.parse.
- Verify with `JSON.parse(value)` in a console before saving.
Example fix
// before
nodeData.inputs.promptValues = "topic: sports" // throws [296]
// after
nodeData.inputs.promptValues = '{"topic":"sports"}' Defensive patterns
Strategy: validation
Validate before calling
function parsePromptValuesSafe(raw) {
if (raw == null) return {}
if (typeof raw === 'object') return raw
try {
const parsed = JSON.parse(raw)
if (typeof parsed !== 'object' || Array.isArray(parsed) || parsed === null) {
throw new Error('Condition Agent promptValues must be a JSON object.')
}
return parsed
} catch (e) {
throw new Error(`Condition Agent promptValues is not valid JSON: ${e.message}`)
}
}
parsePromptValuesSafe(nodeData.inputs.promptValues) Type guard
function isJsonObjectString(s): s is string {
if (typeof s !== 'string') return false
try { const v = JSON.parse(s); return typeof v === 'object' && v !== null && !Array.isArray(v) }
catch { return false }
} Prevention
- Always use double-quoted keys in JSON.
- Lint the JSON before saving.
- Pass a parsed object directly when calling init from code.
When it happens
Trigger: Calling ConditionAgent.init with `nodeData.inputs.promptValues` set to a string that is not valid JSON.
Common situations: User typed free-form text in the Condition Agent's Prompt Input Values; pasted content with smart quotes; single-quoted keys; trailing commas.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Invalid JSON in the Agent's Prompt Input Values: ${exception
- Agent input variables values are not provided!
- Condition Agent input variables values are not provided!
- Invalid JSON in the Chat NVIDIA NIM's baseOptions: ${excepti
- Invalid JSON in the ChatOpenAI's BaseOptions: ${exception}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/67e0e8b39a8e7abd.
Report an issue: GitHub.