Conditional Logic

Last updated: Jan 2026

ORCFLO provides the Criteria Check node for conditional branching in your workflows. This AI-powered node evaluates conditions using natural language criteria, making it ideal for decisions that require understanding context, sentiment, intent, or other nuanced aspects of your data.

Criteria Check Node

The Criteria Check node uses AI to evaluate whether input data meets specified criteria. Unlike traditional rule-based conditions, it can understand context, interpret meaning, and make nuanced judgments based on natural language descriptions.

Configuration

SettingDescription
Input ValueThe data to evaluate. Reference an upstream step output that contains the content to check.
CriteriaNatural language description of what makes the condition true. Be specific and clear about what you're looking for.

How It Works

When the Criteria Check node executes, it sends your input value and criteria to an AI model which evaluates whether the input meets the specified criteria. The node then returns either true or false, routing execution to the appropriate branch.

Token Usage

Criteria Check uses AI tokens for each evaluation. Write clear, concise criteria to optimize token usage while maintaining accuracy.

Writing Effective Criteria

The quality of your criteria directly impacts how accurately the node evaluates your conditions. Follow these guidelines to write effective criteria.

GuidelineExample
Be specificInstead of "negative sentiment", write "The customer is expressing frustration, anger, or dissatisfaction with the service."
Provide examplesInclude examples of phrases or patterns that meet the criteria: "...such as 'this is unacceptable' or 'I'm very disappointed'"
Define boundariesClarify what doesn't meet the criteria: "Neutral statements or mild concerns do not qualify."
Use clear languageAvoid ambiguous terms. Instead of "good quality", specify what makes content high quality.
Example: Well-Written Criteria
Criteria:
The customer message indicates they want to cancel their subscription or
close their account. This includes:
- Explicit requests to cancel, unsubscribe, or close the account
- Expressions of intent like "I want to stop using" or "please remove me"
- Questions about how to cancel or end their membership

Do NOT consider as cancellation requests:
- Complaints without cancellation intent
- Questions about pausing or downgrading
- General dissatisfaction without action requests

Branching Execution

The Criteria Check node has two output handles that route execution based on the evaluation result.

BranchHandle PositionWhen Executed
True Branch (Green)Top output handleWhen the input meets the criteria. Connect to nodes that handle the positive case.
False Branch (Red)Bottom output handleWhen the input does not meet the criteria. Connect to fallback or alternative nodes.
Branching Structure
Input --> Criteria Check (is customer frustrated?)
              |
              +-- True (top)  --> Escalate to Manager
              |
              +-- False (bottom) --> Send Auto-Reply

Optional Branches

You don't have to connect both branches. If you only care about one case, connect just that branch. The other path simply won't execute any additional steps.

Examples

Sentiment-Based Routing

Route Based on Customer Sentiment
Criteria Check Configuration:
  Input Value: The customer message from the parse_email step

  Criteria:
  The customer is expressing dissatisfaction, frustration, or anger.
  Look for words like "disappointed", "frustrated", "unacceptable",
  "terrible", or phrases indicating a negative experience.
  Neutral or positive messages do not meet this criteria.

True Branch  --> Escalate to Support Lead
False Branch --> Route to Standard Support

Content Quality Gate

Evaluate Generated Content
Criteria Check Configuration:
  Input Value: The draft from the generate_content step

  Criteria:
  The content needs improvement. Consider it incomplete if:
  - It lacks specific examples or data points
  - The tone is inconsistent or unprofessional
  - Key topics mentioned in the outline are not covered
  - Grammar or spelling errors are present
  - It's shorter than 300 words

True Branch  --> Refine Content (loop back)
False Branch --> Proceed to Publishing

Intent Classification

Identify Sales Inquiries
Criteria Check Configuration:
  Input Value: The incoming message from the receive_message step

  Criteria:
  The message indicates interest in purchasing, pricing, or sales.
  This includes:
  - Questions about pricing, plans, or costs
  - Requests for quotes or demos
  - Expressions of buying intent ("I'd like to purchase", "we're looking for")
  - Questions about features with purchase context

  Support questions, complaints, or general inquiries do not qualify.

True Branch  --> Route to Sales Team
False Branch --> Route to Support Team

Compliance Check

Verify Content Compliance
Criteria Check Configuration:
  Input Value: The generated response from the draft_reply step

  Criteria:
  The response contains any of the following compliance issues:
  - Promises or guarantees about future performance
  - Specific financial advice or recommendations
  - Claims that aren't supported by provided facts
  - Personal opinions presented as company policy
  - Disclosure of internal processes or confidential information

True Branch  --> Flag for Human Review
False Branch --> Send Response

Best Practices

  1. Write detailed criteria: The more specific your criteria, the more accurate the evaluation. Include examples of what should and shouldn't meet the criteria.
  2. Test with edge cases: Try inputs that are borderline or ambiguous to ensure the criteria handles them correctly.
  3. Test both branches: Always verify that both true and false paths work correctly with appropriate test inputs.
  4. Handle empty inputs: Consider what should happen if the input is empty or null. Add this to your criteria if needed.
  5. Keep criteria focused: Each Criteria Check should evaluate one clear condition. For complex logic, use multiple Criteria Check nodes in sequence.

Common Mistakes to Avoid

MistakeFix
Vague or ambiguous criteriaWrite specific, detailed criteria with concrete examples
Not defining negative casesExplicitly state what should NOT meet the criteria
Combining multiple conditionsUse separate Criteria Check nodes for each distinct condition
Not testing edge casesTest with ambiguous, empty, and borderline inputs
Overly complex criteriaKeep criteria concise and focused on one evaluation