Concepts
Hot tasks
A hot task keeps warm workers running while its deployment is current, so its runs start on a machine that is already up instead of waiting for a new one.
Runs on Bok Joy's cloud are serverless by default: a run that needs a machine starts one, and an idle machine goes away after 60 seconds. That first start takes seconds. A hot task trades a running machine's cost for a start in milliseconds.
| Start | From trigger to start, measured on Bok Joy's cloud |
|---|---|
| Hot: a warm worker of the task is already running | 5 to 214 ms (October 7, 2026) |
| Cold: a new machine boots | About 5 seconds, median, mostly creating and booting the machine (October 8, 2026) |
Make a task hot#
Add hot to the task's definition:
{"id": "images.resize", "kind": "task", "runtime": "node", "entrypoint": "tasks/resize.mjs", "handler": "resize", "compute": {"machine": "large", "timeout_ms": 60000}, "hot": {"workers": 1}}import { defineTask } from '@bokjoy/sdk'; export const resize = defineTask({ id: 'images.resize', kind: 'task', runtime: 'node', entrypoint: 'tasks/resize.mjs', handler: 'resize', compute: { machine: 'large', timeout_ms: 60000 }, hot: { workers: 1 },});from bokjoy import define_task resize = define_task( id="images.resize", kind="task", runtime="python", entrypoint="tasks/resize.py", handler="resize", compute={"machine": "large", "timeout_ms": 60000}, hot={"workers": 1},)| Field | Meaning |
|---|---|
workers | Warm workers to keep running, 1 to 16. Required. |
machine | Optional. The warm workers' size, micro to large-2x. It must hold the task's own size. A larger one also serves runs triggered with a bigger machine, up to its size. Default: the task's own size. |
hot is part of the task's definition, so changing or removing it takes a new deploy.
How warm workers behave#
- They run while the deployment is current in
dev,stagingorprod. Promote a new deployment and the old one's warm workers finish what they hold and stop, while the new one's start. - Previews never get warm workers. An open branch never costs a running machine.
- One set serves every environment. A deployment current in both
stagingandprodkeeps one set, not two. - Warm first, then burst. While a warm worker has room, other workers leave a new run of its task to it for up to 3 seconds. After that any cloud worker may take it, so a stuck warm worker never strands a run. When more runs arrive than the warm workers can hold, extra burst machines start as usual and go away when idle.
- A warm worker serves only its own task. Other tasks' runs never wait on it.
- Placement still applies. A
private-firstrun uses free private capacity first. Aprivate-onlyrun never goes to a warm worker.
A warm worker that stops answering keeps its place for up to three minutes, then is replaced. A worker whose machine stopped is replaced on the next check.
Cost and caps#
A warm worker is a running machine, billed for every second whether or not it serves a run. That is about 730 machine hours a month per worker. Multiply by workers, and by each distinct deployment current in dev, staging or prod.
Warm workers count against the same machine caps as burst machines. Bok Joy reserves room for hot tasks first, production before staging before dev. A hot task whose workers would break a cap gets none, and says why. One that fits the caps but finds them full waits, and starts as room frees.
Check a hot task#
GET /v1/tasks returns hot for each hot task. The CLI's durable-compute tasks prints the same, and the console's Tasks page tags the task, for example Hot: 1 of 2 warm, large.
state | Meaning |
|---|---|
warm | All the declared warm workers are connected. |
starting | Workers are booting. |
waiting | Short of warm workers for a reason other than booting. reason says which. |
refused | The caps cannot hold this task's warm workers. |
off | The deployment is not current in dev, staging or prod, or this control plane does not start cloud workers. |
On a control plane on your own computer, hot tasks are always off, because it starts no cloud workers.