RoutineRun Class

A single routine run returned from the run history API.

Constructor

RoutineRun(*args: Any, **kwargs: Any)

Variables

Name Description
id
str

The unique run identifier for the routine attempt. Required.

status
str

The run status.

phase

The AgentExtensions lifecycle phase for the routine attempt. Known values are: "queued", "dispatching", "completed", and "failed".

trigger_type

The trigger type that produced the routine attempt. Known values are: "custom", "github_issue", "schedule", and "timer".

trigger_name
str

The configured trigger name that produced the routine attempt.

attempt_source

The source path that created the routine attempt. Known values are: "event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery".

action_type

The action type dispatched for the routine attempt. Known values are: "invoke_agent_responses_api" and "invoke_agent_invocations_api".

agent_id
str

The project-scoped agent identifier recorded for the routine attempt.

agent_endpoint_id
str

The legacy endpoint-scoped agent identifier recorded for the routine attempt.

conversation_id
str

The conversation identifier used by a responses API dispatch.

session_id
str

The hosted-agent session identifier used by an invocations API dispatch.

triggered_at

The logical trigger time recorded for the routine attempt.

scheduled_fire_at

The scheduled fire time recorded for timer and schedule deliveries.

started_at

The time when the underlying run started.

ended_at

The time when the underlying run reached a terminal state.

dispatch_id
str

The dispatch identifier associated with the routine attempt.

action_correlation_id
str

The downstream action correlation identifier, when available.

response_id
str

The downstream response or invocation identifier, when available.

task_id
str

The workspace task identifier linked to the routine attempt, when available.

error_status_code
int

The downstream error status code captured for a failed attempt, when available.

error_type
str

The fully qualified error type captured for a failed attempt, when available.

error_message
str

The truncated failure message captured for a failed attempt, when available.

Methods

as_dict

Return a dict that can be turned into json using json.dump.

clear

Remove all items from D.

copy
get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: D[k] if k in D, else d. :rtype: any

items
keys
pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if D is empty.

setdefault

Same as calling D.get(k, d), and setting D[k]=d if k not found :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: D[k] if k in D, else d. :rtype: any

update

Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs.

values

as_dict

Return a dict that can be turned into json using json.dump.

as_dict(*, exclude_readonly: bool = False) -> dict[str, Any]

Keyword-Only Parameters

Name Description
exclude_readonly

Whether to remove the readonly properties.

Default value: False

Returns

Type Description

A dict JSON compatible object

clear

Remove all items from D.

clear() -> None

copy

copy() -> Model

get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: D[k] if k in D, else d. :rtype: any

get(key: str, default: Any = None) -> Any

Parameters

Name Description
key
Required
default
Default value: None

items

items() -> ItemsView[str, Any]

Returns

Type Description

set-like object providing a view on D's items

keys

keys() -> KeysView[str]

Returns

Type Description

a set-like object providing a view on D's keys

pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

pop(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if D is empty.

popitem() -> tuple[str, Any]

setdefault

Same as calling D.get(k, d), and setting D[k]=d if k not found :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: D[k] if k in D, else d. :rtype: any

setdefault(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

update

Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs.

update(*args: Any, **kwargs: Any) -> None

values

values() -> ValuesView[Any]

Returns

Type Description

an object providing a view on D's values

Attributes

action_correlation_id

The downstream action correlation identifier, when available.

action_correlation_id: str | None

action_type

The action type dispatched for the routine attempt. Known values are: "invoke_agent_responses_api" and "invoke_agent_invocations_api".

action_type: str | _models.RoutineActionType | None

agent_endpoint_id

The legacy endpoint-scoped agent identifier recorded for the routine attempt.

agent_endpoint_id: str | None

agent_id

The project-scoped agent identifier recorded for the routine attempt.

agent_id: str | None

attempt_source

"event_fire", "manual_dispatch", "queued_dispatch", "schedule_delivery", and "timer_delivery".

attempt_source: str | _models.RoutineAttemptSource | None

conversation_id

The conversation identifier used by a responses API dispatch.

conversation_id: str | None

dispatch_id

The dispatch identifier associated with the routine attempt.

dispatch_id: str | None

ended_at

The time when the underlying run reached a terminal state.

ended_at: datetime | None

error_message

The truncated failure message captured for a failed attempt, when available.

error_message: str | None

error_status_code

The downstream error status code captured for a failed attempt, when available.

error_status_code: int | None

error_type

The fully qualified error type captured for a failed attempt, when available.

error_type: str | None

id

The unique run identifier for the routine attempt. Required.

id: str

phase

"queued", "dispatching", "completed", and "failed".

phase: str | _models.RoutineRunPhase | None

response_id

The downstream response or invocation identifier, when available.

response_id: str | None

scheduled_fire_at

The scheduled fire time recorded for timer and schedule deliveries.

scheduled_fire_at: datetime | None

session_id

The hosted-agent session identifier used by an invocations API dispatch.

session_id: str | None

started_at

The time when the underlying run started.

started_at: datetime | None

status

The run status.

status: str | None

task_id

The workspace task identifier linked to the routine attempt, when available.

task_id: str | None

trigger_name

The configured trigger name that produced the routine attempt.

trigger_name: str | None

trigger_type

"custom", "github_issue", "schedule", and "timer".

trigger_type: str | _models.RoutineTriggerType | None

triggered_at

The logical trigger time recorded for the routine attempt.

triggered_at: datetime | None