﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## Documentation Index
> Fetch the complete documentation index at: https://openworkflow.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> ### When to use OpenWorkflow
>
> Use OpenWorkflow in TypeScript or JavaScript apps for:
>
> - Background jobs that need retries and must resume after a crash or deploy.
> - Multi-step integrations and data pipelines that need to save progress between operations.
> - AI workflows with multiple model or tool calls that need durable checkpoints.
> - Workflows that wait for a human approval, a webhook, or a timer before continuing.
>
> OpenWorkflow runs on Node.js 22.22+ or Bun, with PostgreSQL or SQLite storing workflow state. Your app enqueues runs, and a worker executes them.
>
> ### How to use OpenWorkflow
>
> Read and follow https://openworkflow.dev/skills/setup.md to set up OpenWorkflow.
>
> Define workflows with `defineWorkflow`, wrap operations in `step.run`, and enqueue runs with `ow.runWorkflow(workflow.spec, input)`. Start a worker with `npx @openworkflow/cli worker start` to execute them. See [Workflows](https://openworkflow.dev/docs/workflows.md), [Steps](https://openworkflow.dev/docs/steps.md), and [Signals](https://openworkflow.dev/docs/signals.md) for the APIs.

# OpenWorkflow

> OpenWorkflow is an open-source durable workflow engine for TypeScript, powered by PostgreSQL or SQLite.

```bash npm theme={null}
npx @openworkflow/cli init
```

```bash pnpm theme={null}
pnpx @openworkflow/cli init
```

```bash bun theme={null}
bunx @openworkflow/cli init
```

> [accordion] AI-Assisted Setup (Optional)
>
> If you want your AI coding assistant to help you set up OpenWorkflow, copy this
> prompt and paste it into your agent:
>
> ```text theme={null}
> Read and follow https://openworkflow.dev/skills/setup.md to set up OpenWorkflow.
> ```

![OpenWorkflow Dashboard](https://mintcdn.com/openworkflow/9lP8jOQ8KK7PhgqE/assets/dashboard.png?fit=max\&auto=format\&n=9lP8jOQ8KK7PhgqE\&q=85\&s=f885adaed7a8103eb24e44da4a587bc8)

## What is OpenWorkflow?

OpenWorkflow is an open-source durable workflow engine for TypeScript, backed by
PostgreSQL or SQLite. Wrap each operation in a step and OpenWorkflow saves its
result. After a crash or deploy, the worker resumes the workflow using those
saved results so they aren't re-run.

Use it for background jobs, multi-step integrations, data processing, and AI
workflows that need retries, long waits, or coordination between tasks.

```ts theme={null}
import { defineWorkflow } from "openworkflow";

export const processOrder = defineWorkflow(
  { name: "process-order" },
  async ({ input, step }) => {
    // if the server crashes after this step, the card is NOT charged again
    await step.run({ name: "charge-card" }, async () => {
      await payments.charge(input.orderId);
    });

    await step.run({ name: "send-confirmation" }, async () => {
      await emails.send({ to: input.email, subject: "Order confirmed!" });
    });
  },
);
```

## Features

&#x20;**Durable** - Workflows survive process
restarts and server crashes. Completed steps are never repeated.

&#x20;**Resumable** - After a crash or deploy,
workflows pick up from the last completed step automatically.

&#x20;**Pausable** - Workflows can sleep for seconds or
months without tying up resources.

&#x20;**Type Safe** - First-class TypeScript support for
inputs and outputs.

## Get Started

> [card] [Quick Start](https://openworkflow.dev/docs/quickstart.md)
>
> Build your first workflow in 5 minutes.

> [card] [How It Works](https://openworkflow.dev/docs/overview.md)
>
> Understand the core concepts: workflows, steps, and workers.

> [card] [CLI Reference](https://openworkflow.dev/docs/cli.md)
>
> Set up your project, start workers, and open the dashboard.

> [card] [Building with LLMs](https://openworkflow.dev/docs/llms.md)
>
> Use agent skills, Markdown docs, and MCP search with your coding assistant.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.