Skip to content
Skills Library
Programming · Building & coding

dbos-java

/dbos-java

DBOS Java SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Java or Kotlin code with DBOS, creating workflows and steps, using queues, integrating DBOS with Spring Boot, using DBOSClient from external applications, or building JVM applications that need to be resilient to failures.

Licence
MIT
Last repository change
15.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
42
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 15.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

DBOS Java SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Java or Kotlin code with DBOS, creating workflows and steps, using queues, integrating DBOS with Spring Boot, using DBOSClient from external applications, or building JVM applications that need to be resilient to failures.

Original author description

DBOS Java SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Java or Kotlin code with DBOS, creating workflows and steps, using queues, integrating DBOS with Spring Boot, using DBOSClient from external applications, or building JVM applications that need to be resilient to failures.

How it works

  1. When to Apply
  2. Rule Categories by Priority
  3. Critical Rules
  4. How to Use
  5. References
Original SKILL.md headings · 146 lines, 661 words
SKILL.md preview
---
name: dbos-java
description: DBOS Java SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Java or Kotlin code with DBOS, creating workflows and steps, using queues, integrating DBOS with Spring Boot, using DBOSClient from external applications, or building JVM applications that need to be resilient to failures.
license: MIT
metadata:
  author: dbos
  version: "1.2.0"
  organization: DBOS
  date: October 2026
  abstract: Comprehensive guide for building fault-tolerant Java applications with DBOS. Covers workflow registration and proxies, steps, queues, communication patterns, Spring Boot integration, and best practices for durable execution.
---

# DBOS Java Best Practices

Guide for building reliable, fault-tolerant Java applications with DBOS durable workflows.

## When to Apply

Reference these guidelines when:
- Adding DBOS to existing Java or Kotlin code
- Creating workflows and steps
- Using queues for concurrency control
- Implementing workflow communication (events, messages, streams)
- Configuring and launching DBOS applications, including with Spring Boot
- Using DBOSClient from external applications
- Testing DBOS applications

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Lifecycle | CRITICAL | `lifecycle-` |
| 2 | Workflow | CRITICAL | `workflow-` |
| 3 | Step | HIGH | `step-` |
| 4 | Queue | HIGH | `queue-` |
| 5 | Communication | MEDIUM | `comm-` |
| 6 | Pattern | MEDIUM | `pattern-` |
| 7 | Testing | LOW-MEDIUM | `test-` |
| 8 | Client | MEDIUM | `client-` |
| 9 | Advanced | LOW | `advanced-` |

## Critical Rules

### Installation

Add the DBOS dependency (Java 17+, Gradle 8+ recommended):

```kotlin
dependencies {
    implementation("dev.dbos:transact:1.2.0")
    implementation("org.slf4j:slf4j-simple:2.0.17") // to see DBOS log messages
}
```

DBOS requires a PostgreSQL-compatible database. Connection settings are typically supplied through
`DBOS_SYSTEM_JDBC_URL`, `PGUSER`, and `PGPASSWORD`.

### DBOS Configuration and Launch

A DBOS application MUST create a `DBOS` instance, register its workflow classes, then launch:

```java
import dev.dbos.transact.DBOS;
import dev.dbos.transact.config.DBOSConfig;
import dev.dbos.transact.workflow.Workflow;

interface Example {
  String workflow(String input);
}

class ExampleImpl implements Example {
  private final DBOS dbos;

  ExampleImpl(DBOS dbos) {
    this.dbos = dbos;
  }

  @Override
  @Workflow
  public String workflow(String input) {
    return dbos.runStep(() -> fetchData(input), "fetchData");
  }

  private String fetchData(String input) { /* external call */ return input; }
}

public class App {
  public static void main(String[] args) {
    DBOSConfig config = DBOSConfig.defaultsFromEnv("my-app")
        .withAppVersion("0.1.0");
    DBOS dbos = new DBOS(config);

    Example proxy = dbos.registerProxy(Example.class, new ExampleImpl(dbos));

    dbos.launch();

    proxy.workflow("input"); // durable: called through the proxy
  }
}
```

When creating a new application, set `withAppVersion("0.1.0")`. If omitted, DBOS derives an opaque hash from the
workflow code, SDK version, and application name. When editing an existing application, leave its configured version
alone — changing it is a deployment decision (see `references/advanced-versioning.md`). Version names are unique
across a shared system database, so applications sharing one need distinct version strings (for example
`"billing-0.1.0"`; see `references/advanced-shared-database.md`).

The name passed to `DBOSConfig.defaults(appName)` / `defaultsFromEnv(appName)` identifies the application and owns
everything it creates. Multiple applications (in any language) can share one system database, isolated by
application name (1.1+, see `references/advanced-shared-database.md`).

### Workflow and Step Structure

Workflows are ordinary methods annotated `@Workflow` on a class registered with `registerProxy`. Any operation that
is complex, non-deterministic, or calls an external service must run as a step, either through `dbos.runStep` or as
a `@Step`-annotated method invoked through the proxy:

```java
@Workflow
public String myWorkflow(String url) throws Exception {
  // Inline lambda step — use for one-off work
  String body = dbos.runStep(() -> httpGet(url), "httpGet");
  // Reusable step declared with @Step — MUST be invoked through the proxy (self)
  return self.parse(body);
}

@Step(maxAttempts = 3)
public String parse(String body) { /* ... */ }
```

### Key Constraints

- Workflows and `@Step` methods are ONLY durable when invoked through the proxy returned by `registerProxy`
  (or, with Spring Boot, through an injected self-reference). Calls via `this` bypass DBOS.
- All workflow classes MUST be registered before `launch()`; database-backed queues are registered after `launch()`
- Do NOT start, enqueue, or retrieve workflows from within a step, and do NOT call `send`, `recv`, `setEvent`,
  or `getEvent` from a step
- Workflows MUST be deterministic — random numbers, current time, I/O, and threading go in steps
- Do NOT mutate state outside the workflow's own scope from workflows or steps
- Workflow arguments and step/workflow return values MUST be JSON-serializable by Jackson
- Use `dbos.sleep`, not `Thread.sleep`, inside workflows

## How to Use

Read individual rule files for detailed explanations and examples:

```
references/lifecycle-config.md
references/workflow-registration.md
references/queue-concurrency.md
```

## References

- https://docs.dbos.dev/
- https://github.com/dbos-inc/dbos-transact-java
Files in this package (42)
  • AGENTS.md 3 KB
  • CLAUDE.md 1 KB
  • SKILL.md 6 KB
  • references/_sections.md 2 KB
  • references/advanced-interops.md 3 KB
  • references/advanced-kotlin.md 3 KB
  • references/advanced-patching.md 3 KB
  • references/advanced-serialization.md 3 KB
  • references/advanced-shared-database.md 7 KB
  • references/advanced-versioning.md 3 KB
  • references/client-enqueue.md 6 KB
  • references/client-setup.md 7 KB
  • references/comm-events.md 3 KB
  • references/comm-messages.md 3 KB
  • references/comm-streaming.md 3 KB
  • references/lifecycle-config.md 8 KB
  • references/lifecycle-spring-boot.md 4 KB
  • references/pattern-debouncing.md 5 KB
  • references/pattern-idempotency.md 2 KB
  • references/pattern-scheduled.md 5 KB
  • references/pattern-sleep.md 2 KB
  • references/queue-basics.md 5 KB
  • references/queue-concurrency.md 3 KB
  • references/queue-deduplication.md 3 KB
  • references/queue-delay.md 2 KB
  • references/queue-listening.md 2 KB
  • references/queue-management.md 4 KB
  • references/queue-partitioning.md 5 KB
  • references/queue-priority.md 2 KB
  • references/queue-rate-limiting.md 3 KB
  • references/step-basics.md 3 KB
  • references/step-retries.md 3 KB
  • references/step-transactions.md 3 KB
  • references/test-setup.md 4 KB
  • references/workflow-background.md 3 KB
  • references/workflow-constraints.md 2 KB
  • references/workflow-control.md 3 KB
  • references/workflow-determinism.md 2 KB
  • references/workflow-instances.md 2 KB
  • references/workflow-introspection.md 6 KB
  • references/workflow-registration.md 3 KB
  • references/workflow-timeout.md 4 KB

Versions

The database has no other skills named dbos-java.

Database snapshot: 13.11.2026 · package version 5774d009ca05 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100dbos-typescript
    DBOS TypeScript SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing TypeScript code with DBOS, creating workflows and steps, using queues, using DBOSClient from external applications, or building applications that need to be…
  • 100dbos-python
    DBOS Python SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Python code with DBOS, creating workflows and steps, using queues, using DBOSC...
  • 100dbos-typescript
    DBOS TypeScript SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing TypeScript code with DBOS, creating workflows and steps, using queues, usi...
  • 100dbos-golang
    DBOS Go SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing Go code with DBOS, creating workflows and steps, using queues, using the DBOS Client from external applications, or building Go applications that need to be resilient to failures.
  • 100dbos-go
    DBOS durable execution framework for Go. Use when implementing resilient, failure-recoverable applications with durable workflows, steps, queues, and workflow communication patterns. Triggers on DBOS Go, durable execution Go, resilient workflows Go, saga pattern Go, or when…
  • 100dbos-python
    DBOS durable execution framework for Python. Use when implementing resilient, failure-recoverable applications with durable workflows, steps, transactions, queues, and workflow communication patterns. Triggers on DBOS Python, durable execution Python, resilient workflows Python,…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.