# Agent Workflow Builder **AI workflow builder that turns plain English into complex automation pipelines with drag-and-drop magic โœจ** An open-source, visual workflow builder for creating AI-powered agent workflows, similar to N8N or Zapier, built with React Flow and modern web technologies. Create sophisticated automation workflows with AI models, web scraping, and data processing capabilities. **๐Ÿš€ Build AI workflows without code: describe, drag, drop, execute. Like Zapier but smarter!** ## Data Flow Architecture ```mermaid sequenceDiagram participant U as User participant UI as React UI participant S as Zustand Store participant E as Execution Engine participant P as Processors participant A as AI Services participant D as Database/APIs U->>UI: Create/Edit Workflow UI->>S: Update Workflow State S->>UI: Re-render Components U->>UI: Execute Workflow UI->>S: Trigger Execution S->>E: Start Execution Engine E->>E: Create Execution Plan E->>E: Validate Workflow E->>P: Execute Node Processors P->>A: Call AI Services A-->>P: Return Results P->>D: Call External APIs D-->>P: Return Data P-->>E: Node Results E->>S: Update Execution State S->>UI: Update UI with Results UI-->>U: Show Execution Results ``` ## ๐Ÿš€ Features ### ๐ŸŽจ Visual Workflow Editor _Turn ideas into workflows with zero coding_ - **๐ŸŽฏ Drag & Drop Interface**: Intuitive node-based workflow creation - **โšก Real-time Connection**: Connect nodes with visual edges - **๐Ÿ“š Node Palette**: Easy access to all available node types - **๐Ÿ“ฑ Responsive Design**: Works on desktop and tablet devices - **๐Ÿ”— Smart Variable Substitution**: Use `{{nodeId.output}}` or `{{nodelabel.output}}` to pass data between nodes ### ๐Ÿค– AI-Powered Node Types _Pre-built intelligence for every automation need_ - **๐ŸŒ Web Scraping**: Extract data from websites using Firecrawl AI - **๐Ÿค– LLM Task**: General language model operations (DeepSeek, OpenAI) - **๐Ÿง  Embedding Generator**: Create vector embeddings for semantic search - **๐Ÿ” Similarity Search**: Find similar content in vector stores - **๐Ÿ“‹ Structured Output**: Parse and structure data with JSON schemas - **๐Ÿ“ฅ Data Input**: Workflow entry points (text, JSON, CSV, URL, PDF) - **๐Ÿ“ค Data Output**: Workflow exit points with multiple formats ### ๐Ÿง  AI Copilot Assistant _Your AI assistant that reads your mind and builds workflows_ - **๐Ÿ—ฃ๏ธ Natural Language Processing**: Describe workflows in plain English - **โœจ Intelligent Workflow Generation**: AI creates workflows from descriptions - **๐Ÿ’ก Contextual Suggestions**: Get smart recommendations based on your workflow - **๐Ÿ” Validation & Optimization**: Automatic workflow validation and improvement tips - **๐ŸŽฏ Mixed Intent Analysis**: Handle complex, multi-step workflow requirements ### ๐Ÿ“ Workflow Management _Organize, share, and scale your automations_ - **๐Ÿ’พ Save & Load**: Persistent workflow storage in browser - **๐Ÿ“ค Import/Export**: Share workflows as JSON files - **๐Ÿ“Š Version Control**: Track workflow changes with timestamps - **๐Ÿ“š Workflow Library**: Manage multiple workflows with search and filtering - **๐ŸŽฏ Demo Workflows**: Pre-built example workflows to get started ### โšก Execution & Testing _See your workflows come to life in real-time_ - **๐Ÿš€ Real-time Execution**: Step-by-step workflow processing with live updates - **๐Ÿ‘๏ธ Visual Feedback**: Live status indicators for each node (idle, running, success, error) - **๐Ÿงช Test Interface**: Run workflows with sample data and custom inputs - **๐Ÿ“‹ Execution Logs**: Detailed execution history and debugging information - **๐Ÿ› ๏ธ Error Handling**: Clear error messages and recovery suggestions - **๐Ÿ“Š Performance Monitoring**: Track execution times and resource usage ### ๐Ÿ”ง Advanced Features _Enterprise-grade capabilities for complex automations_ - **โš™๏ธ Configurable Parameters**: Customize each node's behavior and settings - **๐ŸŒŠ Data Flow Visualization**: See data passing between nodes in real-time - **๐Ÿ“Š Execution Results**: View and export workflow outputs in multiple formats - **๐Ÿงฉ Modular Architecture**: Easy to extend with new node types - **๐Ÿ“„ PDF Processing**: Upload and process PDF documents with text extraction - **๐Ÿ”Œ API Integration**: Seamless integration with DeepSeek, OpenAI, and Firecrawl APIs ## ๐Ÿ› ๏ธ Technology Stack _Built with modern, battle-tested technologies_ - **โš›๏ธ Frontend**: React 18 + TypeScript - **๐ŸŽจ Visual Editor**: React Flow v11 - **๐Ÿ’… Styling**: Tailwind CSS with custom animations - **๐Ÿ—ƒ๏ธ State Management**: Zustand - **๐ŸŽฏ Icons**: Lucide React - **๐Ÿ”” Notifications**: React Hot Toast - **๐Ÿค– AI Integration**: - DeepSeek API (primary LLM) - OpenAI API (alternative LLM) - Firecrawl AI (web scraping) - **๐Ÿ“„ PDF Processing**: Browser-based PDF.js - **๐Ÿ”จ Build Tool**: Create React App ## ๐Ÿš€ Quick Start _Get up and running in under 5 minutes_ 1. **๐Ÿ“ฅ Clone the repository** ```bash git clone https://github.com/Nikhil-Doye/workflow-builder.git cd workflow-builder ``` 2. **๐Ÿ“ฆ Install dependencies** ```bash npm install ``` 3. **๐Ÿ”‘ Configure API Keys** _(Optional but recommended)_ - The app will prompt you to configure API keys on first launch - You can also configure them later through the settings menu - Required APIs: - **DeepSeek API**: For LLM tasks and AI processing - **Firecrawl API**: For web scraping functionality - **OpenAI API**: Alternative LLM provider 4. **โ–ถ๏ธ Start the development server** ```bash npm start ``` 5. **๐ŸŒ Open your browser** Navigate to `http://localhost:3000` ## ๐ŸŽฏ How to Use ### Method 1: AI Copilot (Recommended) ๐Ÿค– 1. **Start the Application** - Open the app in your browser - Click "New Workflow" to create your first workflow 2. **Use AI Copilot** - Click the "AI Copilot" button in the toolbar - Describe your workflow in natural language (e.g., "scrape a website and analyze the content") - Let the AI generate the workflow structure for you - Review and modify the generated workflow as needed 3. **Test and Execute** - Use the Testing Panel to provide sample input data - Click "Run Test" to execute the workflow - View results in real-time as each node processes ### Method 2: Manual Workflow Creation ๐ŸŽจ 1. **Add Nodes** - Click "Show Node Palette" to reveal available node types - Drag nodes from the palette onto the canvas - Connect nodes by dragging from output handles to input handles 2. **Configure Nodes** - Click on any node to open its configuration panel - Set parameters like URLs, prompts, model settings, etc. - Use variable substitution: `{{nodeId.output}}` or `{{nodelabel.output}}` to pass data between nodes 3. **Test Your Workflow** - Use the Testing Panel to provide sample input data - Click "Run Test" to execute the workflow - View results in real-time as each node processes 4. **Save and Export** - Click "Save" to persist your workflow - Use "Export" to download your workflow as a JSON file - Share workflows by importing JSON files ### ๐Ÿ’ก Example Workflows #### ๐ŸŒ Web Scraping + AI Analysis _Extract data from websites and analyze with AI_ 1. **Data Input** โ†’ **Web Scraping** โ†’ **LLM Task** โ†’ **Data Output** 2. Configure the Web Scraping node with a URL 3. Set up the LLM Task with a prompt like "Analyze this content: {{scraper.output}}" 4. Test with a sample URL #### ๐Ÿ“„ Document Processing Pipeline _Process PDFs and extract structured data_ 1. **Data Input (PDF)** โ†’ **LLM Task** โ†’ **Structured Output** โ†’ **Data Output** 2. Upload a PDF document 3. Extract and process the text with AI 4. Structure the output according to a JSON schema #### ๐Ÿ” Embedding & Search Workflow _Find similar content using vector search_ 1. **Data Input** โ†’ **Embedding Generator** โ†’ **Similarity Search** โ†’ **Data Output** 2. Create embeddings from input text 3. Search for similar content in a vector store 4. Return the most relevant results ## ๐Ÿ—๏ธ Architecture _Scalable, modular design for enterprise use_ ### ๐Ÿ“ Project Structure ``` src/ โ”œโ”€โ”€ components/ # React components โ”‚ โ”œโ”€โ”€ nodes/ # Node type components โ”‚ โ”‚ โ”œโ”€โ”€ BaseNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ DataInputNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ DataOutputNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ WebScrapingNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ LLMNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ EmbeddingNode.tsx โ”‚ โ”‚ โ”œโ”€โ”€ SimilaritySearchNode.tsx โ”‚ โ”‚ โ””โ”€โ”€ StructuredOutputNode.tsx โ”‚ โ”œโ”€โ”€ WorkflowEditor.tsx โ”‚ โ”œโ”€โ”€ WorkflowList.tsx โ”‚ โ”œโ”€โ”€ WorkflowToolbar.tsx โ”‚ โ”œโ”€โ”€ NodeConfiguration.tsx โ”‚ โ”œโ”€โ”€ ExecutionPanel.tsx โ”‚ โ”œโ”€โ”€ TestingPanel.tsx โ”‚ โ”œโ”€โ”€ CopilotPanel.tsx โ”‚ โ”œโ”€โ”€ OnboardingModal.tsx โ”‚ โ””โ”€โ”€ OpenAIConfig.tsx โ”œโ”€โ”€ services/ # External service integrations โ”‚ โ”œโ”€โ”€ openaiService.ts โ”‚ โ”œโ”€โ”€ firecrawlService.ts โ”‚ โ”œโ”€โ”€ copilotService.ts โ”‚ โ””โ”€โ”€ pdfService.ts โ”œโ”€โ”€ store/ # State management โ”‚ โ””โ”€โ”€ workflowStore.ts โ”œโ”€โ”€ types/ # TypeScript definitions โ”‚ โ””โ”€โ”€ index.ts โ”œโ”€โ”€ utils/ # Utility functions โ”‚ โ”œโ”€โ”€ workflowSerialization.ts โ”‚ โ”œโ”€โ”€ workflowValidator.ts โ”‚ โ”œโ”€โ”€ workflowGenerator.ts โ”‚ โ”œโ”€โ”€ variableSubstitution.ts โ”‚ โ””โ”€โ”€ patternMatchers.ts โ”œโ”€โ”€ examples/ # Example workflows and documentation โ””โ”€โ”€ App.tsx # Main application ``` ### ๐Ÿ”ง Key Components - **๐ŸŽจ WorkflowEditor**: Main visual editor using React Flow with drag-and-drop functionality - **๐Ÿค– CopilotPanel**: AI-powered workflow generation and assistance - **โš™๏ธ NodeConfiguration**: Modal for configuring node parameters and settings - **โšก ExecutionPanel**: Real-time execution monitoring with live status updates - **๐Ÿงช TestingPanel**: Test interface with sample data and custom inputs - **๐Ÿ“š WorkflowList**: Workflow management with search, filtering, and CRUD operations - **๐Ÿ—ƒ๏ธ workflowStore**: Centralized state management with Zustand for workflow data - **๐Ÿ”Œ Services**: Modular service layer for AI APIs, web scraping, and PDF processing ## ๐Ÿ”ง Configuration _Set up your AI integrations in minutes_ ### ๐Ÿ”‘ API Keys Setup The application requires API keys for full functionality: 1. **DeepSeek API Key** (Primary LLM) - Get your key from [DeepSeek Platform](https://platform.deepseek.com/api_keys) - Used for LLM tasks and AI processing - Format: `sk-...` 2. **Firecrawl API Key** (Web Scraping) - Get your key from [Firecrawl](https://firecrawl.dev) - Used for web scraping functionality - Format: `fc-...` 3. **OpenAI API Key** (Alternative LLM) - Get your key from [OpenAI Platform](https://platform.openai.com/api-keys) - Used as fallback for LLM tasks - Format: `sk-...` ### Node Types and Parameters Each node type supports specific configuration options: #### Variable Substitution with Node Labels The workflow builder now supports intuitive variable substitution using node labels: **Traditional Method (Node IDs):** ``` {{node-1234567890.output}} ``` **New Method (Node Labels):** ``` {{Website URL.output}} {{Web Scraper.output}} {{Content Analyzer.output}} ``` **Benefits:** - **More Intuitive**: Use descriptive names instead of cryptic IDs - **Easier to Read**: Workflow configurations are self-documenting - **Better UX**: No need to remember or look up node IDs - **Backward Compatible**: Both methods work together **Requirements:** - Each node must have a unique label within the workflow - Labels are case-sensitive - Empty labels are not allowed - The system validates label uniqueness automatically #### Web Scraping Node (Firecrawl AI) - `url`: Target website URL (supports variable substitution) - `formats`: Output formats (markdown, html, text, summary, links, images) - `onlyMainContent`: Extract only main content (boolean) - `includeTags`: CSS selectors to include (comma-separated) - `excludeTags`: CSS selectors to exclude (comma-separated) - `maxLength`: Maximum content length to extract - `waitFor`: Wait time for dynamic content (milliseconds) - `timeout`: Request timeout (milliseconds) #### LLM Task Node - `prompt`: The prompt to send to the language model (supports variables) - `model`: AI model selection (deepseek-chat, deepseek-reasoner) - `temperature`: Response creativity (0-2, default: 0.7) - `maxTokens`: Maximum response length (default: 1000) #### Data Input Node - `dataType`: Input data type (text, json, csv, url, pdf) - `defaultValue`: Default input value or sample data #### Data Output Node - `format`: Output format (json, text, csv) - `filename`: Output filename for exports #### Embedding Generator - `model`: Embedding model selection (text-embedding-ada-002, text-embedding-3-small) - `dimensions`: Vector dimensions (default: 1536) #### Similarity Search - `vectorStore`: Target vector database (pinecone, weaviate, chroma) - `topK`: Number of similar results to return (default: 5) - `threshold`: Similarity threshold (0-1, default: 0.8) #### Structured Output - `schema`: JSON schema for structured output - `model`: AI model for structured generation ## ๐Ÿš€ Deployment _Deploy to your favorite platform_ ### ๐Ÿ“ฆ Build for Production ```bash npm run build ``` The build artifacts will be stored in the `build/` directory. ### Deploy to Vercel ```bash npm install -g vercel vercel --prod ``` ### Deploy to Netlify ```bash npm run build # Upload the 'build' folder to Netlify ``` ### Deploy to GitHub Pages ```bash npm run build # Push the build folder to a gh-pages branch ``` ### Environment Variables For production deployment, you may want to set up environment variables: - `REACT_APP_DEEPSEEK_API_KEY`: DeepSeek API key - `REACT_APP_FIRECRAWL_API_KEY`: Firecrawl API key - `REACT_APP_OPENAI_API_KEY`: OpenAI API key Note: API keys are currently stored in browser localStorage for security. ## ๐Ÿค Contributing _Help us make automation accessible to everyone_ We welcome contributions! Here's how you can help: 1. **๐Ÿด Fork the repository** 2. **๐ŸŒฟ Create a feature branch**: `git checkout -b feature/amazing-feature` 3. **๐Ÿ’พ Commit your changes**: `git commit -m 'Add amazing feature'` 4. **๐Ÿ“ค Push to the branch**: `git push origin feature/amazing-feature` 5. **๐Ÿ”€ Open a Pull Request** ### ๐Ÿ“‹ Development Guidelines - โœ… Follow TypeScript best practices - ๐ŸŽจ Use Tailwind CSS for styling - ๐Ÿ“ Write meaningful commit messages - ๐Ÿงช Add tests for new features - ๐Ÿ“š Update documentation as needed ## ๐Ÿ› Troubleshooting _Quick fixes for common issues_ ### ๐Ÿ”ง Common Issues **๐Ÿ”‘ API Key Issues** - Ensure API keys are properly configured in the settings - Check that API keys have the correct format (sk-... for AI, fc-... for Firecrawl) - Verify API keys have sufficient credits/permissions **๐Ÿ”— Nodes not connecting?** - Ensure you're dragging from output handles (bottom) to input handles (top) - Check that nodes are properly positioned and not overlapping - Verify the workflow has a clear data flow path **โšก Workflow not executing?** - Verify all required node parameters are configured - Check the execution panel for detailed error messages - Ensure all nodes are properly connected in sequence - Check that variable substitutions are correct (e.g., `{{nodeId.output}}` or `{{nodelabel.output}}`) **๐ŸŒ Web Scraping Issues** - Verify the target URL is accessible and not blocked - Check Firecrawl API key and credits - Try different output formats or content selectors - Ensure the website allows scraping (check robots.txt) **๐Ÿค– LLM Task Issues** - Verify AI API key is valid and has credits - Check that prompts are properly formatted - Ensure variable substitutions in prompts are correct - Try different models or adjust temperature settings **๐Ÿ“ค Import/Export not working?** - Ensure you're using valid JSON format - Check browser console for error messages - Verify the workflow structure is complete **๐Ÿ“„ PDF Processing Issues** - Ensure the PDF file is not password-protected - Check file size limits (large files may timeout) - Verify the PDF contains extractable text (not just images) ### ๐Ÿ†˜ Getting Help - ๐Ÿ” Check the **Execution Panel** for detailed error messages and logs - ๐Ÿงช Use the **Testing Panel** to debug with sample data - ๐Ÿค– Review the **AI Copilot** suggestions for workflow improvements - ๐Ÿ–ฅ๏ธ Check browser console for technical error details ## ๐Ÿ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## ๐Ÿ™ Acknowledgments _Built with amazing open-source tools_ - [React Flow](https://reactflow.dev/) for the visual editor - [Tailwind CSS](https://tailwindcss.com/) for styling - [Lucide React](https://lucide.dev/) for icons - [Zustand](https://github.com/pmndrs/zustand) for state management - [DeepSeek](https://www.deepseek.com/) for AI language models - [Firecrawl](https://firecrawl.dev/) for web scraping capabilities - [OpenAI](https://openai.com/) for alternative AI models ## ๐Ÿ“š Additional Resources _Everything you need to master workflow automation_ - ๐Ÿ“– [Getting Started Guide](GETTING_STARTED.md) - Detailed setup and first workflow tutorial - ๐Ÿ”— [Variable Substitution Examples](src/examples/variableSubstitutionExample.md) - Learn how to pass data between nodes - ๐ŸŽฏ [Demo Workflows](public/demo-workflows.json) - Pre-built example workflows ## ๐Ÿ“ž Support _We're here to help_ - ๐Ÿ› **Issues**: [GitHub Issues](https://github.com/your-username/agent-workflow-builder/issues) - ๐Ÿ’ฌ **Discussions**: [GitHub Discussions](https://github.com/your-username/agent-workflow-builder/discussions) - ๐Ÿ“š **Documentation**: Check the Getting Started guide and examples ## ๐Ÿ”ฎ Roadmap _What's coming next_ - [ ] ๐Ÿค– More AI model integrations (Claude, Gemini) - [ ] ๐Ÿ“‹ Advanced workflow templates - [ ] ๐Ÿ‘ฅ Team collaboration features - [ ] โฐ Workflow scheduling and automation - [ ] ๐Ÿ› ๏ธ Custom node development SDK - [ ] ๐Ÿ“Š Workflow analytics and monitoring - [ ] ๐Ÿ—„๏ธ Database integrations - [ ] ๐Ÿ”Œ API endpoint creation --- **Built with โค๏ธ for the AI community** _Empowering developers to create sophisticated AI workflows without the complexity._