A powerful workflow automation system that enables businesses to automate repetitive tasks and processes through event-driven workflows.
https://work-flow-automation-engine.vercel.app/ (Frontend on vercel and Backend on render)
The Workflow Automation Engine is a full-stack application that allows users to:
- Define custom workflows with trigger events and automated actions
- Execute workflows automatically when specific events occur
- Monitor workflow execution with detailed logging
- Scale operations by chaining multiple actions together
This system is ideal for automating:
- User Onboarding: Send welcome emails, create user accounts, add to CRM when a user signs up
- Order Processing: Send confirmation emails, update inventory, notify shipping team when an order is placed
- Payment Processing: Generate invoices, update subscription status, send receipts when payment is received
- Customer Engagement: Trigger follow-up emails, schedule calls, update CRM based on user actions
- Event-Driven Architecture: Workflows execute automatically when specified events occur
- Flexible Triggers: Support for multiple event types (USER_SIGNUP, ORDER_CREATED, etc.)
- Action Strategies: Extensible action system (Email, Webhook, Slack, and more)
- Real-Time Execution: Immediate processing of events with status tracking
- Visual Interface: Intuitive React frontend for workflow management
- RESTful API: Clean backend API for integration with other systems
- Audit Logging: Complete execution history for debugging and compliance
- Frontend (25%): React + Vite - Modern, fast UI for workflow management
- Backend (75%): Node.js + Express + TypeScript - Robust API server
- Database: PostgreSQL - Reliable data storage with Prisma ORM
- Design Patterns: Strategy Pattern, Factory Pattern, Repository Pattern
- Frontend (25%): React + Vite (UI for workflow management)
- Backend (75%): Node.js + Express + TypeScript (API, workflow execution)
- Database: PostgreSQL (via Prisma ORM)
├── src/ # Backend API (75%)
│ ├── controllers/ # Request handlers
│ ├── services/ # Business logic
│ ├── repositories/ # Data access layer
│ ├── engine/ # Workflow execution engine
│ ├── factories/ # Action strategy factory
│ ├── strategies/ # Action implementations
│ ├── lib/ # Utilities (Prisma client)
│ └── index.ts # Backend entry point
├── frontend/ # Frontend (25%)
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Styles
│ ├── index.html # HTML template
│ ├── vite.config.js # Vite configuration
│ └── package.json
├── prisma/ # Database schema
│ └── schema.prisma
├── prisma.config.ts # Prisma configuration
└── package.json # Monorepo root scripts
- Node.js (v18+)
- PostgreSQL database
- npm or yarn
- Install all dependencies:
npm run install:all- Configure environment variables:
# Create .env file in root
DATABASE_URL=your_database_url
PORT=3000- Set up database:
npx prisma generate
npx prisma db pushImportant: The backend must run in the foreground (not background) to stay alive.
Terminal 1 - Backend (must stay open):
npm run devTerminal 2 - Frontend:
npm run frontend:devOr individually:
# Backend only (foreground)
npm run backend:dev
# Frontend only
npm run frontend:dev- Frontend: http://localhost:5173 (or next available port)
- Backend API: http://localhost:3000
- Health Check: http://localhost:3000/health
The workflow automation engine follows this execution flow:
1. Event Trigger
↓
2. Event Received by Backend (/events endpoint)
↓
3. WorkflowEngine identifies matching workflows
- Filters active workflows
- Matches by event type (USER_SIGNUP, ORDER_CREATED, etc.)
↓
4. For each matching workflow:
- Log execution start (status: in_progress)
- Execute each action in sequence
- Email Action → Send email
- Webhook Action → Call external API
- Slack Action → Send Slack message
- Log execution result (status: success/failed)
↓
5. Response sent to frontend
-
Create a Workflow:
- Define workflow name
- Select trigger event (e.g., USER_SIGNUP)
- Add actions with configuration (e.g., send email to user)
- Workflow saved as "inactive" by default
-
Activate Workflow:
- Call
/workflows/:id/activateendpoint - Workflow status changes to "active"
- Now ready to respond to events
- Call
-
Trigger Event:
- Send event to
/eventsendpoint with:eventType: The event type to matchpayload: Data to pass to actions
- Engine finds all active workflows matching the event type
- Executes each workflow's actions sequentially
- Send event to
-
Action Execution:
- Each action uses a strategy pattern
- ActionFactory creates appropriate action strategy
- Strategy executes with provided configuration
- Results logged in ExecutionLog table
Scenario: Send welcome email when user signs up
-
Create Workflow:
- Name: "User Welcome Email"
- Trigger Event: USER_SIGNUP
- Action: EMAIL
- Config:
{ recipient: "{{email}}", subject: "Welcome!", body: "Thanks for signing up" }
-
Activate Workflow
- Call POST
/workflows/{id}/activate
- Call POST
-
Trigger Event:
POST /events { "eventType": "USER_SIGNUP", "payload": { "userId": "123", "email": "newuser@example.com", "name": "John Doe" } }
-
Result:
- Engine finds "User Welcome Email" workflow
- Executes EMAIL action with provided payload
- Logs execution as success
- Returns response to frontend
- Create workflows with triggers and actions
- List all workflows
- Activate/deactivate workflows
- Trigger events to execute workflows
- Real-time response display
Workflow Endpoints:
POST /workflows- Create a new workflowGET /workflows- List all workflowsPOST /workflows/:id/activate- Activate a workflowPOST /events- Trigger an event
Supported Event Types:
- USER_SIGNUP
- USER_LOGIN
- ORDER_CREATED
- PAYMENT_RECEIVED
Supported Action Types:
- EMAIL - Send email
- WEBHOOK - Call webhook
- SLACK - Send Slack message
npm run dev- Start backend servernpm run start- Start backend in productionnpm run build- Build backend TypeScriptnpm run backend:dev- Start backend (alias)npm run frontend:dev- Start frontend development servernpm run frontend:install- Install frontend dependenciesnpm run install- Install all dependencies