Learn how to use the If Output Contains node to create conditional logic based on LLM output content patterns.
The If Output Contains node allows you to create dynamic paths in your workflow by checking if LLM outputs contain specific text patterns or match regex expressions.
The If Output Contains node acts as a content filter, analyzing LLM output text and directing the flow based on pattern matching. This can be useful for:
Output Validation: Ensure AI outputs meet specific criteria
Content Classification: Route outputs based on detected themes or content
Quality Control: Identify and handle outputs with particular characteristics
Output Filtering: Filter out unwanted content patterns
Automated Output Handling: Route different types of outputs to appropriate processing steps
Text to Match: The pattern or text to search for in the LLM output
Use Regex: Toggle to enable regular expression pattern matching
Case Sensitive: Toggle to make the pattern matching case sensitive
Multiple conditions are evaluated using OR logic — if any condition is true, the workflow will proceed down the true path. To use AND logic, simply chain multiple If Output Contains nodes together.