An open-source workflow automation platform inspired by n8n. Build automations visually with a drag-and-drop canvas, connect services like Telegram and Gmail, and run AI-powered workflows.
n8n-demo.mp4
Web (Next.js :3000)
↕ HTTP REST → Server (Express :8000)
↕ WebSocket ↓
Redis "tasks" list (BLPOP)
↓
Worker (Bun)
↓ Redis pub/sub "updates:<workflowId>"
↑ Server WebSocketManager → Web
↓
PostgreSQL (via Server/Prisma)
The monorepo has three packages:
| Package | Role |
|---|---|
web/ |
Next.js frontend — visual workflow editor |
server/ |
Express API — workflow storage, credential resolution, execution orchestration |
worker/ |
Bun process — pops tasks from Redis queue and executes node functions |
| Layer | Stack |
|---|---|
| Frontend | Next.js 15, React 19, Tailwind CSS v4, React Flow (@xyflow/react) |
| State | Zustand, TanStack Query |
| Backend | Express 5 on Bun |
| Worker | Bun runtime, LangChain, Google Gemini |
| Database | PostgreSQL + Prisma ORM |
| Queue | Redis (list for tasks, pub/sub for status updates) |
| Real-time | ws WebSocket library |
| Resend SDK | |
| AI | LangChain + @langchain/google-genai |
- Bun v1.2+
- Docker and Docker Compose (for PostgreSQL)
- Redis running locally on port 6379
- A Resend account for Gmail nodes
- A Telegram bot token for Telegram nodes
- A Google API key for AI agent nodes
git clone https://github.com/Manas-Kenge/n8n.git
cd n8nbun install # root dev deps (concurrently)
cd server && bun install
cd ../worker && bun install
cd ../web && bun installcd server
docker compose up -dDefault credentials: myuser / mysecretpassword / db: mydb / port: 5432
server/.env
DATABASE_URL="postgresql://myuser:mysecretpassword@localhost:5432/mydb"
RESEND_API_KEY=your_resend_api_key # fallback if not set per-credential
PORT=8000web/.env.local
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_WS_URL=ws://localhost:8000worker/.env
GOOGLE_API_KEY=your_google_api_key # required only for AI agent nodes
REDIS_URL=redis://localhost:6379cd server
npx prisma db push
npx prisma generateAlways use
prisma db push— notprisma migrate dev. See CLAUDE.md for details.
# From repo root
bun run dev:all # server + worker + web
# Or individually
bun run dev:backend # server + worker only
bun run dev:server # server only
bun run dev:worker # worker only
bun run dev:web # web only| Service | URL |
|---|---|
| Web | http://localhost:3000 |
| Server | http://localhost:8000 |
- Open http://localhost:3000
- Click New Workflow on the dashboard
- Drag nodes from the left panel onto the canvas
- Connect nodes by dragging from one node's handle to another
- Click a node to open its configuration panel
- Add credentials via Dashboard → Credentials before configuring nodes
- Click Save, then Run (or the play button on the Manual node)
| Node | Trigger / Action | Credential required |
|---|---|---|
| Manual Trigger | Trigger — starts the workflow | None |
| Telegram | Action — sends a message via Bot API | Bot Token |
| Gmail | Action — sends email via Resend | Resend API Key (optional, falls back to env) |
| AI Agent | Action — LangChain tool-calling agent | Google API Key (via env) |
Credentials are created at Dashboard → Credentials and stored in PostgreSQL. Each node's configuration panel shows a dropdown of compatible credentials. The credential ID is stored in the node's formData and resolved by the server at execution time.
| Method | Endpoint | Description |
|---|---|---|
GET |
/workflows |
List all workflows |
POST |
/workflows |
Create new workflow |
GET |
/workflow/:id |
Get workflow by ID |
PUT |
/workflow/save |
Save workflow nodes and edges |
PUT |
/workflows/:id/name |
Rename workflow |
DELETE |
/workflows/:id |
Delete workflow |
POST |
/workflow/execute/:id |
Execute workflow |
| Method | Endpoint | Description |
|---|---|---|
GET |
/credentials |
List all credentials |
POST |
/credentials |
Create credential (returns ID for node formData) |
GET |
/credentials/:workflowId |
Get credentials for a workflow |
DELETE |
/credentials/:id |
Delete credential |
- Add node config to
web/lib/nodes.ts— definecredentials,formFields, andmodes - Create a node component in
web/components/nodes/ - Register it in
web/components/nodes/NodesLibrary.tsx - Add execution handler in
worker/exec/functions/functions.ts - Register the handler in
worker/exec/functions/configs.ts
n8n/
├── web/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ │ ├── nodes/ # Node-specific components
│ │ └── ui/ # shadcn/ui components
│ ├── hooks/ # Custom hooks (WebSocket, etc.)
│ ├── lib/ # Node configs, utilities
│ ├── store/ # Zustand stores
│ └── helper/ # HTTP helpers, form data embedding
├── server/ # Express API
│ ├── execution/ # WorkFlowExecutor (BFS orchestration)
│ ├── helper/ # Node serialization
│ ├── prisma/ # Schema and Prisma client
│ ├── validations/ # Zod schemas
│ └── websocket.ts # WebSocketManager
├── worker/ # Task executor
│ ├── exec/
│ │ ├── agent/ # LangChain AI agent
│ │ └── functions/ # Node execution handlers
│ ├── index.ts # Redis BLPOP consumer loop
│ ├── redis.ts # Redis pub/sub helpers
│ └── resend.ts # Email sending via Resend
└── README.md
- n8n for the inspiration
- React Flow for the visual canvas
- Resend for email delivery
- LangChain for AI agent tooling