Skip to main content

Run

A class representing a run of a task. It is used to manage the run of a task and its state on the remote Union API.

Attributes​

AttributeTypeDescription
pb2run_definition_pb2.RunThe underlying protobuf message representing the run definition and its current state.
action[Action](../action/action.md?sid=flyte_remote__action_action)The Action object associated with this run, used to manage execution state and lifecycle.

Methods​


listall()​

@classmethod
def listall(
in_phase: Tuple[ActionPhase | str, ...]| None = None,
task_name: str | None = None,
task_version: str | None = None,
created_by_subject: str | None = None,
sort_by: Tuple[str, Literal["asc", "desc"]]| None = None,
limit: int = 100,
project: str | None = None,
domain: str | None = None,
created_at: TimeFilter | None = None,
updated_at: TimeFilter | None = None
) - > AsyncIterator[[Run](run.md?sid=flyte_remote__run_run)]

Get all runs for the current project and domain.

Parameters​

NameTypeDescription
in_phase`Tuple[ActionPhasestr, ...]
task_name`strNone` = None
task_version`strNone` = None
created_by_subject`strNone` = None
sort_by`Tuple[str, Literal["asc", "desc"]]None` = None
limitint = 100The maximum number of runs to return.
project`strNone` = None
domain`strNone` = None
created_at`TimeFilterNone` = None
updated_at`TimeFilterNone` = None

Returns​

TypeDescription
AsyncIterator[[Run](run.md?sid=flyte_remote__run_run)]An iterator of runs.

get()​

@classmethod
def get(
name: str
) - > [Run](run.md?sid=flyte_remote__run_run)

Get the current run.

Parameters​

NameTypeDescription
namestrThe unique identifier of the run to retrieve.

Returns​

TypeDescription
[Run](run.md?sid=flyte_remote__run_run)The current run.

name()​

@classmethod
def name() - > str

Get the name of the run.

Returns​

TypeDescription
strThe unique name identifier of the run.

phase()​

@classmethod
def phase() - > str

Get the phase of the run.

Returns​

TypeDescription
strThe current execution phase as a string.

raw_phase()​

@classmethod
def raw_phase() - > phase_pb2.ActionPhase

Get the raw phase of the run.

Returns​

TypeDescription
phase_pb2.ActionPhaseThe protobuf representation of the current action phase.

wait()​

@classmethod
def wait(
quiet: bool = False,
wait_for: Literal["terminal", "running"] = "terminal"
) - > null

Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.

Parameters​

NameTypeDescription
quietbool = FalseIf True, suppresses the progress panel output.
wait_forLiteral["terminal", "running"] = "terminal"The state to wait for before returning control to the caller.

Returns​

TypeDescription
null

watch()​

@classmethod
def watch(
cache_data_on_done: bool = False
) - > AsyncGenerator[[ActionDetails](../action/actiondetails.md?sid=flyte_remote__action_actiondetails), None]

Watch the run for updates, updating the internal Run state with latest details.

Parameters​

NameTypeDescription
cache_data_on_donebool = FalseWhether to cache the final state data once the run reaches a terminal state.

Returns​

TypeDescription
AsyncGenerator[[ActionDetails](../action/actiondetails.md?sid=flyte_remote__action_actiondetails), None]An async generator yielding updated action details as they occur.

show_logs()​

@classmethod
def show_logs(
attempt: int | None = None,
max_lines: int = 100,
show_ts: bool = False,
raw: bool = False,
filter_system: bool = False
) - > null

Displays the logs for the run in the console.

Parameters​

NameTypeDescription
attempt`intNone` = None
max_linesint = 100The maximum number of log lines to display.
show_tsbool = FalseWhether to include timestamps in the log output.
rawbool = FalseWhether to show raw logs without formatting.
filter_systembool = FalseWhether to filter out system-level logs.

Returns​

TypeDescription
null

get_logs()​

@classmethod
def get_logs(
attempt: int | None = None,
filter_system: bool = False,
show_ts: bool = False
) - > AsyncGenerator[str, None]

Get logs for the run as an iterator of strings.

Parameters​

NameTypeDescription
attempt`intNone` = None
filter_systembool = FalseIf True, filter out system-generated log lines.
show_tsbool = FalseIf True, prefix each line with an ISO-8601 timestamp.

Returns​

TypeDescription
AsyncGenerator[str, None]An iterator of log line strings.

details()​

@classmethod
def details() - > [RunDetails](rundetails.md?sid=flyte_remote__run_rundetails)

Get the details of the run. This is a placeholder for getting the run details.

Returns​

TypeDescription
[RunDetails](rundetails.md?sid=flyte_remote__run_rundetails)The detailed metadata and status information for the run.

inputs()​

@classmethod
def inputs() - > [ActionInputs](../action/actioninputs.md?sid=flyte_remote__action_actioninputs)

Get the inputs of the run. This is a placeholder for getting the run inputs.

Returns​

TypeDescription
[ActionInputs](../action/actioninputs.md?sid=flyte_remote__action_actioninputs)The input values used for this specific run.

outputs()​

@classmethod
def outputs() - > [ActionOutputs](../action/actionoutputs.md?sid=flyte_remote__action_actionoutputs)

Get the outputs of the run. This is a placeholder for getting the run outputs.

Returns​

TypeDescription
[ActionOutputs](../action/actionoutputs.md?sid=flyte_remote__action_actionoutputs)The output values produced by the run upon completion.

url()​

@classmethod
def url() - > str

Get the URL of the run.

Returns​

TypeDescription
strThe console URL for viewing the run in a web browser.

get_debug_url()​

@classmethod
def get_debug_url() - > str

Get the debug URL of the run. Returns None if the VS Code Debugger log entry is not yet available in the action details.

Returns​

TypeDescription
strThe VS Code debugger URL or None if unavailable.

abort()​

@classmethod
def abort(
reason: str = "Manually aborted from the SDK api."
) - > null

Aborts / Terminates the run.

Parameters​

NameTypeDescription
reasonstr = "Manually aborted from the SDK api."The explanation for terminating the run.

Returns​

TypeDescription
null

done()​

@classmethod
def done() - > bool

Check if the run is done.

Returns​

TypeDescription
boolTrue if the run has reached a terminal state, False otherwise.

sync()​

@classmethod
def sync() - > [Run](run.md?sid=flyte_remote__run_run)

Sync the run with the remote server. This is a placeholder for syncing the run.

Returns​

TypeDescription
[Run](run.md?sid=flyte_remote__run_run)The synchronized Run object.