Skip to content

Conversation

@JPPhoto
Copy link
Collaborator

@JPPhoto JPPhoto commented Feb 11, 2026

Summary

This PR includes a feature + bugfix for the new If invocation and its editor interoperability:

  • Added a new If invocation node (if) with:
    • input condition: bool
    • input true_input: Optional[Any]
    • input false_input: Optional[Any>
    • output value: Optional[Any] (with default=None to avoid persisted-session validation failures when omitted).
  • Fixed frontend node-connection validation so AnyField can be used as a source where cardinality is compatible (instead of being blocked), which allows If.value to connect to typed inputs in the UI.
  • Added/updated tests for:
    • If true/false behavior and graph connectivity
    • deserialization of if_output when value is missing
    • AnyField source compatibility and cardinality guardrails in UI connection typing.

Why:

  • Enable practical conditional branching in workflows.
  • Ensure the UI allows intended If output wiring.
  • Prevent session reload crashes caused by missing if_output.value in persisted JSON.

How:

  • Implemented the invocation in backend Python.
  • Updated frontend type compatibility logic.
  • Added focused regression tests on both backend and frontend paths.

Related Issues / Discussions

QA Instructions

  1. Backend schema/output checks

    • Verify IfInvocationOutput.value is optional with default None.
    • Verify deserialization test exists and passes in a full dev environment.
  2. UI connection behavior checks

    • Create a graph with If node and connect If.value to a typed input (e.g. string input).
    • Confirm connection is accepted for compatible cardinalities, and rejected for incompatible ones (e.g. SINGLE -> COLLECTION).
  3. Automated tests

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations frontend PRs that change frontend files python-tests PRs that change python tests labels Feb 11, 2026
@JPPhoto JPPhoto marked this pull request as ready for review February 11, 2026 02:20
@JPPhoto JPPhoto added backend PRs that change backend files and removed backend PRs that change backend files labels Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant