Launch Flows

Once flows are defined, they can be launched using the Flyte CLI through a Workspace or Job. Flows can also be relaunched from the UI once they have been registered into Domino.

Launch a new flow

A new flow must be launched using the Flyte CLI via the pyflyte run command.

We assume that:

  • A flow is defined inside a workflow.py file.

  • The flow is defined using a method called test_workflow.

  • The flow takes two input arguments called inputA (int) and inputB (string).

Therefore, the following command can be used to run the flow:

pyflyte run --remote workflow.py test_workflow --inputA 5 --inputB "Hello"

The above command can be executed inside a Workspace terminal or as the start command for a Job. Once it is executed, the flow is automatically registered and execution should start immediately.

Set a name

A name is automatically generated for each run, but you can explicitly set the name as well:

pyflyte run --remote --name MY_CUSTOM_NAME workflow.py test_workflow --inputA 5 --inputB "Hello"

Add tags

You can also add tags to a run execution:

pyflyte run --remote --tag MY_TAG=MY_VALUE workflow.py test_workflow --inputA 5 --inputB "Hello"

Relaunch an existing flow

After a flow has been triggered for the first time, it can be relaunched in a number of ways directly through the UI.

Reproduce the exact same result

If you simply want to reproduce the exact same result, a flow can be relaunched from the Domino UI:

  1. Navigate to Flows > Runs pivot > Run name and click Re-run from the dropdown.

Rerun Flow

Rerun with different parameters

To re-execute a flow using different input parameters:

  1. Navigate to Flows > Runs pivot > Run name and click View graph.

    Graph Button

  2. Click on Relaunch in the Flyte UI.

    Flyte Relaunch Button

  3. Change the parameters accordingly and click Launch to trigger the flow with the new parameters.

    Flow Inputs

Recover from failure

If a task fails due to unexpected transient issues (job timed out, out-of-capacity issues, spot instance pre-emption, internal server error, etc.), it is possible to continue execution from the point of failure rather than restarting the entire flow execution from the beginning.

When this happens, you can click the Recover button of the execution view in the Domino Flows UI. This will resume the execution from the point of failure by re-using the cached results that have already been computed.

Recover From Failure

Note
This capability is meant for transient issues only. If an execution has failed due to a user error in the code, you must relaunch the flow from the CLI after making your changes so that a new version of the code can be registered.

Rerun a single task

During experimentation, you may be focused on specific parts of the flow and want to execute just a single task with different input parameters. To do this in Flows:

  1. Click on the relevant task in the Flyte UI, then click Rerun.

    Task Rerun Button

  2. Specify the parameters accordingly and click Launch.

    Task Inputs

Note
The format field must be filled in if the input type was originally defined with a format.
Note
Relaunching flows through the UI only works in scenarios where the flow definition has not changed. If changes are being made to the original flow definition, they must be launched through the CLI so that a new version can be registered.

Next steps

Once you have properly launched the flow, learn how to monitor flow results.