{"record":{"id":"193a2bb4333ee5f4","repo":"FlowiseAI/Flowise","slug":"model-is-required-193a2b","errorCode":null,"errorMessage":"Model is required","messagePattern":"Model is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agentflow/LLM/LLM.ts","lineNumber":351,"sourceCode":"            const previousNodes = options.previousNodes as ICommonObject[]\n            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, input: string | Record<string, any>, options: ICommonObject): Promise<any> {\n        let llmIds: ICommonObject | undefined\n        let analyticHandlers = options.analyticHandlers as AnalyticHandler\n\n        try {\n            const abortController = options.abortController as AbortController\n\n            // Extract input parameters\n            const model = nodeData.inputs?.llmModel as string\n            const modelConfig = nodeData.inputs?.llmModelConfig as ICommonObject\n            if (!model) {\n                throw new Error('Model is required')\n            }\n            const modelName = modelConfig?.model ?? modelConfig?.modelName\n\n            // Extract memory and configuration options\n            const enableMemory = nodeData.inputs?.llmEnableMemory as boolean\n            const memoryType = nodeData.inputs?.llmMemoryType as string\n            const userMessage = nodeData.inputs?.llmUserMessage as string\n            const _llmUpdateState = nodeData.inputs?.llmUpdateState\n            const _llmStructuredOutput = nodeData.inputs?.llmStructuredOutput\n            const llmMessages = (nodeData.inputs?.llmMessages as unknown as ILLMMessage[]) ?? []\n\n            // Extract runtime state and history\n            const state = options.agentflowRuntime?.state as ICommonObject\n            const pastChatHistory = (options.pastChatHistory as BaseMessageLike[]) ?? []\n            const runtimeChatHistory = (options.agentflowRuntime?.chatHistory as BaseMessageLike[]) ?? []\n            const prependedChatHistory = options.prependedChatHistory as IMessage[]\n            const chatId = options.chatId as string\n","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agentflow/LLM/LLM.ts#L333-L369","documentation":"Thrown by LLM_Agentflow.run() at the top of input extraction when `nodeData.inputs?.llmModel` is falsy. The llmModel input selects which LangChain chat-model component feeds the node; without it the node cannot construct a model instance, so it fails fast before any API call.","triggerScenarios":"The LLM node's `llmModel` input is unconnected in the canvas, bound to a variable that resolves to undefined/empty, or the component was deleted after the node was saved.","commonSituations":"Newly added LLM node with no model wired in; a flow imported/exported where the model reference did not survive; conditional logic that nulls the model input at runtime.","solutions":["Open the agentflow canvas and confirm a Chat Model component is connected to the LLM node's Model input.","If the model is bound to a variable, verify that variable resolves to a valid model component id at runtime.","Re-select the model in the node's parameter panel and save the flow.","Audit the saved flow JSON to confirm `inputs.llmModel` is present and non-empty."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const model = nodeData.inputs?.llmModel\nif (!model || typeof model !== 'string') {\n  throw new Error('LLM node requires a connected Chat Model component (llmModel input)')\n}","typeGuard":null,"tryCatchPattern":"try {\n  await llmNode.run(nodeData, input, options)\n} catch (e) {\n  if ((e as Error).message === 'Model is required') {\n    // prompt user to wire a model component\n  }\n  throw e\n}","preventionTips":["Treat the llmModel input as required in the flow editor.","After importing/exporting flows, verify model references survived.","Default the input to a known-good model component id."],"tags":["agentflow","llm","validation","config","missing-model"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}