BREAGEN Logo
Entity Management

Celery Worker

The Celery Worker service provides functionality to manage and monitor asynchronous tasks, including starting tasks, checking their status, retrieving results, and clearing task queues.

Celery Worker Operations

Start Task GET /v1/celery_worker/start

Resource URL/v1/celery_worker/start
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/celery_worker/start' \
-H 'accept: application/json'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"id": "task_123456",
		"status": "PENDING"
	}
}

Check Task Status GET /v1/celery_worker/status

Resource URL/v1/celery_worker/status
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
task_idstringYesID of task to check

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/celery_worker/status?task_id=task_123456' \
-H 'accept: application/json'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"id": "task_123456",
		"status": "IN_PROGRESS"
	}
}

Get Task Result GET /v1/celery_worker/result

Resource URL/v1/celery_worker/result
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Query Parameters

ParameterTypeRequiredDescription
task_idstringYesID of task to get result

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/celery_worker/result?task_id=task_123456' \
-H 'accept: application/json'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"task_id": "task_123456",
		"status": "COMPLETED",
		"result": {
			"processed_items": 100,
			"completion_time": "2024-06-12T10:30:00Z"
		}
	}
}

Clear Tasks GET /v1/celery_worker/clear

Resource URL/v1/celery_worker/clear
Response FormatJSON
Requires AuthenticationYes
Rate LimitedYes
HTTPSYes

Example Request

curl -X 'GET' \
'https://api.braegen.ai/v1/celery_worker/clear' \
-H 'accept: application/json'

Example Response

{
	"success": true,
	"status": "200 OK",
	"data": {
		"message": "Task queue cleared successfully",
		"cleared_tasks": 5
	}
}

HTTP Response Codes

HTTP CodeMessage
200Success
400Bad Request
401Unauthorized
404Task not found
500Internal Server Error

Common Error Responses

Task Not Found

{
	"success": false,
	"status": "404 NOT_FOUND",
	"message": "Task not found",
	"data": null
}

Invalid Task ID

{
	"success": false,
	"status": "400 BAD_REQUEST",
	"message": "Invalid task ID format",
	"data": null
}

Task Queue Error

{
	"success": false,
	"status": "500 INTERNAL_SERVER_ERROR",
	"message": "Error clearing task queue",
	"data": null
}

On this page