Skip to content

feat(nodes): add conditional if/else branching node (#628)#649

Draft
dsapandora wants to merge 2 commits intodevelopfrom
feat/conditional-node-if-else
Draft

feat(nodes): add conditional if/else branching node (#628)#649
dsapandora wants to merge 2 commits intodevelopfrom
feat/conditional-node-if-else

Conversation

@dsapandora
Copy link
Copy Markdown
Collaborator

@dsapandora dsapandora commented Apr 10, 2026

Summary

Introduces a conditional routing node that evaluates a sandboxed Python expression
against incoming text/questions content and directs it to one of two exclusive
branches (then / else) via selectBranch dispatch filtering in the Binder.
Downstream nodes receive standard writeText/writeQuestions calls unchanged.

Engine:

  • selectBranch() / clearBranchSelection() on Binder
  • m_branchMap tagging instances per branch
  • Meta-lane expansion in bind(): binding "then" or "else" auto-binds all data lanes
    and tags the instance
  • "then" / "else" added to MethodNames for pipeline-config validation
  • Python bindings for the two new callbacks

Node (nodes/src/nodes/conditional/):

  • Single profile: Python expression evaluated per write
  • Scope exposes the incoming content: text on the text lane, questions on the
    questions lane
  • Truthy → then; falsy → else; runtime error → else (logged)
  • Supports text and questions lanes

Type

Feature

Testing

  • Tests added or updated
  • Tested locally
  • ./builder test passes

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included
  • Wiki updated (if applicable)
  • Breaking changes documented (if applicable)

Linked Issue

Related to #628

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 09661ae2-8f76-42b1-8ddb-f4c13323b0da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/conditional-node-if-else

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added module:server C++ engine and server components module:nodes Python pipeline nodes labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown

No description provided.

@dsapandora dsapandora force-pushed the feat/conditional-node-if-else branch from f03f424 to 17273af Compare April 13, 2026 16:18
@github-actions github-actions bot added the docs Documentation label Apr 13, 2026
@dsapandora dsapandora force-pushed the feat/conditional-node-if-else branch from e9420e5 to 8ab1077 Compare April 13, 2026 17:16
Copy link
Copy Markdown
Collaborator

@Rod-Christensen Rod-Christensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to examine this as this breaks the lane architecture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation module:client-typescript module:nodes Python pipeline nodes module:server C++ engine and server components module:ui Chat UI and Dropper UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants