Task Queues
Querying Task Status
You can check the status of any task by querying the task
API:
Task Statuses
Your payload will return the status of the task. These are the possible statuses for a task:
Status | Description |
---|---|
PENDING | The task is enqueued and has not started yet. |
RUNNING | The task is running. |
COMPLETE | The task completed without any errors. |
RETRY | The task is being retried. Defaults to 3, unless max_retries is provided in the function decorator. |
CANCELLED | The task was cancelled by the user. |
TIMEOUT | The task timed out, based on the timeout provided in the function decorator. |
EXPIRED | The task remained in the queue and was never picked up by a worker. |
FAILED | The task did not complete successfully. |
Request
Response
The response to /task
returns the following data:
Field | Type | Description |
---|---|---|
id | string | The unique identifier of the task. |
started_at | string | The timestamp when the task started, in ISO 8601 format. Null if the task hasn’t started yet. |
ended_at | string | The timestamp when the task ended, in ISO 8601 format. Null if the task is still running or hasn’t started. |
status | string | The current status of the task (e.g., COMPLETE, RUNNING, etc.). |
container_id | string | The identifier of the container running the task. |
updated_at | string | The timestamp when the task was last updated, in ISO 8601 format. |
created_at | string | The timestamp when the task was created, in ISO 8601 format. |
outputs | array | An array containing the outputs of the task. |
stats | object | An object containing statistics about the task’s execution environment. |
stats.active_containers | integer | The number of active containers for the task. |
stats.queue_depth | integer | The depth of the queue for the deployment. |
stub | object | An object containing detailed information about the task’s configuration and deployment. |
stub.id | string | The identifier of the deployment stub. |
stub.name | string | The name of the deployment stub. |
stub.type | string | The type of the deployment stub. |
stub.config | string | The configuration details of the deployment stub in JSON format. |
stub.config_version | integer | The version number of the deployment stub configuration. |
stub.object_id | integer | The object identifier associated with the deployment stub. |
stub.created_at | string | The timestamp when the deployment stub was created, in ISO 8601 format. |
stub.updated_at | string | The timestamp when the deployment stub was last updated, in ISO 8601 format. |
Here’s what the response payload looks like as JSON:
Cancelling Tasks
Tasks can be cancelled through the api.beam.cloud/v2/task/cancel/
endpoint.
Request
This API accepts a list of tasks, which can be passed in like this:
Response
200
Was this page helpful?