BACKGROUND JOB INFRASTRUCTURE

Build background jobs. JobOrc runs the rest.

Build, schedule, execute, retry, and monitor background jobs without building the infrastructure around them.

TypeScript SDK
Retries & Backoff
Scheduling
Worker Orchestration
>_EXECUTION TRANSIT MODEL
01PRODUCER

Your Application

POST /api/v1/jobs

Enqueue with idempotency key: inv_88192:settle
02DURABLE BUFFER

Job Queue Partition

billing-critical [Raft Index #49102]

Prioritized queue with concurrency throttle (16/16)
03ACTIVE EXECUTION

Worker Node

wrk-04 (us-east-1) [Lease 30s]

Claimed atomic lease, executing payment settlement
04DURABLY COMMITTED

Persisted State

SUCCEEDED (842ms • ACK)

Receipt stored, logs indexed, telemetry updated
ACTIVE STATE:Worker Node
Partition: 0Latency: 0.8msAt-least-once guaranteed
DETERMINISTIC PIPELINE

From enqueue to completion.

One unified lifecycle guarantees durability from the instant your application dispatches a payload to final state commitment.

01PRODUCER

Enqueue

Your application creates a durable job with an idempotency key.

POST /api/v1/jobs
02COORDINATION

Schedule

The platform determines exact execution time and allocates queue slots.

Lease allocation & concurrency check
03WORKER

Execute

A connected worker claims the atomic lease and executes the handler.

wrk-04 claimed lease #48102
04FAULT TOLERANCE

Retry

Transient failures trigger jittered exponential backoff policies.

1s → 5s → 25s → 2m
05OBSERVABILITY

Complete

The execution is persisted with final status, telemetry, and logs.

Duration 842ms • ACK

State Machine Lifecycle

Strict transitions prevent race conditions, orphan leases, and duplicate runs.

Consensus State Replicated
TRANSITION:RUNNINGClaimed by active worker with live heartbeat lease
Audit event logged to append-only raft storage
CORE PRIMITIVES

Built for real background work.

Hardened developer infrastructure designed for predictable throughput, fault tolerance, and zero operational mystery.

EXECUTION ENGINE

Reliable Distributed Execution

Partition-based queue scheduling with deterministic at-least-once delivery, tenant isolation, and microsecond lease handoffs.

QUEUE PARTITION BUFFER✓ 14 QUEUES HEALTHY
billing-critical0 lag
2,480/m16/16 slots
data-export0 lag
940/m8/8 slots
webhooks0 lag
8,120/m32/32 slots
FAULT TOLERANCE

Retries & Exponential Backoff

Automated backoff with full jitter stops thundering herds when external services degrade.

RETRY INTERVAL MATRIXMAX 5 ATTEMPTS
1s → 5s → 25s → 2m → DLQ
Jitter: Full decorrelated✓ Zero Lost Payloads
SCHEDULING

Distributed Cron Scheduler

Cron intervals and ISO schedules executed with distributed consensus locks. Zero duplicate runs.

SCHEDULE SPECACTIVE
0 2 * * * (America/New_York)
Overlap: Skip if running✓ Lock Acquired
WORKER ORCHESTRATION

Worker Fleet Balancing & Heartbeats

Dynamic worker registration, heartbeat liveness monitoring, and zero-downtime graceful drain timeouts during rolling deployments.

CONNECTED FLEET (128 ACTIVE WORKERS)✓ 100% LEASES HEALTHY
wrk-us-east-1a
16/16
0.4s ago
wrk-us-east-1b
14/16
0.2s ago
wrk-eu-west-1a
8/16
0.6s ago
wrk-ap-south-1
12/16
0.1s ago
THROTTLING

Concurrency & Rate Limiting

Throttle execution per tenant, queue, or custom key to prevent exceeding downstream database connection pools.

TENANT RATE LIMITSTOKEN BUCKET
org_acme: 50 req/sec • max concurrent: 10
DIAGNOSTICS

Structured per-job telemetry

Direct stdout/stderr logs and lifecycle traces bound directly to every job ID for instant debugging.

LIVE LOG TRACEjob_88a910

10:42:18 [info] lease acquired by wrk-04

10:42:19 [ack] completed in 842ms

DEVELOPER EXPERIENCE

Write the job. We handle the execution.

Idiomatic type-safe clients for your production stack. Submit work in one line and define resilient worker handlers with complete observability.

SDK:
Enqueue Background Job:Enqueue durable work with idempotency, priority, and backoff policy.
Zero native dependencies
>_example.ts
TS
import { JobOrcClient } from '@joborc/sdk';
const jobs = new JobOrcClient({ apiKey: process.env.JOBORC_API_KEY });
// Enqueue durable background job
const job = await jobs.enqueue('process-invoice', {
invoiceId: 'inv_9981a',
amountUsd: 4900,
customerId: 'cus_3301',
}, {
queue: 'billing',
priority: 'high',
maxRetries: 3,
backoff: { type: 'exponential', initialMs: 1000, maxMs: 30000 },
idempotencyKey: 'inv_9981a:settle',
});
console.log(`Job ${job.id} enqueued to ${job.queue}`);
OPERATIONAL OBSERVABILITY

See what every job did.

Eliminate guesswork. Inspect exact runtime payloads, attempt timelines, worker hostnames, and live structured stdout/stderr streams.

send-invoicejob_88a910SUCCEEDED
Duration842ms
Attempts1 / 3
Workerworker-07
Queuebilling-critical
Started10:42:18 UTC
Completed10:42:19 UTC
Input Payloadapplication/json
{
  "invoiceId": "inv_881920",
  "customerId": "cus_99182",
  "amountUsd": 1450,
  "currency": "USD",
  "autoPay": true,
  "recipient": "billing@acme-corp.com"
}
Payload encrypted with AES-256 at rest
Execution Trace Logs
✓ 6 EVENTS RECORDED
10:42:18.112[info]job received on queue [billing-critical]
10:42:18.114[info]atomic lease claimed by worker [worker-07]
10:42:18.240[info]invoice payload inv_881920 validated and locked
10:42:18.680[info]payment charge captured via payment gateway ($1,450.00)
10:42:18.890[info]invoice receipt PDF rendered and dispatched to billing@acme-corp.com
10:42:18.954[ack]job execution completed successfully in 842ms — lease acknowledged
Lease lock duration: 30,000msAck latency: 0.2ms
RESILIENCE ENGINE

Failure is part of the system.

Networks drop connections. Downstream services timeout. JobOrc ensures failed executions recover automatically without dropping payloads or corrupting state.

EXECUTION RECOVERY TRACE

Automated Transient Failure Recovery

Policy: maxRetries = 3Auto-Recovered
01
Attempt 1: FAILED(2,004ms)

HTTP 504 Gateway Timeout (payment provider unresponsive after 2000ms)

Backoff interval 1.0s (+ 120ms jitter)
02
Attempt 2: FAILED(840ms)

Connection reset by peer (socket hang up)

Backoff interval 5.0s (+ 340ms jitter)
03
Attempt 3: SUCCESS(842ms)

HTTP 200 OK — charge captured and receipt committed

Persisted & Acked
Jittered Backoff

Decorrelated jitter prevents synchronized worker thundering herds.

Strict Idempotency

Unique keys guarantee identical payloads execute exactly once.

Dead-Letter Isolation

Exhausted attempts route safely to DLQ with zero data loss.

Raft State Consensus

Leases and state transitions replicated across clustered nodes.

ENGINEERING ARCHITECTURE

Infrastructure you don't have to build.

Stop stitching fragile DIY queues, ad-hoc retry timeouts, and uncoordinated cron daemons. Build your production systems on hardened primitives.

Infrastructure PrimitiveFragile DIY PlumbingJobOrc Engine
Queue Storage & Buffer
Manual Redis memory config, maxclients limits, persistent disk sync
Durable partitioned storage with sub-millisecond append & zero-drop guarantee
Worker Lease Coordination
Custom Redis SETNX locks, split-brain race conditions, dangling locks
Raft consensus lease manager with automatic heartbeat expiration & steal
Retries & Exponential Backoff
Ad-hoc setTimeout, unjittered retries that stampede downstream databases
Deterministic exponential backoff with full jitter & isolated dead-letter triage
Distributed Cron Scheduling
Single-node cron daemons without high availability or duplicate prevention
Consensus-backed distributed scheduler with timezone & overlap policies
Operational Visibility
Scattered logs in Datadog/CloudWatch with no trace back to the job payload
Unified per-job execution timeline with input payloads, attempts, and live logs
Concurrency & Rate Limiting
Complex token-bucket scripts in Redis prone to drift under worker scaling
Strict tenant and queue partition concurrency throttles enforced at engine core
GET STARTED

Ready to move asynchronous work out of your application?

Eliminate queue boilerplate, flaky cron daemons, and invisible background failures. Start building on hardened infrastructure in minutes.

pnpm add @joborc/sdk