Task Queue
Querying Task Status
You can check the status of any task by querying the task
API:
https://api.beam.cloud/v2/task/{TASK_ID}/
This API returns the following data:
- Task ID
- Time the task started, or null if it hasn’t started yet (but is in the queue)
- Time the task ended, or null if it is still running, or hasn’t started yet
- The status of the task
Request
curl -X GET \
--header "Content-Type: application/json" \
--user "{API_TOKEN}" \
"https://api.beam.cloud/v2/task/{TASK_ID}"
Response
{
"id": "8a918422-9b2c-4f0d-89ee-99e3620f5d2e",
"started_at": "2024-05-04T22:08:25.307049Z",
"ended_at": "2024-05-04T22:08:26.55161Z",
"status": "COMPLETE",
"container_id": "endpoint-577a48b1-9cc4-4cc3-8d45-08a28350346c-32820001",
"updated_at": "2024-05-04T22:08:26.553457Z",
"created_at": "2024-05-04T22:08:18.460463Z",
"stub": {
"id": "577a48b1-9cc4-4cc3-8d45-08a28350346c",
"name": "endpoint/deployment/test2:my_func",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z"
}
}
Task Statuses
These are all possible states 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. |
FAILED | The task did not complete successfully. |
Was this page helpful?