Workers
A worker is a process that runs your jobs and workflow steps. The server hands out the work and shows it; workers do it. This section is for the people who deploy and run them; Develop is how to write the code inside.
A worker is your own program, in Python, TypeScript, Ruby, Go, Rust, Java, PHP, .NET or Elixir, with the JoobQ SDK in it. It reaches the server over HTTPS with one token, and never holds the Redis credentials, the payload keys or the licence.
Workers and producers talk only to the server. Nothing connects to a worker.
Queue workers and workflow workers
A worker does one or both of two kinds of work, depending on what it registers. They behave differently when something fails, so know which you are running.
A job is one trip through a queue. A workflow run is a loop: the server's engine hands out one step at a time and decides what follows from each result.
| Queue worker | Workflow worker Pro | |
|---|---|---|
| Registers | Jobs | Workflows (their blueprints and step handlers) |
| Runs | A job: one handler, start to finish | One step of a workflow run at a time |
| Who decides what comes next | Nobody: a job is done when its handler returns | The workflow engine inside the server: the next step, a retry, a wait, a compensation |
| Listens on | The queues of its jobs | The task queue of its workflows (workflows unless the blueprint names another) |
| Where the state is | The job itself, in its queue | The run's history, kept by the server. A worker holds none of it |
| A failure | Retried with backoff while the job has retries left (3 by default), then a dead letter | Retried only if the step declares retries. When a step fails for good, the compensations of the completed steps run, newest first, and the run ends failed |
| The worker dies in the middle | The job runs again, with one retry used | The step runs again only if it declares retries. Finished steps are never run again |
| No worker is alive | Jobs wait in their queue | Runs wait at their current step, until a step's or the run's timeout |
| Needs | Nothing beyond the SDK token | A JoobQ Pro key on the server: without one, registering a workflow answers 402 pro_required |
| Watch it on | Queues, Jobs, Dead letters | Workflows |
Both are the same program and the same deployment: a worker that registers jobs is a queue worker, one that registers workflows is a workflow worker, and one that registers both is both. They share its concurrency.
Run them as separate processes when their needs differ. Typical reasons:
- A backlog of bulk jobs should not take the slots that workflow steps wait for.
- They scale on different signals: queue size for jobs, steps waiting for workflows.
- You want to pause or cap one without the other. Pause, concurrency and throttle apply per queue, and a task queue is a queue: give workflows a task queue of their own name.
How to write each is in Jobs and Durable workflows.
Find your page
What to know first
- Delivery is at least once. A worker that dies, or is cut off, has its tasks run again. Handlers must be safe to run twice: see Best practices.
- A worker stops cleanly on SIGTERM: no new work, finish what is running, report, exit.
- It shows on the console's Workers page while it is alive.
- A lapsed licence does not stop it. The SDK gateway keeps serving; Pro features follow the Pro key (Licence and Pro key).

