{"record":{"id":"f405ce26c629d2ae","repo":"n8n-io/n8n","slug":"no-matching-rule-found","errorCode":null,"errorMessage":"No matching rule found","messagePattern":"No matching rule found","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/ModelSelector/ModelSelector.node.ts","lineNumber":212,"sourceCode":"\t\t\t\tconst selectedModel = models[modelIndex - 1] as BaseChatModel;\n\n\t\t\t\tconst originalCallbacks = getCallbacksArray(selectedModel.callbacks);\n\n\t\t\t\tfor (const currentCallback of originalCallbacks) {\n\t\t\t\t\tif (currentCallback instanceof N8nLlmTracing) {\n\t\t\t\t\t\tcurrentCallback.setParentRunIndex(this.getNextRunIndex());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst modelSelectorTracing = new N8nNonEstimatingTracing(this);\n\t\t\t\tselectedModel.callbacks = [...originalCallbacks, modelSelectorTracing];\n\n\t\t\t\treturn {\n\t\t\t\t\tresponse: selectedModel,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tthrow new NodeOperationError(this.getNode(), 'No matching rule found', {\n\t\t\titemIndex,\n\t\t\tdescription: 'None of the defined rules matched the workflow data',\n\t\t});\n\t}\n}\n","sourceCodeStart":194,"sourceCodeEnd":218,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/ModelSelector/ModelSelector.node.ts#L194-L218","documentation":"Thrown by ModelSelector.supplyData() after iterating all rules without any rule's conditions evaluating to true. The node returns the first matching rule's model; if none match, it cannot choose and throws. This is a configuration/policy miss, not a runtime fault.","triggerScenarios":"The for-loop over rules evaluates `conditionsMet` for each rule via getNodeParameter with extractValue. If no rule's conditions are met, execution falls through to the throw. Fires when workflow data does not satisfy any rule predicate.","commonSituations":"Conditions narrower than the data the workflow actually produces (e.g. expecting a field that is absent); rules built for a different input shape; no catch-all/else rule defined.","solutions":["Add a final catch-all rule (always-true condition) that selects a default model so selection never falls through.","Loosen or fix the existing conditions to match the actual runtime data shape.","Inspect the incoming item data at runtime to see why no condition matched."],"exampleFix":"// before: rules only match when input.category === 'fast'\n// after: append a fallback rule with no conditions (or always-true) selecting a default model","handlingStrategy":"fallback","validationCode":"const hasCatchAll = rules.some((r) => isAlwaysTrue(r.conditions));\nif (!hasCatchAll) throw new Error('Add a default rule to avoid No matching rule found');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always add a final always-true rule as the default model selection.","Keep rule conditions aligned with the runtime data shape.","Log item data before the ModelSelector to diagnose misses."],"tags":["model-selector","rules","fallback","config"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}