Zuri Flow is a lightweight, multi-language workflow orchestration engine built on Celery, Redis, and PostgreSQL. It enables you to create complex task workflows with dependencies, supporting execution in Python, JavaScript/Node.js, TypeScript, Go, Bash, and C.
- π Workflow Orchestration - Define complex DAG workflows with task dependencies
- π Multi-Language Support - Execute tasks in 6+ programming languages
- β‘ Asynchronous Execution - Powered by Celery for distributed task processing
- π Task Dependencies - Automatic dependency resolution and parallel execution
- πΎ Persistent Results - PostgreSQL backend for reliable result storage
- π Real-time Monitoring - Track workflow and task status in real-time
- π― Standalone Tasks - Execute individual tasks outside of workflows
- β° Scheduled Tasks - Support for periodic/cron-like task execution
- π Lightweight & Fast - Minimal overhead, production-ready
- Python 3.10+
- Redis server
- PostgreSQL server
- Node.js (for JavaScript/TypeScript executors)
- Go compiler (for Go executor)
- GCC/Clang (for C executor - optional)
git clone https://github.com/mitayan0/Zuri-Flow.git
cd Zuri-Flowpython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtCopy the example environment file and update with your settings:
copy .env.example .env # Windows
# OR
cp .env.example .env # Linux/macOSEdit .env with your database and Redis connection strings.
Make sure both services are started and accessible at the URLs specified in your .env file.
uvicorn main:app --reload --host 0.0.0.0 --port 8000Open a new terminal and run:
celery -A engine_core.celery_app worker --loglevel=info -Q orchestrator,python,javascript,typescript,go,bash,c -P threadsUse the examples in the examples/ directory or create your own:
# Example: Create a multi-language workflow
curl -X POST http://localhost:8000/api/v1/workflows/definitions \
-H "Content-Type: application/json" \
-d @examples/multi_language_pipeline.json
# Run the workflow (use the ID returned from above)
curl -X POST http://localhost:8000/api/v1/workflows/definitions/{definition_id}/runSupports three modes:
1. Inline Code:
{
"executor": "python",
"params": {
"code": "result = {'message': 'Hello from Python!', 'value': 42}"
}
}2. Script File:
{
"executor": "python",
"params": {
"script_path": "/path/to/script.py",
"args": ["arg1", "arg2"]
}
}Inline Code:
{
"executor": "javascript",
"params": {
"code": "const result = {message: 'Hello from Node.js!'}; console.log(JSON.stringify(result));"
}
}NPM Module:
{
"executor": "javascript",
"params": {
"module": "eslint",
"args": ["--version"]
}
}Inline Code:
{
"executor": "typescript",
"params": {
"code": "interface Result { success: boolean; } const result: Result = { success: true }; console.log(JSON.stringify(result));"
}
}Inline Code:
{
"executor": "go",
"params": {
"code": "package main\nimport \"fmt\"\nfunc main() {\n\tfmt.Println(\"Hello from Go!\")\n}"
}
}Pre-compiled Binary:
{
"executor": "go",
"params": {
"binary_path": "/path/to/binary"
}
}{
"executor": "bash",
"params": {
"command": "echo 'Hello from Bash!'",
"cwd": "/path/to/working/dir",
"env": {"MY_VAR": "value"}
}
}Inline Code (will compile and run):
{
"executor": "c",
"params": {
"code": "#include <stdio.h>\nint main() { printf(\"Hello from C!\\n\"); return 0; }",
"compiler_flags": ["-O2"]
}
}| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/workflows/definitions |
Create a workflow definition |
POST |
/api/v1/workflows/definitions/{id}/run |
Execute a workflow |
GET |
/api/v1/workflows/runs/{run_id} |
Get workflow run details |
GET |
/api/v1/workflows/runs/{run_id}/status |
Get workflow run status |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/tasks |
Create a standalone task |
POST |
/api/v1/tasks/{task_id}/run |
Execute a task |
POST |
/api/v1/tasks/{task_id}/schedule |
Schedule periodic task execution |
{
"name": "My Workflow",
"start_tasks": ["task1"],
"tasks": {
"task1": {
"task_name": "task1",
"executor": "python",
"dependencies": [],
"params": {
"code": "result = {'status': 'complete'}"
}
},
"task2": {
"task_name": "task2",
"executor": "javascript",
"dependencies": ["task1"],
"params": {
"code": "console.log('Task 2 runs after task1');"
}
}
}
}By default, Zuri Flow creates separate queues for each executor. You can customize queue configuration in config.py:
QUEUES = [
"orchestrator",
"python",
"javascript",
"typescript",
"go",
"bash",
"c"
]Configure task timeouts in .env:
TASK_TIMEOUT=3600 # 1 hour hard limit
TASK_SOFT_TIMEOUT=3300 # 55 minutes soft limit
Start Flower for web-based Celery monitoring:
celery -A engine_core.celery_app flowerAccess dashboard at: http://localhost:5555
βββββββββββββββ
β FastAPI β β REST API Server
β (main.py) β
ββββββββ¬βββββββ
β
βββββββββββββββββββββββββββ
β β
ββββββββΌβββββββ ββββββββββΌβββββββββ
β PostgreSQL β β Redis (Broker) β
β (Workflow β β & Backend β
β Data) β βββββββββββββββββββ
βββββββββββββββ β
β
ββββββββββΌββββββββββ
β Celery Workers β
β βββββββββββββββ β
β βOrchestrator β β
β βββββββββββββββ€ β
β β Python β β
β β JavaScript β β
β β TypeScript β β
β β Go β β
β β Bash β β
β β C β β
β βββββββββββββββ β
ββββββββββββββββββββ
Check the examples/ directory for workflow templates:
python_hello_world.json- Simple Python taskjavascript_data_processing.json- JavaScript data processingmulti_language_pipeline.json- Complex multi-language workflow with dependenciestypescript_example.json- TypeScript execution example
1. Celery workers not picking up tasks
- Ensure all queues are specified when starting workers
- Check Redis connection
2. Task execution fails with "executor not found"
- Verify the language runtime is installed (node, go, gcc, etc.)
- Check
config.pyfor correct executor paths
3. Database connection errors
- Verify PostgreSQL is running
- Check
DATABASE_URLin.env
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.