A visual workflow editor for trading automation with OpenAlgo integration. Build complex trading workflows with a drag-and-drop interface similar to n8n.
- Visual workflow editor with ReactFlow
- 30+ node types for comprehensive trading automation
- Options trading with multi-leg strategies (Iron Condor, Straddle, Strangle, Spreads)
- Schedule-based and price alert triggers
- Conditional branching (If/Else logic)
- Variable system for data passing between nodes
- Real-time LTP updates via WebSocket
- SQLite database (zero configuration)
- Dark theme optimized for trading
- Python 3.11+
- Node.js 18+
- uv (auto-installed by setup script)
- OpenAlgo running locally or remotely
- Run setup (installs uv if needed):
setup.bat- Start the application:
start.bat- Run setup:
chmod +x setup.sh start.sh
./setup.sh- Start the application:
./start.shcd backend
uv run uvicorn app.main:app --host 127.0.0.1 --port 8000 --reloadcd frontend
npm run devOpen http://localhost:5173 in your browser.
cd backend
cp .env.example .env # Copy environment template
uv sync # Install dependencies
uv run migration/migrate_all.py # Run database migrationscd frontend
npm install- Open http://localhost:5173
- Go to Settings
- Enter your OpenAlgo credentials:
- API Key: Your OpenAlgo API key
- Host URL: OpenAlgo REST API URL (default: http://127.0.0.1:5000)
- WebSocket URL: OpenAlgo WebSocket URL (default: ws://127.0.0.1:8765)
- Click "Test Connection" to verify
- Save settings
- Click "New Workflow" on the Dashboard
- Drag nodes from the left panel to the canvas
- Connect nodes by dragging from one handle to another
- Configure each node by clicking on it
- Save the workflow
- Click "Activate" to start the schedule
| Node | Description |
|---|---|
| Schedule | Start workflow at specified time (once/daily/weekly/interval) |
| Price Alert | Real-time WebSocket monitoring - triggers when price condition is met |
| Webhook | External HTTP trigger with secret authentication |
| Condition | Description |
|---|---|
| Greater Than | LTP > target price |
| Less Than | LTP < target price |
| Crossing | Price crosses the target (either direction) |
| Crossing Up | Price crosses above target |
| Crossing Down | Price crosses below target |
| Entering Channel | Price enters a price range |
| Exiting Channel | Price exits a price range |
| Moving Up % | Price moved up by X% |
| Moving Down % | Price moved down by X% |
| Node | Description |
|---|---|
| Place Order | Place a basic trading order |
| Smart Order | Position-aware ordering with auto quantity |
| Options Order | ATM/ITM/OTM options with expiry selection |
| Multi-Leg | Options strategies (Straddle, Strangle, Iron Condor, Spreads) |
| Basket Order | Execute multiple orders at once |
| Split Order | Split large orders into smaller chunks |
| Modify Order | Modify an existing order |
| Cancel Order | Cancel a specific order by ID |
| Cancel All | Cancel all open orders |
| Close Positions | Square off all positions |
| Type | Description |
|---|---|
| Current Week | Nearest weekly expiry |
| Next Week | Second weekly expiry |
| Current Month | Last expiry of current month |
| Next Month | Last expiry of next month |
| Strategy | Description |
|---|---|
| Straddle | ATM CE + ATM PE (same strike) |
| Strangle | OTM CE + OTM PE (different strikes) |
| Iron Condor | 4-leg neutral strategy |
| Bull Call Spread | Buy ATM CE, Sell OTM CE |
| Bear Put Spread | Buy ATM PE, Sell OTM PE |
| Node | Description |
|---|---|
| Position Check | Check if position exists or quantity threshold |
| Fund Check | Verify available margin |
| Price Condition | Compare price against threshold |
| Time Window | Check if within market hours |
| Node | Description |
|---|---|
| Get Quote | Fetch real-time quote (LTP, OHLC, volume) |
| Get Depth | 5-level bid/ask market depth |
| Order Status | Check status of a specific order |
| Open Position | Get current position details |
| History | Fetch OHLCV historical data |
| Expiry Dates | Get F&O expiry dates |
| Node | Description |
|---|---|
| Variable | Store and manipulate values |
| Log | Debug logging with levels (info/warn/error) |
| Telegram | Send alerts via Telegram |
| Delay | Wait for specified duration |
| Group | Organize nodes visually |
Use variables to pass data between nodes:
- Set variables with the Variable node
- Reference variables using
{{variableName}}syntax - Access nested properties:
{{quote.ltp}},{{position.quantity}} - System variables:
{{timestamp}},{{date}},{{time}}
- NSE (Equity)
- NFO (F&O)
- BSE (Equity)
- BFO (F&O)
- CDS (Currency)
- BCD (Currency)
- MCX (Commodity)
- NCDEX (Commodity)
- NSE_INDEX
- BSE_INDEX
| Symbol | Lot Size |
|---|---|
| NIFTY | 75 |
| BANKNIFTY | 30 |
| FINNIFTY | 65 |
| MIDCPNIFTY | 120 |
| NIFTYNXT50 | 25 |
| Symbol | Lot Size |
|---|---|
| SENSEX | 20 |
| BANKEX | 30 |
| SENSEX50 | 25 |
| Type | Description |
|---|---|
| MARKET | Execute at market price |
| LIMIT | Execute at specified price |
| SL | Stop Loss with limit |
| SL-M | Stop Loss at market |
| Type | Description |
|---|---|
| MIS | Intraday (auto square-off) |
| CNC | Cash & Carry (delivery) |
| NRML | Normal (F&O) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/settings | Get settings |
| PUT | /api/settings | Update settings |
| POST | /api/settings/test | Test connection |
| GET | /api/workflows | List workflows |
| POST | /api/workflows | Create workflow |
| GET | /api/workflows/{id} | Get workflow |
| PUT | /api/workflows/{id} | Update workflow |
| DELETE | /api/workflows/{id} | Delete workflow |
| POST | /api/workflows/{id}/activate | Activate |
| POST | /api/workflows/{id}/deactivate | Deactivate |
| POST | /api/workflows/{id}/execute | Run now |
| GET | /api/workflows/{id}/webhook | Get webhook info |
| POST | /api/workflows/{id}/webhook/enable | Enable webhook |
| POST | /api/workflows/{id}/webhook/disable | Disable webhook |
| POST | /api/workflows/{id}/webhook/regenerate | Regenerate URL & secret |
| POST | /api/webhook/{token} | Trigger workflow via webhook |
| POST | /api/webhook/{token}/{symbol} | Trigger with symbol in URL |
Create backend/.env file:
cd backend
cp .env.example .envThen edit the .env file:
# Debug mode (default: false)
DEBUG=false
# Server configuration
HOST=127.0.0.1
PORT=8000
# Database URL
DATABASE_URL=sqlite+aiosqlite:///./openalgo_flow.db
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173
# Webhook host URL (for generating webhook URLs)
# Set this to your public URL when deploying
WEBHOOK_HOST_URL=http://127.0.0.1:8000When updating the database schema, run migrations:
cd backend
uv run migration/migrate_all.pyOpenAlgo Flow supports external webhook triggers, allowing you to trigger workflows from TradingView, Chartink, custom scripts, or any HTTP client.
- Each workflow has a unique Webhook URL and Webhook Secret
- External systems send a POST request with JSON payload
- The secret is validated before execution (supports two auth methods)
- Payload data is available as
{{webhook.*}}variables
OpenAlgo Flow supports two authentication methods to accommodate different services:
| Method | Use Case | How It Works |
|---|---|---|
| Secret in Payload | TradingView, custom scripts | Include "secret": "your_secret" in JSON body |
| Secret in URL | Chartink, fixed-format services | Append ?secret=your_secret to webhook URL |
Configure the authentication method from Dashboard > Workflow Menu > Webhook.
# Generic webhook (secret in payload)
POST https://your-host/api/webhook/{token}
# With secret in URL (for Chartink, etc.)
POST https://your-host/api/webhook/{token}?secret=your_secret
# With symbol in URL
POST https://your-host/api/webhook/{token}/{symbol}
POST https://your-host/api/webhook/{token}/{symbol}?secret=your_secret
| Variable | Description |
|---|---|
{{webhook.symbol}} |
Symbol from URL or payload |
{{webhook.action}} |
Action (BUY/SELL) |
{{webhook.price}} |
Price from payload |
{{webhook.quantity}} |
Quantity from payload |
{{webhook.stocks}} |
Stocks from Chartink payload |
{{webhook.trigger_prices}} |
Trigger prices from Chartink |
{{webhook.scan_name}} |
Scan name from Chartink |
{{webhook.custom_field}} |
Any custom field you send |
From Dashboard:
- Click the menu (⋮) on any workflow card
- Select "Webhook"
- Enable webhook and choose authentication method
- Copy URL & secret
From Editor:
- Add a "Webhook Trigger" node
- URL and secret are displayed in the config panel
- Set symbol for dynamic URL generation
- Create workflow with Webhook Trigger node
- Enable webhook from Dashboard (use "Secret in Payload" auth)
- In TradingView, create alert with webhook URL
- Set message body:
{
"secret": "your_secret",
"symbol": "{{ticker}}",
"action": "{{strategy.order.action}}",
"price": {{close}},
"quantity": 10
}- Create workflow with Webhook Trigger node
- Enable webhook from Dashboard (use "Secret in URL" auth)
- Copy the "Webhook URL (with secret)" - includes
?secret=... - In Chartink, set the webhook URL with the secret query parameter
Chartink sends payloads in this format (cannot be modified):
{
"stocks": "RELIANCE,INFY,TCS",
"trigger_prices": "2500.50,1800.25,3500.00",
"triggered_at": "9:30 am",
"scan_name": "My Scanner",
"scan_url": "my-scanner",
"alert_name": "Buy Alert"
}Access data in workflow using {{webhook.stocks}}, {{webhook.scan_name}}, etc.
- Each workflow has unique token (URL) and secret
- Secret is validated on every request
- Two auth methods: payload-based or URL-based
- Failed auth returns 401 Unauthorized
- Rate limit: 30 requests/minute per endpoint
OpenAlgo Flow supports real-time price monitoring using WebSocket streaming from OpenAlgo.
- Add a Price Alert trigger node to your workflow
- Configure the symbol, exchange, and price condition
- Activate the workflow to start real-time monitoring
- When the price condition is met, the workflow triggers automatically
- Real-time Monitoring: Uses WebSocket for instant price updates (not polling)
- Multiple Conditions: Support for various price conditions (crossing, channels, percentages)
- One-shot Trigger: Workflow triggers once when condition is met, then deactivates
- Multiple Alerts: Monitor multiple symbols across different workflows simultaneously
- Breakout Alert: Trigger when NIFTY crosses above 26000
- Stop Loss: Execute sell order when price drops below threshold
- Range Trading: Alert when price enters or exits a channel
- Momentum: Detect when price moves up/down by X%
When a price alert triggers, the following variables are available:
| Variable | Description |
|---|---|
{{webhook.trigger_type}} |
Always "price_alert" |
{{webhook.trigger_price}} |
The price that triggered the alert |
{{webhook.triggered_at}} |
Timestamp when alert triggered |
Check active price monitors:
GET /api/workflows/price-monitor/status
- Frontend: React, ReactFlow, shadcn/ui, TailwindCSS, Zustand
- Backend: FastAPI, SQLAlchemy, APScheduler
- Database: SQLite
- Integration: OpenAlgo Node SDK 1.0.5
- API keys are stored in the local SQLite database
- Run on localhost for development only
- Do not expose to public internet without proper authentication
AGPL V3