Skip to content
Bok Joy

Durable tasks, hot or on demand

Write tasks as Node or Python functions and trigger them from any backend. Bok Joy runs each one to the finish, on warm workers that never sleep or on machines that start when work arrives.

0.15 s
Median start on a hot task's warm worker
60 s
Of idle, then a burst machine drains
7 days
The longest wait, holding no worker

Define a task.Trigger it from anywhere.

A task is an exported function. A workflow is one whose awaited steps are recorded, so it can sleep, wait for events and call other tasks. Your backend starts runs with an environment API key, and the key picks the environment.

user.onboardingworkflow in prod

{"email": "ada@example.com"}

  1. Completedemail.send welcomeAttempt 2 of 5
  2. Waitingevent activatedUp to 3 days
  3. Not startedemail.send nudgeIf the wait times out
The sample workflow below, partway through a run.
onboarding.mjsA task and a workflow
import {sendEmail} from './mailer.mjs'; const DAY = 24 * 60 * 60 * 1000; // A task. It retries up to max_attempts, and// ctx.idempotencyKey stays the same on every attempt.export async function send({email, template}, ctx) {  await sendEmail(email, template, ctx.idempotencyKey);  return {sent: true};} // A workflow. Each awaited step is recorded: after a restart// it resumes where it stopped, and a wait holds no worker.export async function onboarding({email}, ctx) {  const mail = (template) =>    ctx.callTask('email.send', {email, template}, template);   await mail('welcome');  const reply = await ctx.waitEvent('activated', 3 * DAY);  if (reply.timed_out) await mail('nudge');  return {activated: !reply.timed_out};}
manifest.jsonRegister both
{  "tasks": [    {"id": "email.send", "kind": "task", "runtime": "node",     "entrypoint": "onboarding.mjs", "handler": "send",     "compute": {"machine": "small"}, "max_attempts": 5},    {"id": "user.onboarding", "kind": "workflow",     "runtime": "node", "entrypoint": "onboarding.mjs",     "handler": "onboarding"}  ]}
trigger.mjsStart a run
// From any backend, with BOKJOY_API_URL=https://api.bokjoy.dev// and BOKJOY_API_KEY set to an environment API key// (bjk_prod_...). The key picks the environment.import { tasks } from '@bokjoy/sdk'; const handle = await tasks.trigger(  'user.onboarding',  { email: 'ada@example.com' },  // Sending the same key again returns the same run.  { idempotencyKey: 'signup-ada' },);console.log(handle.id, handle.status);

Send the activated event to the waiting run with POST /v1/runs/{id}/events.

  • tasks.trigger

    Start a run and get its handle at once. Its idempotency key goes out with every retry the client makes.

  • tasks.batchTrigger

    Start up to 1,000 runs of a task in one request and one transaction: all of them, or none.

  • tasks.triggerAndWait

    Start a run and wait for its output, or catch a typed error when it fails or is cancelled.

Python has the same calls in snake case. In TypeScript, tasks.trigger<typeof task> checks the payload and types the output, without loading the task’s code.

Hot where it counts.Serverless everywhere else.

Hot tasks

Add hot to a task and Bok Joy keeps that many workers running for it while its deployment is current, sized to the task or to a larger preset you name. Its runs start on a machine that is already up.

{"id": "images.resize", "kind": "task", "runtime": "node", "entrypoint": "resize.mjs", "handler": "resize", "compute": {"machine": "large"}, "hot": {"workers": 2}}
  • 1 to 16 warm workers per task
  • Runs beyond the warm workers' room burst as usual
  • Previews never keep a warm worker
  • Warm workers count against your caps. A set that can never fit is refused, naming the cap it breaks

Burst machines

When no worker has room, Bok Joy starts cloud machines for the waiting runs, sized to fit them. A machine with nothing to do for 60 seconds drains and is destroyed, so a quiet afternoon keeps none running. Caps on machines, CPUs and memory are hard limits.

Start latency, median
Hot task, on a warm worker
0.15 s
Cold start, on a new machine
5.3 s

From trigger to the attempt starting, measured on Bok Joy's cloud in US East (Virginia) in October 2026.

Built for work that has to finish

Runs, attempts and workflow steps are stored in Postgres. Bok Joy decides where each attempt runs and keeps the record.

  • Durable runs

    Every run, attempt and workflow step commits to Postgres. A workflow that restarts replays the steps it already finished and continues from the next one.

  • Safe retries

    A failed attempt retries up to the task's max attempts. A lost attempt is fenced off until it is confirmed stopped. A failed workflow can retry from the step that failed.

  • Waits and timers

    Sleep or wait for an event for up to 7 days. A waiting workflow holds no worker, and an event sent early is kept until the workflow asks for it.

  • Schedules

    Run a task on a cron in any time zone, declared with the task or created from your backend. A fixed time fires once on the days the clocks change.

  • Queues and concurrency

    Limit how many runs of a queue execute at once, shared by several tasks or counted per customer with a concurrency key. Runs past the limit wait and start no machine.

  • Machines and packages

    Give each task a preset from micro (0.25 vCPU, 256 MiB) to large-2x (8 vCPU, 16 GiB). Programs such as ffmpeg and Chromium install into its image from your manifest.

  • Environments and variables

    Each project gets dev, staging, prod and a preview per branch, each with its own deployment and API keys. Variables are encrypted, write-only and fixed for the life of each run.

  • Private workers first

    Self-hosted, your own machines register as workers and take work before any burst machine. They only make outgoing requests and never receive your database URL or operator token.

  • Live progress

    Tasks set metadata, report milestones and start child tasks while they run. Your backend follows a run and its children live, and a web page can follow one with a React hook.

Moving from Trigger.dev? Import from @bokjoy/sdk/trigger and keep task(), schedules.task and triggerAndWait. A codemod moves the imports and the config, and a script brings over your dashboard schedules. Coming from Trigger.dev

How a run works

  1. Deploy

    The deploy command builds one pinned image per runtime with your locked npm or PyPI dependencies. A run keeps the deployment it started on.

  2. Trigger

    Your backend calls tasks.trigger with the task, its payload and an idempotency key, using an API key for one environment. The same key returns the same run.

  3. Place

    Once its queue has room, Bok Joy offers the run to your private workers first, then to its task's warm workers when it is hot, then to burst machines within your caps.

  4. Run and record

    A worker leases one attempt at a time. Each attempt's logs, result and usage stay with the run.

Bok Joy is in private alpha

We are letting teams in a few at a time. Join the waitlist and we will write to you when there is room.

Or email support@bokjoy.dev