Skip to content

Full Observability

Every task in AsyncQueue carries its full execution history. You always know the current status, how many retries occurred, the callback response, and the exact timing.

Each task has a status that updates as it progresses:

StatusMeaning
pendingQueued and waiting for a worker
delayedScheduled for future execution
processingWorker is executing the callback
waitingCallback succeeded, awaiting an external signal
completedCallback returned a response (2xx, 3xx, or 4xx)
failedAll retry attempts exhausted
timeoutExceeded the configured maxWaitTime
cancelledCancelled before processing started

Completed tasks include the full callback response:

{
"task": {
"status": "completed",
"retryCount": 1,
"result": {
"statusCode": 200,
"headers": {"content-type": "application/json"},
"body": "{\"processed\": true}",
"duration": 2341
},
"createdAt": "2024-01-15T10:30:00.000Z",
"startedAt": "2024-01-15T10:30:01.000Z",
"completedAt": "2024-01-15T10:30:03.341Z"
}
}

Failed tasks include the error message:

{
"task": {
"status": "failed",
"retryCount": 3,
"error": "Server error: HTTP 500 - Internal Server Error",
"createdAt": "2024-01-15T10:30:00.000Z",
"completedAt": "2024-01-15T10:31:15.000Z"
}
}

Track a task until it finishes with the wait parameter. The API holds the connection (up to 25 seconds) and returns immediately when the task status changes:

Terminal window
# Wait up to 20 seconds for a status change
curl "https://api.asyncqueue.io/v1/tasks/550e8400-e29b-41d4-a716-446655440000?wait=20" \
-H "Authorization: Bearer your-api-key"

If the status changes during the wait window, the response is returned instantly. If it does not change within the timeout, the current state is returned and you can reconnect. This gives near-instant updates without the overhead of constant polling.

Query tasks by status, with pagination:

Terminal window
# All failed tasks
curl "https://api.asyncqueue.io/v1/tasks?status=failed&limit=100" \
-H "Authorization: Bearer your-api-key"
# Recent tasks, newest first
curl "https://api.asyncqueue.io/v1/tasks?sortOrder=desc&limit=20" \
-H "Authorization: Bearer your-api-key"
  • How many tasks are pending right now?
  • Which tasks failed in the last hour and why?
  • How long did a specific callback take to respond?
  • How many retries did a task need before succeeding?
  • What was the exact response from the callback endpoint?