Skip to content
@openjobspec

Open Job Spec

The open standard for background jobs. Backend-agnostic, language-agnostic, protocol-extensible. One spec, any implementation.
  • United States of America

Open Job Spec

The open, language-agnostic standard for background job processing.

Specification · Website · Playground · Discussions


What is Open Job Spec?

Open Job Spec (OJS) is a vendor-neutral envelope format and protocol for background job processing. It defines a universal standard so that producers, consumers, and backends can interoperate regardless of language, framework, or infrastructure.

OJS provides:

  • 🎯 Universal job envelope — A single schema for job metadata, args, and lifecycle state
  • 🔄 8-state lifecyclescheduled → available → pending → active → completed/retryable/cancelled/discarded
  • 🌐 Protocol bindings — HTTP and gRPC, with extensible transport support
  • 📦 Wire formats — JSON and Protobuf serialization
  • 🔌 Extensions — Retries, cron scheduling, workflows, unique jobs, middleware, and events

Think of it as CloudEvents, but for background jobs.

Ecosystem

📋 Specification & Schema

Repository Description
spec Core specification, extensions, and RFC process
ojs-json-schema JSON Schema (draft 2020-12) validation definitions
ojs-proto Protocol Buffer / gRPC service definitions
ojs-conformance Language-agnostic conformance test suite (5 levels)

🖥️ Reference Backends

Repository Stack Status
ojs-backend-redis Go + Redis 7 + Lua scripts CI
ojs-backend-postgres Go + PostgreSQL 15 + SKIP LOCKED CI

📚 Official SDKs

Repository Language Package
ojs-go-sdk Go go get github.com/openjobspec/ojs-go-sdk
ojs-js-sdk TypeScript / JavaScript npm install @openjobspec/sdk
ojs-python-sdk Python pip install openjobspec
ojs-java-sdk Java 21+ Maven Central
ojs-rust-sdk Rust cargo add openjobspec
ojs-ruby-sdk Ruby gem install openjobspec

🛠️ Tools

Repository Description
ojs-playground Interactive browser-based IDE — define jobs, visualize lifecycles, simulate retries
website Source for openjobspec.org

Quick Start

# Enqueue a job via HTTP
curl -X POST http://localhost:8080/api/v1/jobs \
  -H "Content-Type: application/json" \
  -d '{
    "type": "email.send",
    "args": ["user@example.com", "Welcome!", "Thanks for signing up."],
    "queue": "default"
  }'

Every SDK follows the same pattern — Client (producer) and Worker (consumer):

// TypeScript — Enqueue
const client = new OJSClient({ baseUrl: "http://localhost:8080" });
await client.enqueue({ type: "email.send", args: ["user@example.com"] });

// TypeScript — Process
const worker = new OJSWorker({ baseUrl: "http://localhost:8080" });
worker.register("email.send", async (job) => {
  await sendEmail(...job.args);
});
await worker.start();

Architecture

OJS follows a three-layer model inspired by CloudEvents:

┌─────────────────────────────────────────────┐
│  Layer 3: Protocol Bindings                 │
│  HTTP · gRPC                                │
├─────────────────────────────────────────────┤
│  Layer 2: Wire Formats                      │
│  JSON · Protobuf                            │
├─────────────────────────────────────────────┤
│  Layer 1: Core Specification                │
│  Job Envelope · Lifecycle · Operations      │
└─────────────────────────────────────────────┘

Get Involved

We welcome contributions of all kinds. Here's how you can help:

Please read our Contributing Guide and Code of Conduct before participating.

License

All Open Job Spec projects are licensed under the Apache License 2.0.

Pinned Loading

  1. ojs-json-schema ojs-json-schema Public

    JSON Schema definitions for the OJS job envelope, API payloads, error format, and conformance manifest.

    JavaScript

  2. ojs-proto ojs-proto Public

    Protocol Buffer definitions for the OJS gRPC protocol extension.

  3. spec spec Public

    The Open Job Spec specification. An open, language-agnostic standard for background job processing.

Repositories

Showing 10 of 35 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…