Workflow orchestration engine for the ODW.ai sovereign agent suite
ODW Loop is a production-ready workflow orchestration platform that connects ODW's sovereign agents (Vault, Desk, Recap) into automated, multi-step workflows. Built as a TypeScript monorepo with a Fastify backend, React Flow canvas, and comprehensive test coverage.
Problem: Teams need to automate workflows across multiple AI agents while maintaining data sovereignty and control.
Solution: Loop provides visual workflow building with DAG-based execution, native ODW agent integration, and enterprise-grade security features.
Key Features:
- ๐จ Visual workflow builder with React Flow canvas
- โก DAG-based execution engine with topological scheduling
- ๐ Enterprise security (encryption, egress policies, RBAC, audit logging)
- ๐ Native ODW agent connectors (Vault, Desk, Recap)
- ๐ค 7 LLM providers with automatic failover
- ๐ Real-time execution monitoring with WebSocket updates
- ๐ Production-ready with Docker, Helm, and CI/CD
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Canvas โ
โ (React Flow + Tailwind) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/WebSocket
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Fastify API Server โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Auth โ RBAC โ Rate Limit โ CORS โ Metrics โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโผโโโโโโโ โโโโโโโโผโโโโโโโ โโโโโโโโผโโโโโโโ
โ Engine โ โ Connectors โ โ Triggers โ
โ (DAG + FSM) โ โ (Vault, โ โ (Cron, โ
โ โ โ Desk, โ โ Webhook, โ
โ โ โ Recap) โ โ Event) โ
โโโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโโโโ
โ โ
โโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ State Store Layer โ
โ (SQLite Core / PostgreSQL Scale) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Backend:
- TypeScript 5.4, Node.js 20+
- Fastify 4 (HTTP/WebSocket server)
- Drizzle ORM (SQLite + PostgreSQL)
- Pino (structured logging)
- Jose (JWT authentication)
Frontend:
- React 18, TypeScript
- React Flow 11 (workflow canvas)
- Tailwind CSS (styling)
- Vite (build tool)
Infrastructure:
- Docker + Docker Compose (Core tier)
- Helm + Kubernetes (Scale tier)
- GitHub Actions (CI/CD)
- Vitest (testing)
loop/
โโโ apps/
โ โโโ api/ # Fastify HTTP/WS server
โ โโโ canvas/ # React Flow frontend
โ โโโ sandbox/ # Code execution sandbox
โ โโโ control-plane/ # Multi-instance management
โโโ packages/
โ โโโ types/ # Shared Zod schemas
โ โโโ state/ # State store (SQLite/PostgreSQL)
โ โโโ engine/ # DAG execution engine
โ โโโ connectors/ # ODW agent adapters
โ โโโ triggers/ # Trigger handlers
โ โโโ workflow-authoring/ # Workflow CRUD
โ โโโ versioning/ # Git-based versioning
โ โโโ secrets/ # Encryption + secrets
โ โโโ egress/ # Network policies
โ โโโ observability/ # Metrics + logging
โ โโโ llm/ # LLM provider abstraction
โโโ tests/
โ โโโ unit/ # 162 unit tests
โ โโโ integration/ # 55 integration tests
โ โโโ e2e/ # 27 E2E tests
โโโ docker/ # Dockerfiles
โโโ helm/ # Kubernetes charts
โโโ templates/ # Workflow templates
- Node.js 20+ and pnpm 9+
- Docker and Docker Compose (for containerized deployment)
# Clone repository
git clone git@github.com:OnDemandWorld/odw-loop.git
cd loop
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run development server
pnpm dev# Start Core tier (single instance)
docker-compose up -d
# Access the application
open http://localhost:3000Copy .env.example to .env and configure:
# Required
LOOP_ENCRYPTION_KEY=your-32-char-encryption-key
LOOP_JWT_SECRET=your-jwt-secret
# Database (Core tier uses SQLite by default)
LOOP_DB_TYPE=sqlite
LOOP_DB_PATH=./data/loop.db
# For PostgreSQL (Scale tier)
# LOOP_DB_TYPE=postgres
# LOOP_DB_HOST=localhost
# LOOP_DB_PORT=5432
# LOOP_DB_NAME=loop
# LOOP_DB_USER=loop
# LOOP_DB_PASSWORD=your-password# Run all tests (244 tests)
pnpm test
# Run specific test suites
pnpm test:unit # 162 unit tests
pnpm test:integration # 55 integration tests
pnpm test:e2e # 27 E2E tests
# Run with coverage
pnpm test:coverageTest Coverage:
- Unit tests: Engine, connectors, triggers, state store, encryption
- Integration tests: API endpoints, workflow execution, triggers
- E2E tests: MeetingโTasksโKB workflow, RBAC, egress policies, sandbox isolation
All API endpoints require authentication via JWT or API key:
# Login
curl -X POST http://localhost:3000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "password"}'
# Use token
curl http://localhost:3000/api/v1/workflows \
-H "Authorization: Bearer YOUR_JWT_TOKEN"# Create workflow
POST /api/v1/workflows
# List workflows
GET /api/v1/workflows?page=1&per_page=20&status=active
# Get workflow
GET /api/v1/workflows/:id
# Update workflow
PUT /api/v1/workflows/:id
# Execute workflow
POST /api/v1/workflows/:id/execute# List executions
GET /api/v1/executions?workflow_id=xxx&status=running
# Get execution with nodes
GET /api/v1/executions/:id
# Cancel execution
POST /api/v1/executions/:id/cancel
# WebSocket for real-time updates
ws://localhost:3000/ws/executions/:id# Create webhook trigger
POST /api/v1/workflows/:id/triggers
{
"trigger_type": "webhook",
"config": { "secret": "your-hmac-secret" }
}
# Webhook endpoint
POST /webhooks/:trigger_id# Build Docker images
docker build -t loop-app:latest -f docker/Dockerfile.app .
docker build -t loop-sandbox:latest -f docker/Dockerfile.sandbox .
# Start with Docker Compose
docker-compose up -d# Add Helm repo
helm repo add loop ./helm
# Install with custom values
helm install loop ./helm/loop \
--set global.encryptionKey=your-key \
--set global.jwtSecret=your-secret \
--set postgresql.auth.password=your-db-password- Encryption at Rest: AES-256-GCM with HKDF key derivation
- Egress Policies: Domain/IP/region-based network controls
- RBAC: Role-based access control (read/write/admin)
- Audit Logging: Complete audit trail for all operations
- Webhook Verification: HMAC-SHA256 signature validation
- Sandbox Isolation: Code execution in isolated containers
Prometheus metrics available at /metrics:
loop_executions_total- Execution count by statusloop_execution_duration_seconds- Execution duration histogramloop_connector_calls_total- Connector API callsloop_circuit_breaker_state- Circuit breaker states- And 11 more metrics...
See DEVELOPMENT.md for detailed development guidelines.
# Development workflow
pnpm install
pnpm dev # Start dev server with hot reload
pnpm typecheck # Type check all packages
pnpm lint # Run ESLint
pnpm build # Build all packages
pnpm test # Run all tests- DEVELOPMENT.md - Development status and decisions
- prd.md - Product Requirements Document
- tsd.md - Technical Specification Document
- tbk.md - Task Breakdown Document
- sad.md - System Architecture Document
- research.md - Competitive landscape analysis
- Real-time collaborative editing (multi-user workflow editing)
- Workflow marketplace (share and discover workflows)
- Natural language workflow generation (AI-assisted workflow creation)
- Advanced scheduling (timezones, business hours, dependencies)
- Workflow versioning UI (visual diff, rollback)
- Multi-tenancy support (isolate workflows by organization)
- Workflow templates library (pre-built workflows)
- Advanced monitoring (distributed tracing, performance profiling)
- Custom connector SDK (third-party integrations)
- Mobile app (iOS/Android for monitoring and approvals)
- Workflow simulation (test execution without side effects)
- A/B testing for workflows (compare variants)
- Workflow analytics (usage patterns, optimization suggestions)
- Integration with external CI/CD (GitHub Actions, Jenkins)
- Workflow import/export (JSON, YAML, visual formats)
- Migrate to TypeScript 5.5+ for improved type inference
- Upgrade to React 19 for concurrent features
- Implement Redis-backed distributed state (Scale tier)
- Add GraphQL API alternative to REST
- Implement OAuth2/OIDC authentication providers
This repository is designed for AI-assisted development. Key guidelines:
- Modular Monolith: Clean separation between packages, shared interfaces
- State Store Abstraction: SQLite for Core, PostgreSQL for Scale (same interface)
- Type Safety: Strict TypeScript with Zod runtime validation
- Test-Driven: Comprehensive test coverage (unit, integration, E2E)
- Read
DEVELOPMENT.mdfor current status and decisions - Check
tbk.mdfor task breakdown and dependencies - Follow existing patterns in
packages/andapps/ - Write tests for all new functionality
- Update documentation after changes
StateStore(packages/state/src/interface.ts) - Database abstractionConnectorAdapter(packages/connectors/src/interface.ts) - Connector patternLLMProvider(packages/llm/src/interface.ts) - LLM abstractionTriggerHandler(packages/triggers/src/) - Trigger pattern
- Unit tests:
tests/unit/[package]/ - Integration tests:
tests/integration/[feature]/ - E2E tests:
tests/e2e/[scenario]/ - Run:
pnpm test
# Add new connector
# 1. Create packages/connectors/src/[name]/adapter.ts
# 2. Implement ConnectorAdapter interface
# 3. Register in packages/connectors/src/registry.ts
# 4. Add tests in tests/unit/connectors/
# Add new trigger type
# 1. Create packages/triggers/src/[name].ts
# 2. Implement trigger handler
# 3. Register in packages/triggers/src/dispatcher.ts
# 4. Add tests in tests/unit/triggers/
# Add API endpoint
# 1. Add route in apps/api/src/routes/[resource].ts
# 2. Add validation with Zod
# 3. Add tests in tests/integration/api/This repository is built to be extended with AI coding agents. Rather than a turnkey product, ODW Loop is a working, well-structured codebase you can clone and adapt to your own needs with an agent like Claude Code. The repo includes agent context files (e.g. CLAUDE.md) and clear architecture docs so an agent can quickly understand the structure and help you customise, integrate, and extend it. To get started: clone the repo, open it with your coding agent, point it at this README and the docs, and describe what you want to build.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with inspiration from:
- n8n - Workflow automation
- Activepieces - Open-source automation
- Trigger.dev - Background jobs
- React Flow - Node-based UI
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Built with โค๏ธ by the ODW.ai team