FlowiseAI/Flowise · error · Error

Model is required

Error message

Model is required

What it means

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.

Source

Thrown at packages/components/nodes/agentflow/LLM/LLM.ts:351

            const previousNodes = options.previousNodes as ICommonObject[]
            const startAgentflowNode = previousNodes.find((node) => node.name === 'startAgentflow')
            const state = startAgentflowNode?.inputs?.startState as ICommonObject[]
            return state.map((item) => ({ label: item.key, name: item.key }))
        }
    }

    async run(nodeData: INodeData, input: string | Record<string, any>, 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?.llmModel as string
            const modelConfig = nodeData.inputs?.llmModelConfig as ICommonObject
            if (!model) {
                throw new Error('Model is required')
            }
            const modelName = modelConfig?.model ?? modelConfig?.modelName

            // Extract memory and configuration options
            const enableMemory = nodeData.inputs?.llmEnableMemory as boolean
            const memoryType = nodeData.inputs?.llmMemoryType as string
            const userMessage = nodeData.inputs?.llmUserMessage as string
            const _llmUpdateState = nodeData.inputs?.llmUpdateState
            const _llmStructuredOutput = nodeData.inputs?.llmStructuredOutput
            const llmMessages = (nodeData.inputs?.llmMessages as unknown as ILLMMessage[]) ?? []

            // Extract runtime state and history
            const state = options.agentflowRuntime?.state as ICommonObject
            const pastChatHistory = (options.pastChatHistory as BaseMessageLike[]) ?? []
            const runtimeChatHistory = (options.agentflowRuntime?.chatHistory as BaseMessageLike[]) ?? []
            const prependedChatHistory = options.prependedChatHistory as IMessage[]
            const chatId = options.chatId as string

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Open the agentflow canvas and confirm a Chat Model component is connected to the LLM node's Model input.
  2. If the model is bound to a variable, verify that variable resolves to a valid model component id at runtime.
  3. Re-select the model in the node's parameter panel and save the flow.
  4. Audit the saved flow JSON to confirm `inputs.llmModel` is present and non-empty.
Defensive patterns

Strategy: validation

Validate before calling

const model = nodeData.inputs?.llmModel
if (!model || typeof model !== 'string') {
  throw new Error('LLM node requires a connected Chat Model component (llmModel input)')
}

Try / catch

try {
  await llmNode.run(nodeData, input, options)
} catch (e) {
  if ((e as Error).message === 'Model is required') {
    // prompt user to wire a model component
  }
  throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/193a2bb4333ee5f4. Report an issue: GitHub.