Skip to main content

TaskRuns

Runs of the organization’s tasks. Obtain it from Wherobots.task_runs; do not build it directly.

Parameters

BaseClient
required
The shared API connection.

cancel()

Request that a run stop (POST /task-runs/{id}/cancel). The run moves to CANCELLING and then CANCELLED once the stop is confirmed.

Parameters

str
required
The run’s id.

Raises

  • WherobotsAPIError: On HTTP failures.

cost()

Fetch what a run cost (GET /task-runs/{id}/cost).

Parameters

str
required
The run’s id.

Returns

TaskRunCost
The run’s cost; is_settling is True while it may still change.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures, or a cost the SDK cannot read (rather than reporting it as zero).

get()

Fetch a run with its inputs and results (GET /task-runs/{id}).

Parameters

str
required
The run’s id.

Returns

TaskRun
The run.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures.

list()

List task runs, newest first (GET /task-runs).

Parameters

str | None
default:"None"
Only runs of this task; a trailing * matches a prefix.
TaskRunState | str | Sequence[TaskRunState | str] | None
default:"None"
Only runs in this state, or in any of these states.
datetime | None
default:"None"
Only runs submitted after this instant; a naive datetime is read as local time.
int
default:"50"
Page size, 1 to 100.
int
default:"0"
How many matching runs to skip.

Returns

OffsetPage[TaskRunSummary]
One page of runs; OffsetPage.next_offset fetches the next.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures.

logs()

Fetch a page of a run’s logs (GET /task-runs/{id}/logs).

Parameters

str
required
The run’s id.
str | None
default:"None"
The previous page’s next_since; omit for the first page.

Returns

TaskRunLogs
Log lines logged after since.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures.

Tasks

The tasks the caller’s organization can run. Obtain it from Wherobots.tasks; do not build it directly.

Parameters

BaseClient
required
The shared API connection.
str | None
default:"None"
Region new runs use when run is given none; None lets the API apply the organization’s default region.

get()

Fetch a task with its input and output schemas (GET /tasks/{name}).

Parameters

str
required
The task’s name.

Returns

Task
The task.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures.

list()

List tasks, ordered by name (GET /tasks).

Parameters

Region | str | Sequence[Region | str] | None
default:"None"
Only tasks that can run in this region, or in any of these regions.
int
default:"50"
Page size, 1 to 100.
int
default:"0"
How many matching tasks to skip.

Returns

OffsetPage[TaskSummary]
One page of tasks; OffsetPage.next_offset fetches the next.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures.

run()

Start a run of a task (POST /tasks/{name}/runs).

Parameters

str
required
The task’s name.
Mapping[str, object] | None
default:"None"
Inputs matching the task’s input_schema.
Region | str | None
default:"None"
Region to run in; defaults to the configured region, then to the organization’s default region.
str | None
default:"None"
A name for the run, shown as TaskRun.name.

Returns

TaskRunSummary
The new run; poll TaskRuns.get with its task_run_id.

Raises

  • WherobotsAPIError: On HTTP or JSON-parsing failures, including inputs the task’s schema rejects.