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 | A protobuf object representing the run definition, storing the underlying data structure for the run. |
| action | [Action](../action/action.md?sid=flyte_remote__action_action) | An Action object representing the action associated with this run, managing its state and behavior. |
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 name 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
phase()
@classmethod
def phase() - > str
Get the phase of the run.
Returns
raw_phase()
@classmethod
def raw_phase() - > phase_pb2.ActionPhase
Get the raw phase of the run.
Returns
| Type | Description |
|---|
phase_pb2.ActionPhase | |
wait()
@classmethod
def wait(
quiet: bool = False,
wait_for: Literal["terminal", "running"] = "terminal"
) - > None
Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure. This method updates the Run's internal state, ensuring that properties like run.action.phase reflect the final state after waiting completes.
Parameters
| Name | Type | Description |
|---|
| quiet | bool = False | If True, suppresses the rich progress panel output during waiting. |
| wait_for | Literal["terminal", "running"] = "terminal" | Specifies the state to wait for. 'terminal' waits until the run reaches a final state (success, failure, aborted). 'running' waits until the run enters the running phase. |
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. This method updates the Run's action state, ensuring that properties like run.action.phase reflect the current state after watching.
Parameters
| Name | Type | Description |
|---|
| cache_data_on_done | bool = False | If True, caches the final run details once the run is done. |
Returns
| Type | Description |
|---|
AsyncGenerator[[ActionDetails](../action/actiondetails.md?sid=flyte_remote__action_actiondetails), None] | An asynchronous generator that yields ActionDetails objects as the run's state updates. |
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
) - > None
Displays the logs for the run to the console. This method internally calls the action's show_logs method to retrieve and print the logs.
Parameters
| Name | Type | Description |
|---|
| attempt | `int | None` = None |
| max_lines | int = 100 | The maximum number of log lines to display. |
| show_ts | bool = False | If True, prefixes each log line with an ISO-8601 timestamp. |
| raw | bool = False | If True, displays raw log output without additional formatting. |
| filter_system | bool = False | If True, filters out system-generated log lines, showing only user-generated 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. Can be called synchronously (returns Iterator[str]) or asynchronously via .aio() (returns AsyncIterator[str]).
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] | |
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) | |
@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) | |
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) | |
url()
@classmethod
def url() - > str
Get the URL of the run.
Returns
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
abort()
@classmethod
def abort(
reason: str = "Manually aborted from the SDK api."
) - > None
Aborts / Terminates the run.
Parameters
| Name | Type | Description |
|---|
| reason | str = "Manually aborted from the SDK api." | The reason for aborting the run. |
Returns
done()
@classmethod
def done() - > bool
Check if the run is done.
Returns
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) | |