Skip to content

Conversation

@CtfChan
Copy link
Contributor

@CtfChan CtfChan commented Oct 10, 2025

Tracking issue

N/A

Why are the changes needed?

Currently, the pyflyte run command supports executing remote tasks (remote-task) and remote launch plans (remote-launchplan), but lacks support for executing exact version of remote workflows directly. This creates an inconsistent user experience and limits flexibility when users want to execute workflows that are already registered in a Flyte backend.

What changes were proposed in this pull request?

This PR adds support for executing remote workflows via the pyflyte run remote-workflow command, bringing feature parity with the existing remote task and launch plan execution capabilities.

Changes include:

  1. Added WORKFLOW_LAUNCHER constant to DynamicEntityLaunchCommand class
  2. Updated _fetch_entity() method to handle the workflow launcher type by calling fetch_workflow() on the remote instance
  3. Added support for version-specific workflow execution using the name:version syntax
  4. Updated get_command() in RemoteEntityGroup to create a DynamicEntityLaunchCommand with the workflow launcher when the command is remote-workflow
  5. Added comprehensive unit tests (test_remote_workflow and test_remote_workflow_with_version) to verify the functionality

How was this patch tested?

Added two new unit tests in tests/flytekit/unit/cli/pyflyte/test_run.py:

  1. test_remote_workflow: Tests basic remote workflow execution with parameters
  2. test_remote_workflow_with_version: Tests version-specific workflow execution using the name:version syntax

Both tests:

  • Mock FlyteRemote and run_remote to verify correct behavior
  • Use the CliRunner to simulate command-line execution
  • Verify that fetch_workflow() is called with the correct arguments
  • Ensure the workflow executes successfully with provided inputs

All tests pass successfully:

pytest tests/flytekit/unit/cli/pyflyte/test_run.py::test_remote_workflow tests/flytekit/unit/cli/pyflyte/test_run.py::test_remote_workflow_with_version -v

Setup process

N/A

Screenshots

N/A

Check all the applicable boxes

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

Related PRs

N/A

Docs link

N/A

Summary by Bito

This pull request enhances the pyflyte run command by enabling the execution of remote workflows, introducing a WORKFLOW_LAUNCHER constant, and modifying the _fetch_entity method for workflow compatibility. It also supports version-specific workflows and includes comprehensive unit tests for reliability.

@welcome
Copy link

welcome bot commented Oct 10, 2025

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

This commit adds support for executing remote workflows via the
`pyflyte run remote-workflow` command, similar to the existing
`remote-task` and `remote-launchplan` commands.

Changes include:
- Add WORKFLOW_LAUNCHER constant to DynamicEntityLaunchCommand
- Update _fetch_entity() to handle workflow launcher type
- Add workflow version support (name:version syntax)
- Update get_command() in RemoteEntityGroup to create workflow launcher
- Add comprehensive unit tests for remote workflow execution

Signed-off-by: CtfChan <23730526+CtfChan@users.noreply.github.com>
@machichima
Copy link
Member

machichima commented Nov 11, 2025

Hi @CtfChan
I think the pyflyte run remote-workflow is already supported (I tested in the newest version). Could you check if it works for you?
Thank you!

image

@CtfChan CtfChan changed the title Add remote workflow execution support to pyflyte run Add remote workflow version execution support to pyflyte run Nov 18, 2025
@CtfChan
Copy link
Contributor Author

CtfChan commented Nov 18, 2025

Hi @machichima. I meant for this to allow users to execute a specific workflow version via CLI. I found this issue a while back not sure if you've seen this before flyteorg/flyte#6404.

Copy link
Member

@machichima machichima left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. LGTM
Thank you so much!

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.58%. Comparing base (531d2aa) to head (55ac7ff).
⚠️ Report is 3 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (531d2aa) and HEAD (55ac7ff). Click for more details.

HEAD has 9 uploads less than BASE
Flag BASE (531d2aa) HEAD (55ac7ff)
11 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3338       +/-   ##
===========================================
- Coverage   76.21%   46.58%   -29.63%     
===========================================
  Files         216      216               
  Lines       22700    22629       -71     
  Branches     2975     2974        -1     
===========================================
- Hits        17301    10542     -6759     
- Misses       4540    11560     +7020     
+ Partials      859      527      -332     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@machichima machichima merged commit 21ffdc3 into flyteorg:master Dec 5, 2025
115 of 119 checks passed
@welcome
Copy link

welcome bot commented Dec 5, 2025

Congrats on merging your first pull request! 🎉

@flyte-bot
Copy link
Contributor

Bito Review Skipped - No Changes Detected

Bito didn't review this pull request because we did not detect any changes in the pull request to review.

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.

3 participants