Follow these steps to set up Strait locally and run your first job. You’ll have a production-grade job orchestration service running in under 10 minutes.Documentation Index
Fetch the complete documentation index at: https://docs.strait.dev/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, ensure you have:Go 1.26+
Required to build and run Strait from source. Verify with
go version. Download from golang.org/dl.Docker and Docker Compose
Required to run PostgreSQL, Redis, and Sequin locally. Verify with
docker --version and docker compose version. Download from docker.com.Step 1: Clone and Start Infrastructure
Docker Compose will start PostgreSQL 18, Redis 8, and Sequin in isolated containers. Ports exposed: PostgreSQL (5432), Redis (6379), Strait API (8080).
Step 2: Set Environment Variables
Configure necessary environment variables for Strait to connect to infrastructure.Strait validates required environment variables on startup. Missing variables cause a clear error message with configuration instructions.
Step 3: Build and Run Strait
Build Strait binary and start it inall mode (API + worker combined).
Startup Process:
- Connect to PostgreSQL and apply any pending migrations automatically
- Open HTTP server on port 8080
- Start worker pool and scheduler background tasks
- Print startup banner with configuration summary
--mode api or --mode worker for horizontal scaling in production.Step 4: Create a Job
Create a new job definition via REST API or CLI. Jobs define the template for recurring tasks.Jobs are the core unit of work. They define the endpoint URL, timeout, retry strategy, and other configuration. Runs are execution instances of jobs.
Step 5: Trigger a Job
Trigger a run for the job you just created. Strait will enqueue the run and a worker will dispatch it to the endpoint.Dequeued
Worker claims the run using
SELECT FOR UPDATE SKIP LOCKED and transitions to dequeued state.Step 6: Watch the Run
Monitor the status of your job run in real-time.queued → dequeued → executing → completed or failed.
Real-time updates: Subscribe to Server-Sent Events via the
/v1/runs/{runID}/stream endpoint for live status updates without polling.Step 7: Create a Simple Workflow
Workflows allow you to chain multiple jobs together in a DAG (Directed Acyclic Graph). Steps can depend on outputs from parent steps.Workflow Execution: When triggered, Strait creates a
workflow_run. Step extract executes first, then transform executes only after extract completes. The DAG engine handles fan-in automatically when multiple steps depend on the same parent.Troubleshooting
Common Mistakes
What’s Next?
Architecture Deep Dive
Learn about queue mechanics, the 13-state FSM, workflow engine, and why we chose our technology stack.
Concepts
Understand jobs, runs, workflows, scheduling, retry strategies, and cost budgets in depth.
CLI Reference
Master 48+ CLI commands with shell completion, contexts, aliases, and output formats.
API Documentation
REST API endpoints for job management, workflow orchestration, and SDK interactions.
Next Steps
Jobs
Learn how jobs work in Strait.
Workflows
Build multi-step workflow DAGs.
SDKs
Choose your language and start building.
Deployment
Deploy Strait to production.