Skip to content

mrpawarGit/workflow-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”§ AI Workflow Builder

A visual, no-code platform for building AI-powered chatbots by connecting drag-and-drop nodes. Create custom workflows with document knowledge bases and Google Gemini AI integration.

🌟 Features

  • 🎨 Visual Workflow Designer - Drag-and-drop interface powered by React Flow
  • πŸ€– AI Integration - Google Gemini 2.0 Flash for intelligent responses
  • πŸ“š Knowledge Base - Upload PDFs and enable semantic search
  • πŸ’¬ Real-time Chat - Test workflows with interactive chat interface
  • πŸ’Ύ Workflow Persistence - Save and reuse workflows
  • πŸ” Vector Search - Cosine similarity-based document retrieval
  • πŸ“Š Execution Logs - Track workflow performance and token usage

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  FRONTEND (React + Vite)                                 β”‚
β”‚  - Visual workflow canvas                                β”‚
β”‚  - Node configuration panel                              β”‚
β”‚  - Chat interface                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ REST API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  BACKEND (Node.js + Express)                             β”‚
β”‚  - Workflow execution engine                             β”‚
β”‚  - LLM service (Gemini)                                  β”‚
β”‚  - PDF processing & embeddings                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚ Mongoose ODM
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DATABASE (MongoDB)                                      β”‚
β”‚  - Workflows | Documents | Chat History                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

Installation

# Clone repository
git clone https://github.com/yourusername/workflow-builder.git
cd workflow-builder

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

Configuration

Backend (.env):

cd backend
cp .env.example .env
# Edit .env and add your credentials:
# - GOOGLE_API_KEY=your_gemini_api_key
# - MONGODB_URI=mongodb://localhost:27017/workflow_builder

Frontend (.env):

cd frontend
cp .env.example .env
# VITE_API_URL=http://localhost:5000

Run Application

# Terminal 1 - Start MongoDB (if local)
mongod

# Terminal 2 - Start Backend
cd backend
npm run dev
# Server runs on http://localhost:5000

# Terminal 3 - Start Frontend
cd frontend
npm run dev
# App runs on http://localhost:5173

Access Application

Open browser: http://localhost:5173

πŸ“– Usage Guide

1. Create Workflow

  1. Drag nodes from left panel to canvas:

    • User Query - Captures user input
    • Knowledge Base - Retrieves context from PDFs
    • LLM Engine - AI processing (Gemini)
    • Output - Displays response
  2. Connect nodes by dragging from output to input ports

  3. Configure LLM node:

    • Click node β†’ Right panel
    • Select Provider: Google Gemini
    • Select Model: gemini-2.0-flash
  4. Save workflow (blue Save button)

2. Upload Documents (Optional)

  1. Click Chat button
  2. Click πŸ“Ž Upload PDF
  3. Select document β†’ System extracts text and generates embeddings

3. Test Chat

  1. Click Chat button
  2. Type message: "What is AI?"
  3. AI responds using workflow configuration

πŸ› οΈ Tech Stack

Layer Technology Purpose
Frontend React 18 + Vite UI framework & build tool
React Flow Visual node editor
Tailwind CSS Styling
Backend Node.js + Express REST API server
Mongoose MongoDB ODM
Database MongoDB Document storage
AI Google Gemini API Language model
Google Embeddings Vector generation
File Processing pdf-parse PDF text extraction

πŸ“ Project Structure

workflow-builder/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/          # Database connection
β”‚   β”‚   β”œβ”€β”€ controllers/     # Request handlers
β”‚   β”‚   β”œβ”€β”€ models/          # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”‚   β”œβ”€β”€ routes/          # API endpoints
β”‚   β”‚   └── server.js        # Entry point
β”‚   β”œβ”€β”€ uploads/             # PDF storage
β”‚   β”œβ”€β”€ .env                 # Environment variables
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/        # API client
β”‚   β”‚   └── App.jsx
β”‚   β”œβ”€β”€ .env
β”‚   └── package.json
β”‚
└── README.md

πŸ”Œ API Endpoints

Workflows

  • GET /api/workflows - List all workflows
  • POST /api/workflows - Create workflow
  • GET /api/workflows/:id - Get workflow
  • PUT /api/workflows/:id - Update workflow
  • DELETE /api/workflows/:id - Delete workflow

Documents

  • POST /api/documents/upload - Upload PDF
  • GET /api/documents - List documents
  • DELETE /api/documents/:id - Delete document

Chat

  • POST /api/chat/query - Execute query
  • GET /api/chat/history - Get chat history
  • DELETE /api/chat/history - Clear history

πŸ§ͺ Testing

# Backend tests
cd backend
npm test

# Frontend tests
cd frontend
npm test

πŸ“š Documentation

🀝 Contributing

  1. Fork repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open Pull Request

πŸ™ Acknowledgments

πŸ› Known Issues

  • PDF processing limited to text-based documents (no OCR)
  • Maximum file size: 10MB
  • Gemini API rate limits apply to free tier