FlowiseAI/Flowise · error · Error
Model is required
Error message
Model is required
What it means
ConditionAgent.run requires nodeData.inputs.conditionAgentModel to be truthy; it is the component-node key used to import and instantiate the underlying LLM. Thrown before any LLM setup, so the node cannot run without a selected model.
Source
Thrown at packages/components/nodes/agentflow/ConditionAgent/ConditionAgent.ts:260
throw new Error(`Invalid JSON object. Error: ${error}`)
}
}
throw new Error('Could not find JSON block in the output.')
}
async run(nodeData: INodeData, question: string, options: ICommonObject): Promise<any> {
let llmIds: ICommonObject | undefined
let analyticHandlers = options.analyticHandlers as AnalyticHandler
try {
const abortController = options.abortController as AbortController
// Extract input parameters
const model = nodeData.inputs?.conditionAgentModel as string
const modelConfig = nodeData.inputs?.conditionAgentModelConfig as ICommonObject
if (!model) {
throw new Error('Model is required')
}
const modelName = modelConfig?.model ?? modelConfig?.modelName
const conditionAgentInput = nodeData.inputs?.conditionAgentInput as string
let input = conditionAgentInput || question
const conditionAgentInstructions = nodeData.inputs?.conditionAgentInstructions as string
const conditionAgentSystemPrompt = nodeData.inputs?.conditionAgentSystemPrompt as string
const conditionAgentOverrideSystemPrompt = nodeData.inputs?.conditionAgentOverrideSystemPrompt as boolean
let systemPrompt = NodeHtmlMarkdown.translate(CONDITION_AGENT_SYSTEM_PROMPT)
if (conditionAgentSystemPrompt && conditionAgentOverrideSystemPrompt) {
systemPrompt = conditionAgentSystemPrompt
}
// Extract memory and configuration options
const enableMemory = nodeData.inputs?.conditionAgentEnableMemory as boolean
const memoryType = nodeData.inputs?.conditionAgentMemoryType as string
const _conditionAgentScenarios = nodeData.inputs?.conditionAgentScenarios as { scenario: string }[]
View on GitHub (pinned to abe4a8601a)
Solutions
- Open the Condition Agent node and select a model, then save.
- Set inputs.conditionAgentModel programmatically to a valid component node name.
- Confirm the referenced model still exists in componentNodes at runtime.
- Validate saved flow JSON for a non-empty conditionAgentModel before deploy.
Example fix
// before
inputs.conditionAgentModel = ''
// after
inputs.conditionAgentModel = 'chatOpenAI'
inputs.conditionAgentModelConfig = { model: 'gpt-4o-mini', modelName: 'gpt-4o-mini' } Defensive patterns
Strategy: validation
Validate before calling
function ensureConditionAgentModel(nodeData, componentNodes) {
const m = nodeData.inputs?.conditionAgentModel
if (!m || !componentNodes?.[m]) {
throw new Error('Condition Agent requires a valid conditionAgentModel')
}
} Type guard
function hasConditionAgentModel(nodeData, componentNodes) {
const m = nodeData?.inputs?.conditionAgentModel
return typeof m === 'string' && m.length > 0 && !!componentNodes?.[m]
} Try / catch
if (!hasConditionAgentModel(nodeData, options.componentNodes)) {
// surface UI error, skip
} else { await conditionAgent.run(nodeData, question, options) } Prevention
- Block save when the Condition Agent has no model.
- Validate flow JSON before deploy.
- Warn when a referenced model is deleted.
When it happens
Trigger: Condition Agent node saved without a model; flow JSON with conditionAgentModel stripped; programmatic nodeData missing the field; referenced model node deleted from the project.
Common situations: Newly added Condition Agent with the model dropdown left empty; imported template missing the field; model component renamed/removed; UI not persisting the selection.
Related errors
- Model is required
- Scenarios are required
- Invalid JSON in executeFlowOverrideConfig: ${parseError.mess
- Invalid base URL: must be a valid URL
- Cannot call the same agentflow!
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/3d634d3338bcbd56.
Report an issue: GitHub.