openworkflow.config.ts
automatically, or you can override the path with --config.
Installation
Commands
init
Initialize OpenWorkflow in your project:
- Asks which backend to use (SQLite, PostgreSQL, or both)
- Installs required dependencies
- Creates
openworkflow.config.ts - Creates an example workflow in
./openworkflow/ - Adds a
workerscript topackage.json - Updates
.gitignorefor SQLite (if selected) - Adds
OPENWORKFLOW_POSTGRES_URLto.envfor PostgreSQL (if selected)
worker start
Start a worker to process workflows:
--concurrency <n>- Number of concurrent workflow executions (overrides config)
- Loads your config file
- Discovers workflows in the configured directories
- Registers all workflows
- Starts polling for work
- Handles graceful shutdown on SIGINT/SIGTERM
dashboard
Start the web dashboard:
http://localhost:3000. See
Dashboard for details.
doctor
Diagnose your OpenWorkflow setup:
- Config file exists and loads correctly
- Backend connection works
- Workflow directories exist
- Workflow files are discoverable
- Workflows export valid definitions
- No duplicate workflow names
--version
Show the CLI version:
--help
Show help for any command:
Environment Variables
The CLI loads.env files automatically before reading the config.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (config not found, connection failed, etc.) |
Graceful Shutdown
When runningworker start, the CLI handles shutdown signals:
- SIGINT (Ctrl+C) - Graceful shutdown
- SIGTERM - Graceful shutdown
- Stops accepting new work
- Waits for active workflows to complete
- Closes the backend connection