tasks

Run a task

Record a request to run a task, and answer with it PENDING.

region may be omitted for the organization's default; whichever it was is stored on the run, since the default can change afterwards.

The run is not launched here. It, and its workload row representing the intent to launch, are recorded together; the id is handed to the async worker, which submits the backend execution and moves that row on. The run stays PENDING until then.

201: the run, PENDING. 400: the task runs nowhere, or not in this region, or the inputs do not satisfy its schema, or the organization is not set up to run in the region; an error naming every problem. 404: no task of this name the caller's organization may see — the same answer a read gives, so asking to run reveals no more than reading. 503: the run was recorded but its launch could not be dispatched; the run is marked FAILED and the request may be retried.

post/tasks/{taskName}/runs

Request

  • Base URL: https://api.cloud.wherobots.com
  • URL: https://api.cloud.wherobots.com/tasks/{taskName}/runs
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Path parameters

taskNamestring required

The name of the task.

Request body

regionstring nullable
inputsobject
namestring nullable

Response

Successful Response

taskRunIdstring required
taskNamestring required

Current mutable Task display metadata, not historical identity.

taskIdstring nullable
taskTriggerIdstring nullable
type'uniontask' | 'scripttask'

Concrete task polymorphic identities.

runSource'manual' | 'schedule' | 'backfill'

Origin of a run, independent of its backend.

batchTimestring date-time nullable
windowStartstring date-time nullable
windowEndstring date-time nullable
failureClass'QUOTA_REJECTED' | 'CONFIG_REJECTED' | 'USER_CODE' | 'PLATFORM' | 'TIMEOUT'

Terminal dispatch and execution failure categories.

runAsIdstring nullable
requestedByIdstring nullable
state'PENDING' | 'SUBMITTED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'TIMED_OUT' | 'CANCELLING' | 'CANCELLED' | 'UNKNOWN' | 'SKIPPED' | 'MISSED' required
regionstring required
submittedAtstring date-time required
startedAtstring date-time nullable
endedAtstring date-time nullable
durationSecondsinteger nullable

How long the backend executed the run, from its start to its end (or to now, while running). 0 if it never started there. A cached run executes nothing, so this is the moment it took to return the stored result, not how long the result took to produce.

Changes

No recorded changes to this operation across all 1 revision of this API.