Skip to content

Conversation

@pingsutw
Copy link
Member

@pingsutw pingsutw commented Dec 5, 2025

Tracking issue

NA

Why are the changes needed?

remote.sync_node_execution doesn't sync the branch node execution. This PR adds support it.

What changes were proposed in this pull request?

sync branch nodes.

How was this patch tested?

import flytekit
from flytekit import conditional


@flytekit.task
def calculate_circle_circumference(radius: float) -> float:
    return 2 * 3.14 * radius  # Task to calculate the circumference of a circle


@flytekit.task
def calculate_circle_area(radius: float) -> float:
    return 3.14 * radius * radius  # Task to calculate the area of a circle


@flytekit.workflow
def shape_properties(radius: float = 10.2) -> float:
    return (
        conditional("shape_properties")
        .if_((radius >= 0.1) & (radius < 1.0))
        .then(calculate_circle_circumference(radius=radius))
        .else_()
        .then(calculate_circle_area(radius=radius))
    )


if __name__ == "__main__":
    radius_small = 0.5
    print(f"Circumference of circle (radius={radius_small}): {shape_properties(radius=radius_small)}")

    radius_large = 3.0
    print(f"Area of circle (radius={radius_large}): {shape_properties(radius=radius_large)}")
from flytekit import FlyteRemote, Config

execution_id = {
    "project": "flytesnacks",
    "domain": "development",
    "name": "alldzhl684ngfwn88mwh"
}

remote = FlyteRemote(Config.auto(config_file="/Users/kevin/.flyte/config-demo.yaml"), "flytesnacks", "development")
execution = remote.fetch_execution(**execution_id)
remote.sync(execution, sync_nodes=True)

list_node = []
for node_name in execution.node_executions:
    print(node_name)
    list_node.append(execution.node_executions[node_name])

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

  • This pull request introduces enhancements to the branch node execution synchronization within the Flyte remote module.
  • It adds functionality to handle branch nodes during execution, ensuring that their inputs and outputs are correctly managed.
  • The changes improve the overall execution flow and reliability of workflows that utilize branch nodes.
  • Overall, this pull request touches on the Flyte remote module, introducing enhancements to branch node execution synchronization.

@pingsutw pingsutw merged commit 6a4c2d8 into master Dec 6, 2025
114 of 117 checks passed
@flyte-bot
Copy link
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants