{"record":{"id":"deb12c2aeaac3823","repo":"n8n-io/n8n","slug":"no-model-selected-please-choose-a-model","errorCode":null,"errorMessage":"No model selected. Please choose a model.","messagePattern":"No model selected\\. Please choose a model\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts","lineNumber":501,"sourceCode":"\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials<{\n\t\t\turl?: string;\n\t\t\tapiKey?: string;\n\t\t\theader?: boolean;\n\t\t\theaderName?: string;\n\t\t\theaderValue?: string;\n\t\t}>('anthropicApi');\n\t\tconst baseURL = credentials.url ?? 'https://api.anthropic.com';\n\t\tconst version = this.getNode().typeVersion;\n\t\tconst modelName =\n\t\t\tversion >= 1.3\n\t\t\t\t? (this.getNodeParameter('model.value', itemIndex) as string)\n\t\t\t\t: (this.getNodeParameter('model', itemIndex) as string);\n\n\t\tif (!modelName) {\n\t\t\tthrow new NodeOperationError(this.getNode(), 'No model selected. Please choose a model.', {\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t}\n\n\t\tconst options = this.getNodeParameter('options', itemIndex, {}) as {\n\t\t\tmaxTokensToSample?: number;\n\t\t\ttemperature?: number;\n\t\t\ttopK?: number;\n\t\t\ttopP?: number;\n\t\t\tthinking?: boolean;\n\t\t\tthinkingBudget?: number;\n\t\t\tthinkingMode?: 'disabled' | 'adaptive' | 'manual';\n\t\t\teffort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max';\n\t\t\tstreaming?: boolean;\n\t\t};\n\n\t\tconst isOpus47Model = modelName.startsWith('claude-opus-4-7');\n\t\tconst thinkingMode: 'disabled' | 'adaptive' | 'manual' =","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.ts#L483-L519","documentation":"Thrown by the Anthropic Chat node when modelName resolves to a falsy value. The node reads 'model.value' for typeVersion >= 1.3 and 'model' for older versions; if either is empty, the API call cannot target a model, so it halts with an itemIndex-tagged NodeOperationError before constructing the client.","triggerScenarios":"The model parameter is unset, the model resource collection is empty (no models loaded from the API), a workflow imported with a model id that no longer exists and resolved to '', or an expression returning nothing.","commonSituations":"First run after credential setup before models are fetched; switching credentials whose account lacks the configured model; v1.2 → v1.3 type-version migration where 'model' became 'model.value' but the saved value migrated badly; expression '{{ $json.model }}' against an item without that key.","solutions":["Open the node and pick a model from the resource list (re-authenticate first if the list is empty).","If the model id comes from an expression, guard it with a fallback: {{ $json.model || 'claude-3-5-sonnet-20241022' }}.","For typeVersion mismatches, recreate the node at the latest version so the parameter path aligns.","Verify the Anthropic credential has access to the desired model family."],"exampleFix":"// before\nconst modelName = '' // parameter empty\n// after\nconst modelName = this.getNodeParameter('model.value', itemIndex, 'claude-3-5-sonnet-20241022') as string;","handlingStrategy":"validation","validationCode":"const version = this.getNode().typeVersion;\nconst modelName = version >= 1.3\n  ? (this.getNodeParameter('model.value', itemIndex) as string)\n  : (this.getNodeParameter('model', itemIndex) as string);\nif (!modelName) {\n  throw new Error('Select a model in the node before executing the workflow.');\n}","typeGuard":"const hasModel = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":"// Pre-validate before supplyData; ensure model resource list is populated.","preventionTips":["Authenticate the Anthropic credential before picking a model so the resource list loads.","For expression-driven models, provide a literal fallback.","Recreate the node at the latest typeVersion when migrating from 1.2 to 1.3+."],"tags":["anthropic","llm","configuration","user-input"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}