Job Format
Last synchronized at 2026-01-12T22:47:32Z
Sidekiq serializes jobs to Redis in JSON format. Each Job is a simple Hash of data.
Job
At bare minimum, a job requires five fields:
{
"class": "SomeWorker",
"jid": "b4a577edbccf1d805744efa9", // 12-byte random number as 24 char hex string
"args": [1, "arg", true],
"created_at": 1234567890123,
"enqueued_at": 1234567890123
}
args is splatted into an instance of the worker class’s perform method. Note that enqueued_at isn’t added to the payload for scheduled jobs. They get the enqueued_at field when they are pushed onto a queue.
ActiveJob Middleware Format
If writing server middleware and have integrated Sidekiq with ActiveJob the format provided for the second argument of
call is as follows:
{
"class": "ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper",
"wrapped": "SomeWorker",
"queue": "default",
"args":[
{
"job_class": "SomeWorker",
"job_id": "b4a577edbccf1d805744efa9",
"provider_job_id": null,
"queue_name": "default",
"priority": null,
"arguments": ["some",["argument","value"]],
"executions": 0,
"locale": "en",
"attempt_number": 1
}
],
"retry": true,
"wait": "0.1",
"jid": "d774900367dc8b2962b2479c", // Note different JID
"created_at": 1234567890123,
"locale": "en",
"enqueued_at": 1234567890123,
"error_message": null,
"error_class": null,
"failed_at": null,
"retry_count": 0,
"retried_at": null
}
Worker Options
When a job is serialized, the options for the Worker are serialized as part of the job payload:
{
"queue": "default",
"retry": true
}
Scheduled Jobs
The at element stores when a job is scheduled to execute, in Unix epoch format:
{
"at": 1234567890.123
}
Retries
Sidekiq’s retry feature adds several elements to the job payload, necessary for documenting the error in the UI:
{
"retry_count": 2, // number of times we've retried so far
"error_message": "wrong number of arguments (2 for 3)", // the exception message
"error_class": "ArgumentError", // the exception class
"error_backtrace": ["line 0", "line 1", ...], // some or all of the exception's backtrace, optional, array of strings
"failed_at": 1234567890123, // the first time the job failed
"retried_at": 1234567890123 // the last time the job failed
}
The last two items are timestamps.
Changes
Before 8.0, Sidekiq used epoch seconds as a Float, 1234567890.123, for all *_at timestamps. Sidekiq 8.0 changes all *_at timestamps to use Integer millseconds since epoch. Instead of 1234567890.123, the value will be 1234567890123. This was done to avoid floating point numbers (which have a long, sad history in JSON and JS).
- API
- Active-Job
- Advanced-Options
- Batches
- Best-Practices
- Build-vs-Buy
- Bulk-Queueing
- Comm-Installation
- Commercial-FAQ
- Commercial-Support
- Commercial-collaboration
- Complex-Job-Workflows-with-Batches
- Delayed-extensions
- Deployment
- Devise
- Embedding
- Ent-Encryption
- Ent-Historical-Metrics
- Ent-Leader-Election
- Ent-Multi-Process
- Ent-Periodic-Jobs
- Ent-Rate-Limiting
- Ent-Rolling-Restarts
- Ent-Unique-Jobs
- Ent-Web-UI
- Error-Handling
- FAQ
- Getting-Started
- Heroku
- Home
- Iteration
- Job-Format
- Job-Lifecycle
- Kubernetes
- Logging
- Memory
- Metrics
- Middleware
- Miscellaneous-Features
- Monitoring
- Pro-API
- Pro-Expiring-Jobs
- Pro-Metrics
- Pro-Reliability-Client
- Pro-Reliability-Server
- Pro-Web-UI
- Problems-and-Troubleshooting
- Profiling
- Really-Complex-Workflows-with-Batches
- Related-Projects
- Reliability
- Scaling
- Scheduled-Jobs
- Sharding
- Signals
- Testimonials
- Testing
- The-Basics
- Using-Dragonfly
- Using-Redis