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 resilient to failures.
Add this skill
npx mdskills install sickn33/dbos-typescriptClear guidance for building fault-tolerant workflows with critical constraints and examples
1---2name: dbos-typescript3description: 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 resilient to failures.4risk: safe5source: https://docs.dbos.dev/6license: MIT7metadata:8 author: dbos9 version: "1.0.0"10 organization: DBOS11 date: January 202612 abstract: Comprehensive guide for building fault-tolerant TypeScript applications with DBOS. Covers workflows, steps, queues, communication patterns, and best practices for durable execution.13---1415# DBOS TypeScript Best Practices1617Guide for building reliable, fault-tolerant TypeScript applications with DBOS durable workflows.1819## When to Use2021Reference these guidelines when:22- Adding DBOS to existing TypeScript code23- Creating workflows and steps24- Using queues for concurrency control25- Implementing workflow communication (events, messages, streams)26- Configuring and launching DBOS applications27- Using DBOSClient from external applications28- Testing DBOS applications2930## Rule Categories by Priority3132| Priority | Category | Impact | Prefix |33|----------|----------|--------|--------|34| 1 | Lifecycle | CRITICAL | `lifecycle-` |35| 2 | Workflow | CRITICAL | `workflow-` |36| 3 | Step | HIGH | `step-` |37| 4 | Queue | HIGH | `queue-` |38| 5 | Communication | MEDIUM | `comm-` |39| 6 | Pattern | MEDIUM | `pattern-` |40| 7 | Testing | LOW-MEDIUM | `test-` |41| 8 | Client | MEDIUM | `client-` |42| 9 | Advanced | LOW | `advanced-` |4344## Critical Rules4546### Installation4748Always install the latest version of DBOS:4950```bash51npm install @dbos-inc/dbos-sdk@latest52```5354### DBOS Configuration and Launch5556A DBOS application MUST configure and launch DBOS before running any workflows:5758```typescript59import { DBOS } from "@dbos-inc/dbos-sdk";6061async function main() {62 DBOS.setConfig({63 name: "my-app",64 systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL,65 });66 await DBOS.launch();67 await myWorkflow();68}6970main().catch(console.log);71```7273### Workflow and Step Structure7475Workflows are comprised of steps. Any function performing complex operations or accessing external services must be run as a step using `DBOS.runStep`:7677```typescript78import { DBOS } from "@dbos-inc/dbos-sdk";7980async function fetchData() {81 return await fetch("https://api.example.com").then(r => r.json());82}8384async function myWorkflowFn() {85 const result = await DBOS.runStep(fetchData, { name: "fetchData" });86 return result;87}88const myWorkflow = DBOS.registerWorkflow(myWorkflowFn);89```9091### Key Constraints9293- Do NOT call, start, or enqueue workflows from within steps94- Do NOT use threads or uncontrolled concurrency to start workflows - use `DBOS.startWorkflow` or queues95- Workflows MUST be deterministic - non-deterministic operations go in steps96- Do NOT modify global variables from workflows or steps9798## How to Use99100Read individual rule files for detailed explanations and examples:101102```103references/lifecycle-config.md104references/workflow-determinism.md105references/queue-concurrency.md106```107108## References109110- https://docs.dbos.dev/111- https://github.com/dbos-inc/dbos-transact-ts112
Full transparency — inspect the skill content before installing.