Free Intro Class
    Botspot Logo

    agenthub · if

    Condition

    Route on a single comparison. It reads a value, compares it, and forwards the data out either the true or the false branch.

    category Logicin left · right · dataout true · falseexecution asyncmodel cost none

    Why the node earns its place

    The branch primitive. It is deliberately domain-agnostic: nothing in it knows about members, phones or tickets, so any workflow that needs to fork composes it rather than baking a branch into a domain node.

    It is also a router in the strict sense — it fires exactly one outgoing branch and prunes the other. And because each branch carries the input data through, you wire the branch straight into the next node; there is no separate data edge to run alongside it.

    How it works at run time

    1. 1
      Resolve the left operand by precedence: a wired left input, then left_context_key from run context, then the left dotted path into data, then a bare-key fallback so a simple wiring just works.
    2. 2
      Resolve the right operand the same way — context key, then path, then the literal. Unary operators skip this entirely.
    3. 3
      Normalise both sides together when normalize is set, element-wise across lists.
    4. 4
      Compare using the fixed operator allow-list. There is no eval anywhere in this node.
    5. 5
      Return the verdict as the branch to fire; the executor prunes every other outgoing edge.

    What you wire

    Inputs

    • left
      any
    • right
      any
    • data
      object

    Outputs

    • true
      object
    • false
      object

    Configuration

    KeyTypeDefault & optionsWhat it does
    leftstringLeft operand as a dotted path into `data` (e.g. 'result.body.total'). Overridden by a wired `left` input or left_context_key. When the `left` input IS wired, this path navigates within that wired value.
    left_context_keystringRead the left operand from run context instead of data (e.g. 'phone' for the caller's number). Wins over `left`.
    operator *stringdefault "truthy" truthy · falsy · exists · absent · eq · ne · gt · gte · lt · lte · contains · not_contains · in · not_inComparison. truthy/falsy/exists/absent are unary. contains: left (a list/string) holds right. in: left is a member of right (right is a list/string).
    rightstringLiteral right operand (fallback). Numeric strings compare numerically. Overridden by right_path / right_context_key.
    right_pathstringDotted path for the right operand — point at a LIST (e.g. 'values' from Extract List). Applies within a wired `right` input if present, else into `data`. Wins over the `right` literal.
    right_context_keystringRead the right operand from run context. Wins over right_path and the literal.
    normalizestringdefault "none" none · trim · lower · phone10Normalize BOTH operands before comparing (element-wise for a list). phone10 = last 10 digits, so a raw +91… caller phone matches a phone10-normalized list.

    What usually goes wrong

    Watch for this

    Do not re-converge both branches onto one node that waits for several inputs. One input never arrives, the fan-in never releases, and the run finishes with that step silently skipped and no error raised. If both branches must reach the same next step, use two copies of it, or restructure so the join happens after a non-routing node.

    For phone comparisons set normalize to phone10. A raw +91… caller number never equals a roster cell stored as ten digits, and the branch silently takes the false path forever.

    Behaviour & provenance

    buildersChat & voice agents, Image workflows, Video workflows, Automations
    routesyes — fires one branch
    side effectsnone — computes only
    replay safetynot applicable
    talks tonothing outside the run
    holdsno credentials