Skip to main content
GET
/
batch
/
jobs
/
{batch_job_id}
/
redis-status
Get Redis Job Status
curl --request GET \
  --url https://api.talkifai.dev/batch/jobs/{batch_job_id}/redis-status \
  --header 'Authorization: Bearer <token>'
{
  "batchJobId": "<string>",
  "databaseStatus": "scheduled",
  "scheduledJobId": "<string>",
  "scheduledStartTime": "2023-11-07T05:31:56Z",
  "redisJobInfo": {
    "job_id": "<string>",
    "in_defer_queue": true,
    "job_metadata_exists": true,
    "scheduled_time": "2023-11-07T05:31:56Z",
    "note": "<string>"
  }
}

Overview

Retrieves the Redis-side status of a scheduled batch job. This endpoint is primarily for debugging and troubleshooting scheduled jobs. Use this to:
  • Verify a scheduled job was created correctly
  • Check if job still exists in Redis before cancellation
  • Confirm job was removed after cancellation
  • Debug scheduling issues
This endpoint is for debugging purposes only. For normal operations, use Get Batch Job Detail.

Request

GET /batch/jobs/{batch_job_id}/redis-status

Path Parameters

ParameterTypeRequiredDescription
batch_job_idstringUnique batch job identifier

Response

{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00",
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}

Response Fields

FieldTypeDescription
batchJobIdstringBatch job ID
databaseStatusstringJob status in database
scheduledJobIdstringRedis/ARQ job ID
scheduledStartTimestringScheduled time (ISO 8601, UTC)
redisJobInfoobjectRedis-side job information

Redis Job Info Object

FieldTypeDescription
job_idstringARQ job identifier
in_defer_queuebooleanWhether in defer queue (always false for ARQ 0.26.3+)
job_metadata_existsbooleanWhether job key exists in Redis
scheduled_timestringScheduled execution time from Redis
notestringImplementation note about ARQ version

Examples

Example 1: Check Scheduled Job Status

curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response (Job Exists):
{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00",
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}
Response (Job Not Found in Redis):
{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": false,
    "scheduled_time": null,
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}

Example 2: Check Non-Scheduled Job

curl -X GET "https://api.talkifai.com/batch/jobs/batch_running/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response:
{
  "batchJobId": "batch_running",
  "databaseStatus": "running",
  "scheduledJobId": null,
  "scheduledStartTime": null,
  "redisJobInfo": null
}

Example 3: Debug Cancellation

Before cancelling a scheduled job, verify it exists:
# Check if job exists in Redis
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"

# If redisJobInfo.job_metadata_exists is true, proceed with cancellation
curl -X POST "https://api.talkifai.com/batch/jobs/batch_xyz789/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY"

Interpretation Guide

Job Exists in Redis

{
  "redisJobInfo": {
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00"
  }
}
Meaning: Job is properly scheduled and will execute at the scheduled time.

Job Not Found in Redis

{
  "redisJobInfo": {
    "job_metadata_exists": false,
    "scheduled_time": null
  }
}
Possible causes:
  • Job already executed (dequeued by worker)
  • Job was cancelled previously
  • Database and Redis are out of sync
  • Job creation failed silently

No Scheduled Job ID

{
  "scheduledJobId": null,
  "redisJobInfo": null
}
Meaning: Job is not scheduled (either running, completed, pending, or was never scheduled).

Error Handling

404 Not Found

{
  "detail": "Batch job not found"
}

500 Internal Server Error

{
  "detail": "Failed to get Redis job status"
}

Troubleshooting

Issue: Job Shows “scheduled” But Never Started

Check Redis status:
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
If job_metadata_exists is false:
  • Job may have been lost (Redis restart, crash)
  • Database and Redis are out of sync
  • Solution: Use Start Batch Job to manually start

Issue: Cancellation Returns “Job Not Found”

Check Redis status first:
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
If job_metadata_exists is false:
  • Job already executed or was never in Redis
  • Cancellation will still update database
  • Expected behavior: redisJobCancelled: false in response

Issue: Scheduled Time Wrong

Verify timezone conversion:
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
Compare scheduledStartTime (database) with redisJobInfo.scheduled_time (Redis):
  • They should match (within seconds)
  • If different, there may be a timezone conversion issue

Authorizations

Authorization
string
header
required

Your TalkifAI API key. Get it from Studio → Settings → API Keys.

Path Parameters

batch_job_id
string
required

Response

Redis job status

batchJobId
string
databaseStatus
string
Example:

"scheduled"

scheduledJobId
string | null
scheduledStartTime
string<date-time> | null
redisJobInfo
object