Understanding Edges
Other Edges
If/Else edge

If/Else Edge


The If/Else edge is a logic control mechanism that allows your workflow to dynamically branch based on conditions. Each condition is evaluated, and if matched, actions are executed to copy data to one or more branches.

Ifelse edge

Purpose:

  • Introduce logic-based decision-making in your pipeline.
  • Filter or route data based on its structure, length, or specific content.

Inputs:

  • Blocks whose content will be evaluated against a condition (text or structured).

Outputs:

  • Multiple branches where matched content is routed (based on which case is satisfied).

A Case consists of:

  • Condition(s): Logical checks (e.g., is empty, contains value, etc.).
  • Logic: The condition operations (AND / OR).
  • Then: Output routing – defines how/where to copy the input when condition is met.

You can define multiple cases to allow multiple logic branches from a single edge.

Supported Condition Types:

  • For Text Blocks:
    • is_empty, is_not_empty
    • contain, not_contain
    • greater_than_n_chars, less_than_n_chars
    • is, is_not
  • For Structured Text Blocks:
    • is_empty, is_not_empty
    • is_list, is_dict
    • greater_than_n, less_than_n

Each of these allows fine-grained control over content checking, useful for branching on format, quantity, or semantic meaning.

Switch Branching:

  • You can configure multiple branches under a single If/Else edge. Each branch will activate based on the matched case, and its copy actions will determine which output blocks receive the routed data.

Tip: You can use this edge as a powerful routing mechanism for handling different document types, fallback logic, or QA mode switching.