A self-hostable, zero-cost, local-first automation platform for creating and running visual workflows
Project description
ModusFlow
A self-hostable, zero-cost, local-first automation platform for creating and running visual workflows.
Features
- ๐จ Visual Workflow Editor: Drag-and-drop interface using React Flow
- ๐ค AI-Assisted Generation: Generate workflows from plain English prompts
- โก Async DAG Engine: Parallel execution where possible
- ๐พ Local-First: SQLite for history, JSON/YAML for workflows (Git-friendly)
- ๐ฅ๏ธ CLI Tool: Headless execution and validation
- ๐ง Node Types: Python scripts, HTTP requests, AI models, Shell commands, Delays
- ๐ Live Logging: Real-time execution logs per node
- ๐ฐ Cost Estimation: Token and cost tracking for AI nodes
- ๐ Error Handling: Retries, on_fail paths, custom error handling
Quick Start
Prerequisites
- Python 3.8+
- Node.js 16+
- (Optional) API keys for AI providers (Anthropic, OpenAI, or OpenRouter)
Backend Setup
cd backend
pip install -r requirements.txt
# Copy .env.example to .env and add your API keys
cp .env.example .env
# Start the backend
uvicorn app.main:app --reload --port 8000
Frontend Setup
cd frontend
npm install
npm run dev
Visit http://localhost:5173 to access the visual editor.
CLI Installation
cd cli
pip install -e .
CLI Usage
# Run a workflow
modusflow run data/workflows/example_web_scraper.json
# Generate a workflow from a prompt
modusflow generate "scrape a website and summarize with AI" -o my_workflow.json
# Validate a workflow
modusflow validate data/workflows/example_web_scraper.json
Architecture
- Backend: FastAPI + Python async execution engine
- Frontend: React + TypeScript + React Flow + Monaco Editor
- Storage:
- SQLite database for execution history (
data/modusflow.db) - JSON/YAML files for workflows (
data/workflows/*.json)
- SQLite database for execution history (
- AI: Free-tier LLMs via Anthropic (Claude Haiku), OpenAI (GPT-3.5), or OpenRouter
Node Types
Python Node
Execute Python code. Output should be JSON-printable or plain text.
import json
result = {"message": "Hello, World!"}
print(json.dumps(result))
HTTP Node
Make HTTP requests (GET, POST, PUT, DELETE, PATCH).
{
"url": "https://api.example.com/data",
"method": "GET",
"headers": {"Authorization": "Bearer token"}
}
AI Node
Call AI models (Claude, GPT, etc.).
{
"provider": "anthropic",
"model": "claude-3-haiku-20240307",
"prompt": "Summarize: ${previous_node}",
"system_prompt": "You are a helpful assistant."
}
Shell Node
Execute shell commands.
{
"command": "ls -la | head -10"
}
Delay Node
Wait for a specified duration.
{
"seconds": 2.5
}
Using Node Outputs
Reference outputs from previous nodes using ${node_id} syntax:
{
"prompt": "Summarize this: ${fetch_node}"
}
Error Handling
- Retries: Set
retriesandretry_delayon any node - On-Fail Path: Set
on_failto a node ID that executes on failure - Status Tracking: Each node tracks success/failure status
Docker Deployment
# Build and run with Docker Compose
docker-compose up --build
# Or build manually
docker build -t modusflow .
docker run -p 8000:8000 -v $(pwd)/data:/app/data modusflow
Development
Project Structure
ModusFlow1/
โโโ backend/ # FastAPI backend
โ โโโ app/
โ โ โโโ main.py # FastAPI app
โ โ โโโ executor.py # DAG execution engine
โ โ โโโ ai_client.py # AI provider clients
โ โ โโโ routes/ # API routes
โ โ โโโ models.py # Pydantic models
โ โโโ requirements.txt
โโโ frontend/ # React frontend
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ store/ # Zustand state
โ โ โโโ types.ts # TypeScript types
โ โโโ package.json
โโโ cli/ # CLI tool
โ โโโ modusflow/
โ โโโ cli.py
โโโ data/ # Data directory
โโโ workflows/ # Workflow JSON files
โโโ modusflow.db # SQLite database
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modusflow-1.0.0.tar.gz.
File metadata
- Download URL: modusflow-1.0.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94d422c15a8a2ed978e3bedda1bc0eca7a50b4b33f0bf494154cddff5108d306
|
|
| MD5 |
5ff9ef85c87427fff6b4cdde493440e2
|
|
| BLAKE2b-256 |
8234f4af847b494d6f3c5783631e7019dbb1fc525c392b62f04c2603efcfcd61
|
File details
Details for the file modusflow-1.0.0-py3-none-any.whl.
File metadata
- Download URL: modusflow-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8802d4cc53a107ba97fff0bf85d7f7676c6ff5787b2e8f1b97af8181ebaed70d
|
|
| MD5 |
d012543090e0d92212c8ff3e2b311b6c
|
|
| BLAKE2b-256 |
bc9a0d8c5b0792bee4a64cbebdc17ee0a9ab89a2d22cc866a542270dc0753f3c
|