Skip to content

Conversation

CtfChan
Copy link

@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 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.

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 <[email protected]>
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.

1 participant