A comprehensive workflow automation platform that allows you to build, manage, and execute complex task workflows (DAGs) with a visual interface. Create automated workflows with HTTP requests, email notifications, database operations, scripts, and more.
- Visual DAG Builder: Drag-and-drop interface to create complex workflows
- Multiple Task Types: HTTP requests, emails, database queries, scripts, file operations, webhooks, delays, notifications, data transformations, and conditional logic
- Real-time Execution Monitoring: Live logs and execution tracking via WebSocket
- Worker Management: Distributed task execution with worker health monitoring
- Execution History: Track and analyze past workflow executions
- Scheduled Executions: Cron-based scheduling for automated workflows
- π Variables & Secrets Management: Securely store and use API keys, tokens, and configuration values with encryption
- π Conditional Logic: Add if/else branches to workflows with multiple comparison operators
- π API & Webhook Triggers: Trigger workflows externally via secure tokens or custom webhook endpoints
- π Workflow Templates: Pre-built templates to jumpstart your automation
- π Data Passing: Automatic variable substitution and task output context
- π€π₯ Export/Import: Share workflows as JSON files
- π§ Scheduled Emails: Schedule and manage email notifications
- π Notifications: Send Slack/Discord notifications
- Node.js with Express.js
- MongoDB with Mongoose
- Redis (Upstash) for task queue management
- Socket.io for real-time communication
- Passport.js for authentication
- Nodemailer for email functionality
- Node-cron for scheduling
- React with Vite
- Material-UI for UI components
- React Flow for visual DAG builder
- Socket.io Client for real-time updates
- Recharts for analytics
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local or cloud instance)
- Redis account (Upstash recommended) or local Redis instance
-
Clone the repository
git clone <repository-url> cd task-schedular
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
Create a .env file in the backend directory with the following variables:
# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:5173
ALLOW_ALL_ORIGINS=true
# Database
MONGO_URI=mongodb://localhost:27017/taskScheduler
# Or for MongoDB Atlas:
# MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/taskScheduler
# Redis (Upstash)
UPSTASH_REDIS_REST_URL=your_upstash_redis_url
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_token
# Session & Security
SESSION_SECRET=your-super-secret-session-key-change-in-production
ENCRYPTION_KEY=your-32-character-encryption-key-for-secrets
# Worker Configuration (optional)
WORKER_SOCKET_PORT=7000- Sign up at Upstash
- Create a new Redis database
- Copy the REST URL and REST Token to your
.envfile
-
Start the backend server
cd backend npm run devThe server will start on
http://localhost:5000 -
Start the frontend development server (in a new terminal)
cd frontend npm run devThe frontend will be available at
http://localhost:5173 -
Start a worker (optional, in a new terminal)
cd backend npm run workerWorkers execute tasks from the queue. You can run multiple workers for distributed processing.
-
Build the frontend
cd frontend npm run build -
Start the backend
cd backend npm start
task-schedular/
βββ backend/
β βββ config/ # Database configuration
β βββ controllers/ # Route controllers
β βββ middleware/ # Authentication middleware
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ scheduler/ # Cron scheduler
β βββ services/ # Background services
β βββ utils/ # Utility functions
β βββ websocket/ # Socket.io server
β βββ worker/ # Task execution workers
β βββ server.js # Main server file
βββ frontend/
β βββ src/
β β βββ api/ # API client functions
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ utils/ # Utility functions
β β βββ App.jsx # Main app component
β βββ vite.config.mjs # Vite configuration
βββ README.md
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout userGET /api/auth/me- Get current user
GET /api/dags- List all DAGsPOST /api/dags- Create a new DAGGET /api/dags/:id- Get DAG detailsPUT /api/dags/:id- Update DAGDELETE /api/dags/:id- Delete DAGPOST /api/dags/:id/execute- Manually trigger DAG executionGET /api/dags/:id/export- Export DAG as JSONPOST /api/dags/import- Import DAG from JSON
GET /api/executions- List all executionsGET /api/executions/:id- Get execution detailsGET /api/executions/:id/logs- Get execution logs
GET /api/workers- List all workersPOST /api/workers- Register a workerDELETE /api/workers/:id- Remove a worker
GET /api/variables- List all variablesPOST /api/variables- Create variablePUT /api/variables/:id- Update variableDELETE /api/variables/:id- Delete variable
GET /api/triggers- List all triggersPOST /api/triggers- Create triggerPOST /api/triggers/token/:token- Trigger DAG by token (public)POST /api/triggers/webhook/:path- Trigger DAG by webhook (public)
GET /api/templates- List all templatesGET /api/templates/:id- Get template detailsPOST /api/templates- Create templatePOST /api/templates/:id/use- Create DAG from templatePOST /api/templates/defaults- Create default templates
Store an API key securely:
POST /api/variables
{
"name": "api_key",
"value": "your-secret-key",
"isSecret": true,
"description": "API key for external service"
}Reference variables in task configurations using {{variableName}}:
{
"type": "http",
"name": "Fetch Data",
"config": {
"url": "https://api.example.com/data",
"method": "GET",
"headers": {
"Authorization": "Bearer {{api_key}}"
}
}
}Allow external systems to trigger your workflow:
POST /api/triggers
{
"dagId": "your_dag_id",
"name": "GitHub Webhook",
"type": "webhook",
"webhookPath": "github-events"
}Then trigger from external system:
curl -X POST http://your-server.com/api/triggers/webhook/github-eventsCreate a workflow with conditional logic:
{
"nodes": [
{
"id": "1",
"type": "http",
"name": "Check Status"
},
{
"id": "2",
"type": "condition",
"name": "If Success",
"config": {
"condition": {
"field": "status",
"value": 200
},
"operator": "equals"
}
},
{
"id": "3",
"type": "email",
"name": "Send Success Email"
}
],
"edges": [
{ "source": "1", "target": "2" },
{ "source": "2", "target": "3" }
]
}- HTTP Request - Call REST APIs
- Send Email - Send emails via SMTP
- Database - Query MongoDB
- Script - Execute Node.js, Python, or Bash scripts
- File - Read, write, copy, delete files
- Webhook - Send webhook requests
- Delay - Wait for specified duration
- Notification - Send Slack/Discord notifications
- Transform - Transform data with JavaScript
- Condition - Conditional logic with if/else branches
- Encryption: AES-256-CBC encryption for secrets
- User Isolation: All data scoped to user ID
- Token-Based Triggers: Secure random tokens for API triggers
- Session Management: Passport.js session-based authentication
- CORS Protection: Configurable CORS policies
# Backend tests (if available)
cd backend
npm test
# Frontend tests (if available)
cd frontend
npm test- Backend follows MVC pattern
- Frontend uses React functional components with hooks
- Real-time updates via WebSocket
- Worker-based task execution for scalability
For more detailed information about automation features, see AUTOMATION_FEATURES.md.
Contributions are welcome! Please feel free to submit a Pull Request.