Workflow automation is a comprehensive YAML-first backend runtime platform that combines workflow orchestration, API execution, and business process management. It provides a secure, controlled environment for executing business logic defined in YAML files.
- YAML-First Execution: Define business workflows in YAML and execute them through REST APIs
- Multi-Service Architecture: Integrated Temporal workflows, N8N automation, and PostgreSQL database
- Authentication & Authorization: OAuth2 proxy integration with role-based access control
- Database Management: Drizzle ORM with PostgreSQL and Row Level Security (RLS)
- API Gateway: Traefik reverse proxy for service routing
- MCP Integration: Model Context Protocol support for AI tool exposure
- Admin Interface: PgAdmin for database administration
The platform consists of several interconnected services:
- Stockflow API: Main execution engine for YAML workflows
- Temporal: Distributed workflow orchestration
- N8N: Node-based workflow automation
- PostgreSQL: Primary database with RLS
- Traefik: API gateway and load balancer
- OAuth2 Proxy: Authentication middleware
- PgAdmin: Database administration interface
- Docker and Docker Compose
- Node.js 18+ (for local development)
- PostgreSQL client (optional, for direct DB access)
-
Clone the repository
git clone <repository-url> cd autobizt/supabase
-
Configure environment
cp .env.example .env # Edit .env with your configuration -
Start all services
docker compose up -d
-
Access the services
- Main API: http://localhost:8080/api
- N8N: http://localhost:8080/n8n
- Temporal UI: http://localhost:8080/temporal
- PgAdmin: http://localhost:8084
- Traefik Dashboard: http://localhost:8081
-
Setup Stockflow
cd stockflow npm install npm run db:generate npm run dev -
Setup Temporal (optional)
cd temporal npm install npm run worker
Create your PostgreSQL tables first, then generate Drizzle artifacts:
cd stockflow
npm run db:generate
npm run db:migrateAdd workflow files in stockflow/data/functions/:
name: createCustomer
version: 1
skill: true
title: "Create new customer"
params:
email:
type: string
required: true
name:
type: string
required: true
phone:
type: string
required: true
steps:
- name: persistCustomer
type: persist
actions:
- mode: insert
collection: customers
document:
name: "{{params.name}}"
email: "{{params.email}}"
phone: "{{params.phone}}"
return: "{{steps.persistCustomer}}"Call the runtime API:
curl -X POST http://localhost:8080/api/rpc \
-H "Content-Type: application/json" \
-d '{
"operation": "createCustomer",
"params": {
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890"
}
}'See .env.example for all available configuration options. Key variables:
DATABASE_URL: PostgreSQL connection stringJWT_SECRET: Secret key for JWT tokensOAUTH2_PROXY_*: OAuth2 proxy configurationTEMPORAL_HOST: Temporal server addressOPENAI_API_KEY: OpenAI API key for AI workflows
The system includes comprehensive business entities:
- Users & Roles: Authentication and authorization
- Customers & Suppliers: Business partners
- Products & Inventory: Product management with batches
- Quotations & Invoices: Sales process
- Purchase Orders: Procurement
- Journal Entries: Accounting
- Delivery Challans: Shipping documents
GET /api- Health checkPOST /api/rpc- Execute YAML functionPOST /api/query- Run database queriesPOST /mcp- MCP tool execution
call- Execute system functionsmap- Transform dataeditField- Modify object propertiesreference- Call other YAML functionsquery- Database queriespersist- Database operations (insert/update/delete)condition- Conditional logicloop- Iterate over arrays
- Row Level Security (RLS): Database-level access control
- OAuth2 Authentication: External identity provider integration
- JWT Tokens: Stateless authentication
- Role-Based Access: Admin, Staff, Viewer roles
cd stockflow
npm testcd stockflow
npm run build# Generate schema
npm run db:generate
# Push migrations
npm run db:migrate- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and validation
- Submit a pull request
This project is licensed under the MIT License.
For questions and support:
- Check the documentation in
DOCS.md - Review
USER_MANUAL.mdfor usage examples - Check
AGENT.mdfor development guidelines
- The project evolved from individual services to an integrated platform
- Legacy
bpm_engine/and standalonetemporal/are preserved but not actively maintained - Focus is on the unified
stockflow/runtime with multi-service orchestration