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
| Attribute | Type | Description |
|---|
| pb2 | run_definition_pb2.Run | The 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
| Name | Type | Description |
|---|
| in_phase | `Tuple[ActionPhase | str, ...] |
| 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 | The maximum number of runs to return. |
| project | `str | None` = None |
| domain | `str | None` = None |
| created_at | `TimeFilter | None` = None |
| updated_at | `TimeFilter | None` = None |
Returns
| Type | Description |
|---|
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
| Name | Type | Description |
|---|
| name | str | The unique identifier of the run to retrieve. |
Returns
| Type | Description |
|---|
[Run](run.md?sid=flyte_remote__run_run) | The current run. |
name()
@classmethod
def name() - > str
Get the name of the run.
Returns
| Type | Description |
|---|
str | The unique name identifier of the run. |
phase()
@classmethod
def phase() - > str
Get the phase of the run.
Returns
| Type | Description |
|---|
str | The current execution phase as a string. |
raw_phase()
@classmethod
def raw_phase() - > phase_pb2.ActionPhase
Get the raw phase of the run.
Returns
| Type | Description |
|---|
phase_pb2.ActionPhase | The 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
| Name | Type | Description |
|---|
| quiet | bool = False | If True, suppresses the progress panel output. |
| wait_for | Literal["terminal", "running"] = "terminal" | The state to wait for before returning control to the caller. |
Returns
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
| Name | Type | Description |
|---|
| cache_data_on_done | bool = False | Whether to cache the final state data once the run reaches a terminal state. |
Returns
| Type | Description |
|---|
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
| Name | Type | Description |
|---|
| attempt | `int | None` = None |
| max_lines | int = 100 | The maximum number of log lines to display. |
| show_ts | bool = False | Whether to include timestamps in the log output. |
| raw | bool = False | Whether to show raw logs without formatting. |
| filter_system | bool = False | Whether to filter out system-level logs. |
Returns
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
| Name | Type | Description |
|---|
| attempt | `int | None` = None |
| filter_system | bool = False | If True, filter out system-generated log lines. |
| show_ts | bool = False | If True, prefix each line with an ISO-8601 timestamp. |
Returns
| Type | Description |
|---|
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
| Type | Description |
|---|
[RunDetails](rundetails.md?sid=flyte_remote__run_rundetails) | The detailed metadata and status information for the run. |
@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
| Type | Description |
|---|
[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
| Type | Description |
|---|
[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
| Type | Description |
|---|
str | The 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
| Type | Description |
|---|
str | The 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
| Name | Type | Description |
|---|
| reason | str = "Manually aborted from the SDK api." | The explanation for terminating the run. |
Returns
done()
@classmethod
def done() - > bool
Check if the run is done.
Returns
| Type | Description |
|---|
bool | True 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
| Type | Description |
|---|
[Run](run.md?sid=flyte_remote__run_run) | The synchronized Run object. |