{"record":{"id":"e0e199f0447ab2b8","repo":"n8n-io/n8n","slug":"unsupported-findoperator-findoperator-constructo","errorCode":null,"errorMessage":"Unsupported FindOperator ${FindOperator.constructor.name}","messagePattern":"Unsupported FindOperator (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/query-builder/QueryBuilder.ts","lineNumber":998,"sourceCode":"\t\t\t\t\treturn '0=1';\n\t\t\t\t}\n\t\t\t\treturn `${condition.parameters[0]} IN (${condition.parameters.slice(1).join(', ')})`;\n\t\t\tcase 'any':\n\t\t\t\treturn `${condition.parameters[0]} = ANY(${condition.parameters[1]})`;\n\t\t\tcase 'isNull':\n\t\t\t\treturn `${condition.parameters[0]} IS NULL`;\n\n\t\t\tcase 'not':\n\t\t\t\treturn `NOT(${this.createWhereConditionExpression(condition.condition)})`;\n\t\t\tcase 'brackets':\n\t\t\t\treturn `${this.createWhereConditionExpression(condition.condition, true)}`;\n\t\t\tcase 'and':\n\t\t\t\treturn '(' + condition.parameters.join(' AND ') + ')';\n\t\t\tcase 'or':\n\t\t\t\treturn '(' + condition.parameters.join(' OR ') + ')';\n\t\t}\n\n\t\tthrow new TypeError(`Unsupported FindOperator ${FindOperator.constructor.name}`);\n\t}\n\n\tprotected createCteExpression(): string {\n\t\tif (!this.hasCommonTableExpressions()) {\n\t\t\treturn '';\n\t\t}\n\t\tconst databaseRequireRecusiveHint =\n\t\t\tthis.connection.driver.cteCapabilities.requiresRecursiveHint;\n\n\t\tconst cteStrings = this.expressionMap.commonTableExpressions.map((cte) => {\n\t\t\tconst cteBodyExpression =\n\t\t\t\ttypeof cte.queryBuilder === 'string' ? cte.queryBuilder : cte.queryBuilder.getQuery();\n\t\t\tif (typeof cte.queryBuilder !== 'string') {\n\t\t\t\tif (cte.queryBuilder.hasCommonTableExpressions()) {\n\t\t\t\t\tthrow new TypeORMError(`Nested CTEs aren't supported (CTE: ${cte.alias})`);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t!this.connection.driver.cteCapabilities.writable &&","sourceCodeStart":980,"sourceCodeEnd":1016,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/query-builder/QueryBuilder.ts#L980-L1016","documentation":"createWhereConditionExpression() switch on condition.operator falls through to a TypeError when the operator is none of the handled cases (lessThan, lessThanOrEqual, arrayContains, jsonContains, arrayContainedBy, arrayOverlap, moreThan, moreThanOrEqual, notEqual, equal, ilike, like, between, in, any, isNull, not, brackets, and, or). A FindOperator with an unrecognised type reaches this throw — typically a custom FindOperator or a version mismatch where a newer operator isn't handled.","triggerScenarios":"Constructing a FindOperator with an operator type string not covered by the switch and passing it into a where clause (e.g. via FindOperator constructor or a custom operator factory). Also after upgrading TypeORM where a new operator exists in FindOperatorType but createWhereConditionExpression wasn't updated.","commonSituations":"Custom FindOperator subclasses for vendor-specific predicates. Monkeypatching FindOperatorType. Version skew between @n8n/typeorm fork and a plugin expecting upstream operator support.","solutions":["Use only built-in FindOperator factory functions (LessThan, MoreThan, Equal, ILike, Between, In, Any, ArrayContains, etc.).","If a custom predicate is needed, pass it as a raw where string (Brackets or string) instead of a FindOperator.","Verify the operator string exactly matches a case label in createWhereConditionExpression for this TypeORM version.","On a fork, extend the switch to handle the operator before using it."],"exampleFix":"// before\nqb.where({ status: new FindOperator('regex', value) }); // 'regex' not in switch\n\n// after — use a raw where string for unsupported predicates\nqb.where('status ~ :pattern', { pattern: value });","handlingStrategy":"type-guard","validationCode":"const SUPPORTED_OPS = new Set(['lessThan','lessThanOrEqual','arrayContains','jsonContains','arrayContainedBy','arrayOverlap','moreThan','moreThanOrEqual','notEqual','equal','ilike','like','between','in','any','isNull','not','brackets','and','or']);\nfunction isSupportedOperator(op: string): boolean { return SUPPORTED_OPS.has(op); }\nif (customOp && !isSupportedOperator((customOp as any)._type)) throw new Error('unsupported FindOperator type');","typeGuard":"function isSupportedFindOperator(op: string): boolean {\n  return new Set(['lessThan','lessThanOrEqual','arrayContains','jsonContains','arrayContainedBy','arrayOverlap','moreThan','moreThanOrEqual','notEqual','equal','ilike','like','between','in','any','isNull','not','brackets','and','or']).has(op);\n}","tryCatchPattern":null,"preventionTips":["Use only built-in FindOperator factory functions.","For custom predicates, pass raw where strings or Brackets, not FindOperators.","Verify the operator type is in the createWhereConditionExpression switch for this version.","On a fork, extend the switch before introducing a new operator."],"tags":["query-builder","find-operator","where","typeerror"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}