{"record":{"id":"e1bb3512f2a15734","repo":"projectdiscovery/nuclei","slug":"unknown-condition-specified-s-e1bb35","errorCode":null,"errorMessage":"unknown condition specified: %s","messagePattern":"unknown condition specified: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/workflows/workflows.go","lineNumber":92,"sourceCode":"\t// ANDCondition matches responses with AND condition in arguments.\n\tANDCondition ConditionType = iota + 1\n\t// ORCondition matches responses with AND condition in arguments.\n\tORCondition\n)\n\n// ConditionTypes is a table for conversion of condition type from string.\nvar ConditionTypes = map[string]ConditionType{\n\t\"and\": ANDCondition,\n\t\"or\":  ORCondition,\n}\n\n// Compile compiles the matcher for workflow\nfunc (matcher *Matcher) Compile() error {\n\tvar ok bool\n\tif matcher.Condition != \"\" {\n\t\tmatcher.condition, ok = ConditionTypes[matcher.Condition]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unknown condition specified: %s\", matcher.Condition)\n\t\t}\n\t} else {\n\t\tmatcher.condition = ORCondition\n\t}\n\treturn nil\n}\n\n// Match matches a name for matcher names or name\nfunc (matcher *Matcher) Match(result *operators.Result) bool {\n\tnames := matcher.Name.ToSlice()\n\tif len(names) == 0 {\n\t\treturn false\n\t}\n\n\tfor i, name := range names {\n\t\tmatchOK := result.HasMatch(name)\n\t\textractOK := result.HasExtract(name)\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/workflows/workflows.go#L74-L110","documentation":"A workflow matcher's condition string could not be resolved. workflows.Matcher.Compile maps matcher.Condition to a ConditionType using the ConditionTypes table, which only contains \"and\" and \"or\"; anything else — including casing variants like \"AND\" or \"And\" — fails compilation with this error.","triggerScenarios":"A workflow YAML with matchers[].condition set to a value other than exactly \"and\" or \"or\" (e.g. \"AND\", \"all\", \"none\", \"&&\"), or a typo like \"adr\".","commonSituations":"Hand-edited workflow templates; porting workflows from other YAML dialects where conditions are written differently; uppercase normalization assumptions — the lookup is case-sensitive.","solutions":["Set matchers[].condition to exactly \"and\" or \"or\" (lowercase).","Omit the condition entirely when OR semantics are intended — Compile defaults to ORCondition when Condition is empty.","Validate the workflow template against the nuclei template schema (make template-validate) before running."],"exampleFix":"# before\nmatchers:\n  - name: a\n    condition: AND   # -> unknown condition specified: AND\n\n# after\nmatchers:\n  - name: a\n    condition: and","handlingStrategy":"type-guard","validationCode":"var validConditions = map[string]bool{\"and\": true, \"or\": true}\nfor _, m := range wf.Matchers {\n    if m.Condition != \"\" && !validConditions[m.Condition] {\n        return fmt.Errorf(\"matcher %q: condition must be \\\"and\\\" or \\\"or\\\"\", m.Name)\n    }\n}","typeGuard":"func isValidWorkflowCondition(s string) bool {\n    _, ok := workflows.ConditionTypes[s]\n    return s == \"\" || ok\n}","tryCatchPattern":"if err := matcher.Compile(); err != nil {\n    if strings.Contains(err.Error(), \"unknown condition\") { /* fix template YAML, lowercase and/or drop */ }\n}","preventionTips":["Only lowercase \"and\"/\"or\"; the map lookup is case-sensitive.","Empty condition is valid and defaults to OR.","Run make template-validate on workflow YAML."],"tags":["workflows","yaml","template","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}